johntrob14/lens-view
lens-view
コーディングエージェントの横で動作する lens trace(Jacobian lens、logit lens、tuned lens)のビューアーです。Claude Code プラグインの /lens-view コマンドと、Claude Code 内にペインを開くモデル呼び出し可能なツール、MCP フロントエンド、単体のターミナルビューアーを提供します。
この mod について
lens-view は Jacobian lens、logit lens、tuned lens が各レイヤーと token 位置で報告する内容を読み出し、その trace を生成したコーディングエージェントの横に表示します。Claude Code フロントエンドはプラグイン marketplace からインストールする mod です(/plugin marketplace add johntrob14/lens-view の後に /plugin install lens-view@lens-view)。/lens-view <path> コマンドとモデルが呼び出すツールを提供し、どちらも Claude Code 内にペインを開きます。他のエージェントでは MCP ツール lens_view を使って tmux ペインにターミナルビューアーを開けます。ターミナルビューアーは lens-view trace.json として単体でも実行できます。すべてのフロントエンドは 1 つのパーサー(src/lens_view/trace.py)を共有し、uv が必要です。tmux フロントエンドではエージェントを tmux 内で実行する必要があります。trace 形式はドラフト(FORMAT.md)で、今後変更されます。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add johntrob14/lens-view claude plugin install lens-view
原文 / 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