jhs/cccp/token-aware
Claude Code and agent skill by jhs/cccp
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks about context window fullness, tokens remaining, nearness to compaction, or wants token-usage monitoring with milestone notifications as work proceeds — phrases like "how full is your context", "tokens left", "watch your token usage".
Install
npx vskill@latest install jhs/cccp/token-awareSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as jhs/cccp/token-aware.
token-aware
To ascertain how much of the context window this session has consumed, use these claude-tokens helper commands:
| Command | Purpose | |
|---|---|---|
claude-tokens status | One-shot: print current usage (pct, used/size, snapshot age) | |
claude-tokens watch | Stream milestone events (50/75/90/95%) for the Monitor tool |
Both take any number of targets and answer for each in one process, so watching a whole cell costs one command, not one per comrade — see Reporting on other comrades.
If claude-tokens fails (not found, non-zero exit, traceback, etc.) do not troubleshoot but instead halt and inform the user. A "no snapshot yet" message is not an error; it means data is not yet available. Neither is snapshot age unknown: the reading is good, but the snapshot predates self-dating and its age cannot be established (see Telemetry snapshots). Report the usage and say the age is unknown rather than substituting a guess.
One-Time Setup
!"${CLAUDE_PLUGIN_ROOT}/bin/cccp" skill data-setup --plugin-root='${CLAUDE_PLUGIN_ROOT}' --plugin-data='${CLAUDE_PLUGIN_DATA}'
Query usage now (synchronous)
Run as a normal Bash call:
Prints one line, e.g. 38% (76k/200k) | snapshot 4s old. The snapshot reflects the last prompt/response Claude turn, so it lags the current turn slightly.
Watch milestones during long work (Monitor)
Run under the Monitor tool to get timely notifications as usage climbs:
Its first line is the current reading, similar to status. Example:
Subsequent lines fire only when usage crosses a milestone. These lines include the latest reading, plus: elapsed time since the previous event, interval-average velocity, and an ETA to every remaining milestone. Example:
Milestones default to 50/75/90/95%. Override them with one or more --threshold (repeatable), each written as PCT[% REMINDER]:
Reminders
A milestone can carry a reminder: your own note to your future self, played back verbatim when that milestone is crossed. Everything after the percentage is the reminder, so there is no separator to escape:
It arrives at the end of the crossing line, behind a shouted label:
Write reminders as instructions rather than labels — prepare to terminate, not nearly full — because that one line is all you get, possibly hours later and possibly after a compaction has taken the surrounding plan out of your context. Set them when you start the watch, while you still know what each milestone was for.
Two inputs are refused rather than absorbed, both because the alternative is losing an instruction quietly: the same percentage given twice (deduplicating would drop one of the reminders, and you would not discover it until the crossing it was meant to speak at), and a --threshold that does not begin with a number. Both fail immediately — correct the command and rerun it.
A milestone below the reading the watch starts at can never fire. The start line hands those back to you — each one written as you wrote it, reminder and all, so you can see what is not coming rather than merely being told how many:
Reissue anything there that still matters, at a percentage you have not reached yet.
Reporting on other comrades
Both commands default to this session. Name targets to report on others — session ids, or the comrade ids you already hold:
| Target | Resolves to | |
|---|---|---|
<session-id> | that session exactly, whichever harness wrote it | |
user@host:cc-<6hex> | the Claude Code session whose id begins with that hex | |
user@host:pi-<6hex> | the Pi session whose id ends with that hex | |
cc-<6hex> / pi-<6hex> | the same — the user@host part is ignored either way |
Pass comrade ids straight through; do not translate them to session ids in a shell pipeline first. The two harnesses anchor at opposite ends and getting it backwards silently reports on nothing.
Targets are labelled once there is more than one; a single target prints the usage line alone, exactly as status does for this session. Two answers are not readings and say so: no snapshot (nothing on disk for that target) and ambiguous: N match (...) — 6 hex can collide, so name the session id you meant.
Add --json when a program rather than a person consumes the output: status --json prints one array of results, watch --json one JSON object per event.
Resolving who a comrade is
status --json also answers identity, because it has already opened the snapshot: alongside the usage fields each result carries comrade_id, session_id, session_name, producer, transcript_path, cwd and snapshot_path. Use it whenever you have an id and need the session behind it — where that comrade's transcript is, which working tree they are in — instead of globbing the snapshot directory yourself.
It works in reverse too: give it a bare session id and comrade_id comes back derived (cc-4f2a1b), which is how you find out who a transcript or a log line belongs to. That derived id has no user@host head — a snapshot records neither, because snapshots are portable between machines and a host stored in one stops being true the moment it is copied. An unfamiliar harness yields comrade_id: null rather than an id guessed at the wrong anchor.
Identity is reported even when usage is not: a fresh or just-compacted session answers "error": "no reading" and still tells you who it is and where it lives.
Wind-down
watch runs until stopped. End it with TaskStop on its task id when the long work is done or the user no longer needs milestone updates.
Your instructions
The user's invocation arguments are below. Treat them as their prompt: a question, an instruction, etc. If there's nothing, default to a one-shot status report.
User arguments: $ARGUMENTS
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/token-aware/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jhs/cccp/token-aware)