ClaudeCodeMod

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.

In Claude Code
/plugin marketplace add YeonwooSung/my-claude-code-mods
/plugin install context-inspector@my-claude-code-mods
Open the repo

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

The context-inspector section on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • session.endWhen a session ends
  • session.appendWhen an entry is written to the transcript
  • tool.callAround a tool call, where it can hold one
  • turn.stepAt each step of a turn
  • session.compactWhen the context is compacted
  • turn.completeWhen a turn ends
  • command.runWhen you run its slash command/context-inspect/context-pane/context-export
  • ui.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
Repo
YeonwooSung/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

Other mods in Usage

heatmaphamzaferDraws a GitHub-style grid of your Claude Code time in a pane, one square per day, with your streak, peak hours, and top projects.openrouter-balancehamzaferDraws your OpenRouter credit above the prompt: the balance with a gauge, today's spend, and the model the money mostly went to.winnowGhalebDweikatReplaces parts of a large Read, Bash, or Grep result a judge calls unneeded with a stub, a summary, and a key that brings the text back, then toasts.compact-adviserkunchenguidDraws a hint above the prompt to run /compact when Jev calls the session a finished checkpoint, and can run /compact itself if you opt in.fast-jev-compactiontamaratranShows a toast when /compact keeps the messages Jev still wants and drops the rest, instead of replacing the history with a summary.effortlessHeyCubitDraws a bar above the prompt with the reasoning effort it picked for this prompt, how full the chat is, and how long the prompt cache stays warm.headroom-snipheadroomlabs-aiDraws a band above the prompt showing Headroom cutting each request from its original token count to what was sent, with a /headroom log and a running total.leaksdavekissOpens a pane that ranks the avoidable spend in the last 7 days of transcripts, and draws a strip above the prompt when a leak is happening.context-dietdrkokorevReplaces a huge tool output with a short digest and the path of a file that still holds the full text, and /diet opens a panel of what it saved.agent-profilerYeonwooSungDraws where a session's time goes, model wait against tools and subagents, in a status line and a live pane, and can write the session out as an OTLP trace.claude-carbongwittebolleDraws the CO2 of each answer and a pane with a pixel molecule colored against your past sessions, plus this session's total under the prompt.dividendMint-SecurityDraws a tip above the prompt about the prompt cache, the context, or the plan limits, with a status line and a /dividend pane of the session's figures.
All 183 in Usage