All shelves / Mods / Usage
context-inspector
By YeonwooSung
context-inspector is a Claude Code usage mod by YeonwooSung.
Draws what fills the context window and how much of it is waste: re-reads, near-duplicate output, and what compaction kept, with advice and its evidence.
Draws
Install
The marketplace name is my-claude-code-mods.
/plugin marketplace add YeonwooSung/my-claude-code-mods /plugin install context-inspector@my-claude-code-mods
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.1.4
- License
- Apache-2.0
- Repo stars
- 1089
- Last change
- 2026-10-23
What it can reach
- Draws in the session
- Reads usage or context figures
- Sees tool calls
- Reads this turn's file edits
Claude Code 2.1.287 or later; older builds need CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. The author says it only observes, and never changes rows, tool calls, or compaction. The status line shows the window's fill, which is measured, and the waste still in the window, which is estimated. /context-inspect prints a text report: an overview, what occupies the window by category and file, re-reads of a file sorted by why, exact and near-duplicate outputs, what each compaction kept and lost, lines changed against input growth per turn, and advice with its evidence and estimated savings. --agents adds subagents. Per-item tokens are estimated at four characters each, calibrated against the measured input growth. Near duplicates are lexical, not semantic. Compaction survival is judged by substring match, so anything the summary paraphrases counts as lost. /context-pane opens the live pane in the terminal and the desktop app; the VS Code panel gets the command text only, and claude -p only records. /context-export saves metadata only, no raw content, as JSONL in ~/.claude/context-inspector, with secrets masked on a best-effort basis; the author says to review exports before sharing. A toast shows the first high-priority advice once per session. On reload, resume, or /clear, the ledger starts over from the main conversation.
The marketplace, my-claude-code-mods, also holds agent-profiler and other mods by the same author. This one installs on its own. Accounting for what fills the context window is why this page files it under usage. context-xray, by VedantAndhale, draws a pane with the exact breakdown of what fills the context window. reread-guard, by VedantAndhale, skips a repeat read of a file that has not changed and counts the re-reads it skipped. This one changes nothing: it shows which reads and outputs are waste and what compaction lost, and gives advice with the evidence. The author says it contacts no network host and writes only the export files.
Demo

What it hooks into
session.startWhen a session startssession.endWhen a session endssession.appendWhen an entry is written to the transcripttool.callAround a tool call, where it can hold oneturn.stepAt each step of a turnsession.compactWhen the context is compactedturn.completeWhen a turn endscommand.runWhen you run its slash command/context-inspect/context-pane/context-exportui.renderDraws into the sessionPane
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- YeonwooSung
- Category
- Usage
- Marketplace
- my-claude-code-mods
- Folder
- context-inspector
- Version
- 0.1.4
- License
- Apache-2.0
- Repo stars
- 1089
- Last change
- 2026-10-23
- Language
- TypeScript
- Files
- 35