token-efficiency
Skill2 starsChanged 24 days agoMITView on GitHub
Reducing LLM token consumption in AI-assisted development sessions — RTK setup (CLI output compression via hook), session management (/clear, /compact, /rewind, named resumes), model tiering, and complementary habits. Use when setting up a new machine or project for agent work, when sessions are hitting context limits or rate limits too fast, when API costs are a concern, or whenever the user mentions tokens, context window, RTK, session cost, checkpoints, or resuming a session.
- Pipes a download into a shell
12 other projects use a version of this.
Adopted by
Most recently taken up by
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- harshnag/agent-engineering-practicestheir own version, first seen Nov 1, 2026
- viasrijan/crazy-skillstheir own version, first seen Oct 20, 2026
- SmokerGreenOG/ToolCasetheir own version, first seen Oct 15, 2026
- romangalaxys10-spec/fabletheir own version, first seen Oct 13, 2026
- rohitg00/pro-workflowtheir own version, first seen Sep 29, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- rohitg00/pro-workflow★ 2.9ksame name
- HHU3637kr/skills★ 146same name
- REPOZY/superpowers-optimized★ 146same name
- prangishviliAbe/agent-skills★ 8same name
- romangalaxys10-spec/fable★ 4same name
- saitarrun/Devforge-ai★ 4same name
- SmokerGreenOG/ToolCase★ 2same name
- denfry/claude-skills★ 1same name
- Biznomad/claude-skills★ 0same name
- harshnag/agent-engineering-practices★ 0same name
2 more not listed
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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-newsSkill
- break-uiSkill
- ci-cd-and-automationSkill
- clickup-task-breakdownSkill
- client-facing-docsSkill
- codebase-designSkill
- design-auditSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- express-prisma-patternSkill
- frontend-designSkill
- game-assetsSkill
- game-design-docSkill
- grillingSkill
- improve-codebase-architectureSkill
- motion-dictionarySkill
- playwright-cliSkill
- prisma-schema-conventionsSkill
- rag-architectSkill
- rbac-designSkill
- redesign-existing-projectsSkill
- screenshot-to-codeSkill
- secrets-gitleaksSkill
- security-auditSkill
- sentry-setup-ai-monitoringSkill
- tddSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
1
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
- Very specific: line 30
Big wins: test runners showing failures only (pytest, vitest, cargo test — 90%+), git diff/log/status, package manager install noise, …
- Distinctive: line 33
Failure safety: when a command fails, RTK saves the full unfiltered output to disk so nothing important is lost.
“Common” is measured: kept by at least 6 in 10 of the 12 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
Token efficiency
Tokens are the working memory of the session. Every verbose command output gets re-read on every subsequent turn, so waste compounds: a 2,000-token git diff costs ~20,000 tokens over the next 10 turns. Two fronts: tooling (RTK) and habits.
RTK (Rust Token Killer)
rtk-ai/rtk is an open-source CLI proxy (single Rust binary, Apache 2.0) that compresses command output before it reaches the context window — 60–90% savings on test runners, git operations and package managers. It runs locally and hooks into the agent's official extension points (Claude Code PreToolUse hook); it does not touch API traffic.
Setup (once per machine)
# Install (official script; on Windows, native binary works since v0.37.2)
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
# Activate for your harness — hook-only avoids extra per-turn context
rtk init -g --hook-only # Claude Code
rtk init -g --gemini # Gemini CLI
rtk init -g --agent cursor # CursorRestart the agent afterwards. The hook rewrites Bash calls transparently (git status → rtk git status); the agent doesn't need to know RTK exists. Prefer --hook-only: the alternative injects an RTK.md into context on every turn, which spends tokens to save tokens.
What it actually covers (calibrate expectations)
- Big wins: test runners showing failures only (
pytest,vitest,cargo test— 90%+),git diff/log/status, package manager install noise,tsc/lint output grouped by file. - Not covered: the agent's native Read/Grep/Glob tools bypass the Bash hook. In read/edit-heavy sessions RTK has little to intercept — that's expected, not broken.
- Verify it's working:
rtk gainshows accumulated savings;rtk discoverfinds commands you ran that could have been compressed. - Failure safety: when a command fails, RTK saves the full unfiltered output to disk so nothing important is lost.
Habits that save more than any tool
- Ask for scoped output:
git log -n 5beatsgit log; run the failing test file, not the whole suite. - Don't paste what the agent can read: reference file paths instead of pasting file contents into the prompt.
- One domain per session: long mixed sessions accumulate stale context; a fresh session with a good CLAUDE.md/AGENTS.md beats a bloated one.
- Keep context files lean: the project's AGENTS.md is re-read constantly — it pays rent on every turn. If a section isn't changing behavior, cut it.
Session management
/clearbetween unrelated tasks. A session accumulates every file read and every dead end along the way;/clearstarts the next task without dragging that weight. Prefer it over continuing one thread across unrelated work./compactfor a long session you still need. Summarizes history to free up context without losing the thread — use when one task genuinely has to keep going past the point where tool output dominates the window./rewindto back out of a wrong turn. Rolls the conversation and/or code back to a checkpoint — cheaper than manually undoing several turns of accumulated edits./rename <name>+claude --resume <name>to give a long-running task a memorable session instead of hunting through theclaude --resumepicker./contextshows what is actually filling the window — check it before assuming a slowdown is the model's fault rather than a bloated AGENTS.md or an unnecessarily wide file read.- Session transcripts live in
~/.claude/projects/<path>/and are pruned after 30 days by default (cleanupPeriodDaysinsettings.json). Don't treat them as permanent history — the delivery log indocs/log/is the permanent record (git-workflow).
Model tiering by leverage
- Strong model plans, mid-tier model executes. Spend the highest-capability model on exploring the codebase and producing the plan; a faster/cheaper model carries out an already-approved, well-specified plan just as well, for a fraction of the tokens.
- Never the inverse. A weak model producing the plan compounds mistakes silently through every step that follows; a weak model executing a plan a strong model already approved just executes — review the diff either way.
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.

