get-context
Skill1 starsChanged 3 months agoMITView on GitHub
Report the current Claude Code session's context-window usage percentage, computed locally from the session JSONL usage metadata
3 other projects use a version of this.
Adopted by
Most recently taken up by
- openai/pluginstheir own version, first seen Oct 13, 2026
- ethansmadjaa/skillstheir own version, first seen Oct 9, 2026
- Jaeyong-Cho/skillstheir own version, first seen Aug 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- openai/plugins★ 7.8ksame name
- ethansmadjaa/skills★ 1same name
- Jaeyong-Cho/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- autonomy-statSkill
- check-usageSkill
- compact-unfreezeSkill
- edit-statuslineSkill
- formalization-statement-fidelity-auditSkill
- github-math-checkSkill
- heart-beatSkill
- manim-ttsSkill
- mermaidSkill
- my-github-md-ruleSkill
- nostrSkill
- sessiondbSkill
- use-bmsSkill
- use-fandomSkill
- webapp-defaultsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before a long task, to decide whether compaction is near.
- Distinctive: line 19
Run the bundled script and report its stdout:
- Very specific: line 37
Read the last usage field — the token metadata auto-attached to each assistant message.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
get-context
Print how much of the context window the current session is using, as a percentage.
When to invoke
- User asks how full the context is ("今どれくらいコンテキスト使ってる?", "context 残量", "how much context is left").
- Before a long task, to decide whether compaction is near.
How to get it
Run the bundled script and report its stdout:
skills/get-context/scripts/get-contextIt prints e.g. 12.4%. For the raw token count too:
GET_CONTEXT_RAW=1 skills/get-context/scripts/get-context # -> 12.4% (123977/1000000 tokens)How it works
- Locate the current session JSONL strictly via
$CLAUDE_CODE_SESSION_ID(~/.claude/projects/**/<session-id>.jsonl). If the variable is unset, exit with an error instead of guessing — picking the wrong session would be worse than failing. - Read the last
usagefield — the token metadata auto-attached to each assistant message. The latest entry reflects the whole conversation because the prior context is re-read from cache every turn. context_tokens = input + cache_creation + cache_read + output, thenpct = context_tokens / CONTEXT_WINDOW * 100.
Env overrides
CONTEXT_WINDOW— context window size in tokens (default1000000).GET_CONTEXT_RAW— set to1to also print the raw token count.
Note
This is a local estimate from the session log, not the value Claude itself
sees. It matches the /context figure closely (e.g. 11.9% computed vs 12%
shown). The exact context_window.used_percentage is only available to the
status line via Claude Code's stdin payload, not to a standalone script.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

