self-verify-beacon-in-…
Verify a Beacon change end to end by running a real Claude Code session inside a disposable…
Create, revise, debug or validate a Beacon lens, a single HTML file that renders one agent trace as a purpose-built view (a per-file review, a cost breakdown, a timeline of risky commands, a map of tool use) in a sandboxed tab of the local Beacon dashboard, fed once through
$ npx -y skills add Asymptote-Labs/agent-beacon --skill beacon-lens-create --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/beacon-lens-createContext preview
The summary Claude sees to decide when to auto-load this skill.
Create, revise, debug or validate a Beacon lens, a single HTML file that renders one agent trace as a purpose-built view (a per-file review, a cost breakdown, a timeline of risky commands, a map of tool use) in a sandboxed tab of the local Beacon dashboard, fed once through
name: beacon-lens-create description: Create, revise, debug or validate a Beacon lens, a single HTML file that renders one agent trace as a purpose-built view (a per-file review, a cost breakdown, a timeline of risky commands, a map of tool use) in a sandboxed tab of the local Beacon dashboard, fed once through window.beacon.getTrace(). Use when the user asks to "make a lens", "build a view of my traces", "visualize this session", wants a custom tab next to the full session in the Beacon dashboard, or when a lens fails to load, renders wrong, or needs checking before install. license: MIT compatibility: Requires the Beacon CLI (beacon) on PATH with endpoint capture installed, so there are traces to render. Reads only local state and makes no network calls. metadata: author: asymptote-labs homepage: https://docs.beacon.sh/concepts/lenses version: "0.1.0"
A **lens** is one self-contained HTML file that renders one agent trace: the prompts, agent messages, tool calls, commands, file edits, approvals, token usage and threat-rule findings Beacon recorded for a session. The local dashboard (`beacon endpoint dashboard`) shows lenses as tabs on a session's page, next to **Full session**, and runs each one in a locked-down frame.
You write the file, check it against the user's real sessions, and install it. Nothing is published anywhere: lenses live on this machine.
beacon version
If `beacon` is not found, tell the user that lenses need the Beacon CLI, point them to https://docs.beacon.sh/get-started/overview, and stop. Do not install it yourself.
Start from the user's description. If it is missing, or leaves a choice open that changes what the numbers mean (what counts as a "turn", a "failure", a "risky" command, which cost total), ask one focused question before building. Define each unit from this request, not from another lens, and label anything derived or estimated as such.
beacon lenses spec # the format, the data, the sandbox, the style tokens beacon lenses spec --example # a complete working lens to start from beacon lenses list # lens ids already in use beacon lenses data # exactly what getTrace() returns for the latest session beacon lenses data --session <session-id>
Read the whole spec before writing anything. Then look at real data rather than guessing its shape from the spec: note which event `type`s the user's sessions carry, whether `file.diff`, `command.output` or `usage` is present, and whether `findings` exists. Design for those, and for sessions that lack them. The output contains whatever content the log retained (prompts, command output, diffs), so read it locally and do not paste large amounts back to the user.
One HTML file. No build step, bundler or `package.json`. Write it in the user's project or a scratch directory, never directly in the lens store.
The dashboard enforces these; a lens that breaks them fails to install or fails to run.
images and fonts). Inlining a library is allowed but counts against the size and costs parse time on every open; prefer a few lines of your own.
`<script type="application/beacon-lens+json">`, holding `id`, `title`, `version` and `"api": "beacon.lens.v1"` (optionally `description`, `icon`, `author`; unknown keys are an error). The `id` is lowercase letters, digits and hyphens, and cannot be a built-in lens's id.
XHR, WebSockets, `EventSource`, `sendBeacon`, remote scripts, stylesheets, fonts and images, `@import`, workers, nested frames, `eval` and `new Function`.
cookies, `localStorage`, `sessionStorage` or IndexedDB, no access to the parent page, no popups or forms. Keep state in memory.
The host defines `window.beacon` before your scripts run. Its one call is the whole data API:
const data = await window.beacon.getTrace();
It resolves once with everything you get and never refreshes. Calling it again returns the same promise. It rejects with an `Error` if the trace does not arrive within 10 seconds; show that message instead of a blank tab.
The result is `LensDataV1`; `beacon lenses spec` has the full shape. The parts you will use most:
`repository`, `model`, `token_usage`.
optional `title`, `summary`, `fidelity`, `content`, `tool`, `command`, `file`, `mcp`, `approval`, `policy`, `error`, `model`, `usage`, `tool_call_id`. `error.type` is set when the runtime reported the action as failed, even on an event whose `type` is not `error`. `type` is one of `user_message`, `agent_message`, `agent_reasoning`, `tool_call`, `tool_result`, `command`, `file`, `mcp`, `approval`, `token_usage`, `session`, `error`, `other`, and the list can grow.
usage at all.
Things that are easy to get wrong:
`file.diff` arrive as `{text?, included, retention, redacted?, truncated?,
The cross-harness, self-improving memory layer for AI agents.
Verify a Beacon change end to end by running a real Claude Code session inside a disposable…
Turn recorded agent sessions (Beacon traces from Claude Code, Cursor, Codex, OpenCode, and…
Install approved Beacon project memory as an Agent Skill in the repository…
Retrieve reviewed project memory that Beacon distilled from earlier agent sessions in any…