AI Agent Inspector
Agent Inspector is a read-only sidebar for local Codex and Claude Code sessions in desktop VS Code. It shows context usage, available quota, subagents, and background tasks.

Install
Use VS Code 1.96 or later. In Extensions, search for AI Agent Inspector by usio0108 and select Install. You can also install from a terminal.
code --install-extension usio0108.ai-agent-inspector
To install a local build, choose Install from VSIX… in Extensions and select ai-agent-inspector-0.1.0.vsix.
- Open a trusted workspace folder and run Codex or Claude Code as usual.
- Select Agent Inspector in the Activity Bar. Sessions appear automatically. The most recent interactive session for each provider stays visible in standby after its turn ends.
- Use Select Active Session or Set active to highlight a session card. Use Filter Provider to show one provider.
Expand Overview to see session names and status dots. Use − to remove a card. Expand Other sessions to see the model and context usage for sessions you can add. Use + to add a card.
Drag an Overview row by its handle to reorder the cards. You can also focus the handle and press Up or Down. Each card can collapse independently. Running sessions always appear first, with the oldest first. You can reorder running sessions among themselves. When a session stops, it returns to the order you set.
Each card shows the session title, model, reasoning, and elapsed time. Usage shows the quota used above Context. The bars turn orange above 60% used and red at 90% used. Set agentInspector.quotaDisplay to remaining to show the quota remaining. Expand Tokens for counts or Details for the session ID and workspace path. If the provider has no title, the sidebar uses a short preview of the first prompt when available.
Background tasks and subagents appear beneath the session that started them. A green dot marks observed running status and a red dot marks observed waiting for input. Finished background tasks and subagents stay visible for 10 seconds. Expand a subagent to see its current or most recent activity on one line. File and skill names open in the editor, and Diff opens a tracked Git change.
Data coverage
- Codex supplies model, reasoning, estimated context, token counters and quota snapshots when its rollouts contain them.
- Claude Code supplies model, token counts, and the latest request's input context from local transcripts. When the transcript omits the window size, the sidebar estimates the percentage for known model defaults or shows the input token count. The model name drops the
claude- prefix, for example opus-5-5.
- Claude Code transcripts record account quota only after a request is refused. The sidebar then shows that window at 100% with its reset time. To see quota at other times, see Claude Code quota.
- Running and waiting require recent runtime evidence. Stale activity leaves the live list. A running background command stays listed until its end is recorded, for up to 12 hours. Command rows use sanitized previews.
- Task and completion previews appear in subagent Details when records supply them. Recent file and skill activity uses correlated tool evidence.
Claude Code quota
Claude Code reports 5-hour and weekly quota on Claude.ai subscription plans. To show it in the sidebar, install the companion Claude Code plugin from this repository. When the sidebar first finds a Claude Code session, it offers to install the plugin. Select Install. You can also run AI Agent Inspector: Install Claude Usage Plugin from the Command Palette. To install it yourself, run these commands in Claude Code:
/plugin marketplace add usio0108/agent-inspector
/plugin install agent-inspector-usage@agent-inspector
Start a new Claude Code session after the install. To remove the plugin, run AI Agent Inspector: Uninstall Claude Usage Plugin. Uninstalling the extension also removes the plugin, after VS Code restarts. The plugin saves the quota to agent-inspector-usage.json in your Claude config directory each time Claude Code measures usage. It works in the terminal CLI and in the Claude Code VS Code extension.
Without the plugin, you can save the quota from a statusLine command instead. Only the terminal CLI runs statusLine, so the value can lag behind recent VS Code use. Add this entry to ~/.claude/settings.json:
"statusLine": {
"type": "command",
"command": "cat > \"$HOME/.claude/agent-inspector-usage.json\""
}
If you already use a statusLine command, write the file first and then pipe the input to your command, for example tee "$HOME/.claude/agent-inspector-usage.json" | your-command. If you set CLAUDE_CONFIG_DIR, write the file in that directory.
The quota applies to every Claude Code session in the sidebar. Agent Inspector reads only rate_limits from the file. Neither the extension nor the plugin reads Claude credentials or sends account requests.
Capability matrix · Runtime research · Verification · Security
Develop
Use Node.js 24 and npm. The extension has no runtime npm dependencies.
npm ci
npm run lint
npm run typecheck
npm test
npm run test:e2e
npm run bench
npm run package
The Extension Host test uses an isolated workspace and test profile. It uses the executable supplied in INSPECTOR_VSCODE, or downloads the pinned VS Code test build. Set INSPECTOR_SCREENSHOT to a writable PNG path to exercise the rendered tree and capture the sidebar. On headless Linux, run the test with xvfb-run -a.
| Path |
Responsibility |
src/providers/ |
Validate provider records and emit common events |
src/events.ts, src/state.ts |
Define the event model, correlate activity and assemble sessions |
src/collector.ts, src/jsonl.ts |
Discover, scope and incrementally read transcripts |
src/extension.ts, src/window-sessions.ts |
Scope session selection to the current window and handle file actions |
src/views.ts, src/sidebar-content.ts, media/sidebar.* |
Render a theme-aware sidebar, preserve disclosures and update timers |
tests/, .github/workflows/ |
Run parser, collector, VS Code and packaging checks |