context-view

Reviewed at commit 30afc56

The context window as one row above the prompt, drawn like Claude Code's own meters, with the percentage used, tokens over the window and tokens left before…

Made by
kongyo2
What we checked

Draws one row above the prompt with the context window fill, percentage and tokens left before auto-compact, and /context-view hides or shows it. An optional setting, off by default, adds a short line with the same token figures to your prompts and to Claude's tool results so Claude can see them. It makes no network calls, runs no programs and stores only whether the row is hidden.

Review details

Static review of the source at the pinned commit; not run. Hooks: session.start, classic.SessionStart (clear, resume, fork), command.run (clear, resume, branch, autocompact, model, context-view), session.measure, turn.step, session.compact, classic.PostModelSwitch, config.set (autoCompact), ui.render (AbovePrompt), and only when the awareness option is on, prompt.submit and tool.call. Runtime calls: $.session.usage (token counts), $.env.get for TERM and TERM_PROGRAM (glyph choice), $.store.get/set for the hidden flag, $.command.register, $.ui.log (debug), $.clock.after/every (a recheck every two seconds), plugin state atoms. With awareness on, prompt.submit appends one line to the prompt context and tool.call appends one line to the context of Claude's own tool results (not subagents, not denied calls); the line reads 'context-view: your context holds X/Y tokens' with headroom before auto-compact, and contains only figures. Otherwise tool.call passes the result through unchanged and no hook blocks, rewrites or approves anything. New in 0.4.0 versus the previous review: the awareness option group (awareness, awarenessFrom, awarenessWithin, awarenessStep, awarenessAt), the context-note hooks, a loop-total check and a number formatter. No fetch, eval, file access, process or spawn. Not included in the bundle were the small meter and view files (band.tsx, bar.tsx, meter/*, hooks/index.ts), which only draw cells and were not read; the import-resolution notes are from the bundler and are TypeScript type imports. No npm dependencies.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: yes
  • Blocks or changes tool calls: no
  • Reads or writes files: no
  • Runs programs on your machine: no
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events

The context window as one row above the prompt, drawn the way Claude Code draws its own meters: the context's cells, the percentage used, the tokens over the window, and the tokens left before auto-compact. /context-view hides and shows it.

Made this mod? Add a badge to your README

modsforClaude badge for context-view

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/context-view.svg)](https://modsforclaude.com/mods/context-view/)

← All mods