claude-devtools:explain-visible-context

A guide to “Visible Context,” the part of an AI assistant's context window whose token usage can be identified and measured by source.

In plain words
What is it for?
Use it when answering questions about token attribution, context-window usage, tracked context categories, or the display of visible context.
Why use it?
It helps explain where context space is being used, such as instructions, files, tool outputs, and other tracked categories, and what is not counted.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/matt1398/claude-devtools/explain-visible-context
Clone the repo
git clone --depth 1 https://github.com/matt1398/claude-devtools

Made for: Claude Code.

Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,291 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.01291
Opus 5 $0.00028 $0.00646
Sonnet 5 $0.00011 $0.00258
Haiku 4.5 $0.00006 $0.00129

Measured 3d ago against content hash 712e127aad10, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-devtools:explain-visible-context scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/devtools/explain-visible-context.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Present the following explanation directly to the user. Output the full content below as your response — do not summarize, ask follow-up questions, or treat this as background context.

Visible Context

What It Is

"Visible Context" is the portion of Claude's context window that we can identify and measure. Every time Claude processes a turn, its context window fills with various pieces of information — your messages, file contents, tool outputs, thinking, and more. Visible Context tracks what we can attribute to a known source, so you can see where your tokens are going.

What We Track (6 Categories)

CLAUDE.md Files

Memory files that Claude loads automatically at the start of every session and after each compaction. These include:

  • Global CLAUDE.md (~/.claude/CLAUDE.md) — your personal instructions across all projects
  • Project CLAUDE.md (.claude/CLAUDE.md or CLAUDE.md at project root) — project-specific instructions
  • Directory CLAUDE.md — instructions scoped to subdirectories (e.g., src/renderer/CLAUDE.md)

These are injected repeatedly (once per compaction phase), so their token cost accumulates. A 500-token CLAUDE.md file injected across 3 compaction phases costs ~1,500 tokens total.

@-Mentioned Files

Files you reference with @path/to/file in your messages. When you mention a file, Claude Code injects the full file contents into the context. Large files consume significant tokens — a 1,000-line source file could use 5,000+ tokens per mention.

Tool Outputs

Results returned from tool executions: file reads (Read), command output (Bash), search results (Grep, Glob), and others. Every tool result stays in the context window until compaction. A Bash command that prints 500 lines of output or a Read of a large file both count here.

Thinking + Text Output

Claude's own output that consumes context:

  • Extended thinking — Claude's internal reasoning (when thinking mode is active). This can be substantial for complex tasks.
  • Text output — Claude's visible responses to you. Longer explanations and code blocks use more tokens.

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 105 lines · 57 tokens per session scan A 712e127aad10

Subscribe to this mod's changes

claude-devtools:explain-visible-context is a command published in the GitHub repository matt1398/claude-devtools (3,892 stars, last pushed 3mo ago), licensed MIT. It adds 57 tokens to every session and 1,291 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.