forge-context-status

forge-context-status is a command for Claude Code from luiseiman/dotforge. It costs 26 tokens per session (508 once invoked), scanned B, original, MIT.

A read-only command that reports estimated conversation-context usage, cache status, and whether the session may need compaction. Context is the amount of conversation and project information the agent can keep available.

In plain words
What is it for?
Use it to inspect approximate context consumption, cache health, recent session edits, and the recommendation for continuing or compacting the session.
Why use it?
It helps identify when a session is becoming too large or tool reads may be slower, before that affects the agent’s work.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the dotforge plugin — 25 skills, 25 commands, 7 agents, 8 hooks shipped together

Good fit Use it to inspect approximate context consumption, cache health, recent session edits, and the recommendation for continuing or compacting the session.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/luiseiman/dotforge/forge-context-status
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.

Clone the repo
git clone --depth 1 https://github.com/luiseiman/dotforge

Made for: Claude Code.

Or install dotforge, the plugin that ships this one along with the rest of its 25 skills, 25 commands, 7 agents, 8 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for forge-context-status

README.md
[![agentmods](https://agentmods.dev/badge/commands/luiseiman/dotforge/forge-context-status/github.svg)](https://agentmods.dev/commands/luiseiman/dotforge/forge-context-status)
Your own site
<a href="https://agentmods.dev/commands/luiseiman/dotforge/forge-context-status"><img src="https://agentmods.dev/badge/commands/luiseiman/dotforge/forge-context-status/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for forge-context-status

Your own site · 80×15
<a href="https://agentmods.dev/commands/luiseiman/dotforge/forge-context-status"><img src="https://agentmods.dev/badge/commands/luiseiman/dotforge/forge-context-status.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 508 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00026 $0.00508
Opus 5.5 $0.00010 $0.00203
Sonnet 5.5 $0.00005 $0.00102
Haiku 4.5 $0.00003 $0.00051

Measured 1mo ago against content hash 6a205b217375, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

forge-context-status scanned grade B with 1 finding 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Detect model from `~/.claude/settings.json` `model` field if available, default to 1M.
global/commands/forge-context-status.md · 38 lines

What it actually says

Read the current session transcript file (path is in the runtime — check $CLAUDE_TRANSCRIPT_PATH env var, or fall back to .claude/session/last-startup.md for the working tree state). Estimate context usage with this approach:

  1. Token estimation (proxy): use wc -c on the transcript file (if accessible), divide bytes by 5 for rough token count. This is approximate — actual context = transcript content + system prompt + memory injections.

  2. Context limit by model:

    • Sonnet 4.6 / Opus 4.7: 1M tokens → 80% threshold = 800K
    • Haiku 4.5: 200K tokens → 80% threshold = 160K Detect model from ~/.claude/settings.json model field if available, default to 1M.
  3. Cache health proxy: read /tmp/claude-tool-latency-<hash> (the project hash file written by tool-latency.sh). Latency p50 << 100ms on Read/Edit suggests hot cache. p50 > 500ms suggests cache miss / cold reads.

  4. Recent edits volume: count modifications in .claude/session/ and .git/index.lock recency.

Output a tight report:

═══ CONTEXT STATUS ═══
Model:               Sonnet 4.6 (1M context)
Estimated usage:     ~XX% (≈Y tokens)
Cache health proxy:  hot | warm | cold (based on tool latency p50)
Files modified:      N this session
Last compact:        <timestamp from .claude/session/last-compact.md, or "none">
Behaviors disabled:  <list from session state>

── RECOMMENDATION ──
< 70%:  Continue working
70-80%: Monitor; consider /forge compact-task at next task break
> 80%:  /forge compact-task NOW (evidence-based threshold)
> 90%:  /forge compact-task URGENT or risk auto-compact mid-task

Be honest about the estimation — token count is a proxy, not exact. If estimate seems off, mention it.

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. 1mo ago First seen · 38 lines · 26 tokens per session scan B 6a205b217375

Subscribe to this mod's changes

forge-context-status is a command published in the GitHub repository luiseiman/dotforge (8 stars, last pushed 21d ago), licensed MIT. It adds 26 tokens to every session and 508 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.