agent-ctx
by The Agency · ★ 5 · updated yesterday
Each agent loop's own context %, measured per request; a one-line CONTEXT_PCT_ALERT rides that agent's next tool result when it crosses 70% or 80%
Install
git clone https://github.com/Tekkiiiii/the-agencyclaude --plugin-dir ./the-agency/mods/agent-ctxThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
turn.steptool.call- API calls
$.env.get$.fs.read$.session.usage$.state.get$.state.set- Can see
every tool call- Reach
- level 1 of 3 other: $.state.getother: $.state.setreads filesreads env vars
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/Tekkiiiii/the-agency
- Path in repo
mods/agent-ctx- Source commit
f5d1eb9the exact code the scan read- Author
- The Agency @Tekkiiiii
- License
- No license declared — ask the author before reusing code.
- First published
- Last pushed
- First listed here
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
More from Tekkiiiii/the-agency
context-band
Tekkiiiii/the-agency
Band above the prompt: context %, tokens, model, cost, prompt-cache size/share/TTL countdown, 5h and weekly usage-window reset timers and next-request estimate; /ctx opens a detail pane; toast when a background subagent finishes; Jev router line (today's calls, tokens, USD, Haiku fallback) and outage warning, hidden unless the router usage log exists
loop-guard
Tekkiiiii/the-agency
Stall detector per agent loop: 5 identical tool calls in a row warn that loop and leave the session-state.json stall marker for the next SessionStart
spawn-ledger
Tekkiiiii/the-agency
Spawn log (spawn_start/launched/end + cost, native agentId lineage), artifact check and in-session RESPAWN_REQUEST pickup for every subagent, background included
voice-compact
Tekkiiiii/the-agency
Startup token diet: rewrites the long CAVEMAN / PONYTAIL MODE ACTIVE hook-context injections into ~150-token compact rules (level kept, pointer to /caveman or /ponytail)