johntrob14/lens-view
lens-view
A viewer for lens traces (Jacobian lens, logit lens, tuned lens) that runs beside a coding agent. Ships a Claude Code plugin with a /lens-view command and a model-callable tool that open a pane inside Claude Code, plus an MCP front end and a standalone terminal viewer.
About this mod
lens-view reads out what a Jacobian lens, logit lens or tuned lens reports at every layer and token position, and displays it beside the coding agent that produced the trace. The Claude Code front end is a mod installed via the plugin marketplace (/plugin marketplace add johntrob14/lens-view then /plugin install lens-view@lens-view), providing a /lens-view <path> command and a tool the model calls, both opening a pane inside Claude Code. Other agents can use the MCP tool lens_view to open the terminal viewer in a tmux pane, and the terminal viewer also runs standalone as lens-view trace.json. All front ends share one parser (src/lens_view/trace.py) and require uv; the tmux front end requires the agent to run inside tmux. The trace format is a draft (FORMAT.md) and will change.
Installation
Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.
claude plugin marketplace add johntrob14/lens-view claude plugin install lens-view
Original text / README
lens-view
A viewer for lens traces: what a Jacobian lens, logit lens or tuned lens reads out at every layer and token position. It runs beside a coding agent, so you can look at a trace while you work on the code that produced it.
The trace format is described in FORMAT.md. It is a draft and will change.
Front ends
| Where | What you get | Install |
| --- | --- | --- |
| Claude Code (default) | A mod: a /lens-view <path> command and a tool the model calls, both opening a pane inside Claude Code | Plugin, below |
| Codex, or any agent with MCP | An MCP tool, lens_view, that opens the terminal viewer in a tmux pane beside the agent | MCP, below |
| A terminal | The terminal viewer on its own: lens-view trace.json | uv tool install git+https://github.com/johntrob14/lens-view |
All three read traces through the Python package (src/lens_view/trace.py). The mod calls lens-view-json, which prints a trace as normalized JSON, so there is one parser.
All three need uv. The tmux front end needs the agent to run inside tmux.
Claude Code plugin
/plugin marketplace add johntrob14/lens-view
/plugin install lens-view@lens-view
Codex and other MCP clients
# ~/.codex/config.toml
[mcp_servers.lens-view]
command = "uv"
args = ["run", "--quiet", "--frozen", "--no-dev", "--project", "/path/to/lens-view", "lens-view-mcp"]
env_vars = ["TMUX", "TMUX_PANE"]
The repository also carries a Codex plugin manifest (.codex-plugin/plugin.json, mcp.json).
Layout
| Path | What |
| --- | --- |
| src/lens_view/trace.py | Trace format: parsing, loading, lens-view-json |
| src/lens_view/app.py | Terminal viewer (Textual), lens-view |
| src/lens_view/pane.py, mcp_server.py | tmux pane launcher and MCP server, lens-view-mcp |
| .claude-plugin/, hooks/, types/ | Claude Code plugin: the mod |
| .codex-plugin/, mcp.json | Codex plugin |
Development
uv run --group dev pytest # Python
claude plugin validate . && claude plugin test . # the mod