context-optimizer
Skill1 starsChanged 49 days agoMITView on GitHub
Reduce context window and token usage for AI coding agents. Use when working with large repositories, large files, context overflow risks, or when the user asks to optimize tokens, compress prompts, or reduce context. Prefer targeted search (rg/grep) over full-file reads; ignore node_modules, .git, build artifacts, lockfiles and binaries.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- delorenj/skillstheir own version, first seen Nov 7, 2026
- tygwan/cc-initializer-windowstheir own version, first seen Oct 20, 2026
- wamalalawrence/agent-skillstheir own version, first seen Oct 13, 2026
- rohitg00/pro-workflowtheir own version, first seen Sep 29, 2026
- NISTALTALSON/Ghosttheir own version, first seen Apr 5, 2026
- tygwan/cc-initializertheir own version, first seen Jan 24, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- rohitg00/pro-workflow★ 2.9ksame name
- delorenj/skills★ 17same name
- NISTALTALSON/Ghost★ 3same name
- tygwan/cc-initializer★ 0same name
- tygwan/cc-initializer-windows★ 0same name
- wamalalawrence/agent-skills★ 0same 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 repository3 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Do not read an entire large file when only a fragment is needed.
- Very specific: line 16
Prefer targeted search first: rg, grep, find, git grep.
- Distinctive: line 18
Never load without need:
- Distinctive: line 23
Prefer compact structured output for large results.
- Distinctive: line 24
Do not repeat already-known context.
- Distinctive: line 25
Do not load the entire repository when the task is local.
- Very specific: line 27
When a reference is needed from the agentic stack, load one file from references/repositories/ after consulting the registry — never all 50.
- Distinctive: line 37
Does not replace model context limits.
- Very specific: line 53
Good: Read registry → filter category context-compression → open only 001-llmlingua.md.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Trigger Criteria
Activate when:
- User mentions: reduce context, optimize tokens, compress prompt, large file edit, context overflow, huge repository, large codebase, reduce token usage
- Working in large monorepos or files > ~500 lines
- Approaching model context limits
Core Rules
- Do not read an entire large file when only a fragment is needed.
- Prefer targeted search first:
rg,grep,find,git grep. - Locate symbol / function / class first, then read a limited line range.
- Never load without need:
node_modules/,.git/,build/,dist/, caches- lock files
- binary files
- For JSON: strip unnecessary whitespace while preserving structure and important fields.
- Prefer compact structured output for large results.
- Do not repeat already-known context.
- Do not load the entire repository when the task is local.
- Index / search first, then targeted read.
- When a reference is needed from the agentic stack, load one file from
references/repositories/after consulting the registry — never all 50.
Expected Output
- Concise findings or edits
- Explicit file:line ranges used
- Token-conscious summaries instead of full dumps
Limitations
- Does not replace model context limits; it reduces waste.
- Heuristic; agents must still respect host tool budgets.
References
references/awesome_agentic_stack.json(registry — filter, do not dump)references/INDEX.mdreferences/repositories/001-llmlingua.md(context compression)docs/AGENT_COMPATIBILITY.md
Examples
Bad: cat src/huge_module.py
Good: rg -n "def process_" src/ then read only the matching function range.
Bad: Load all 50 repository reference files.
Good: Read registry → filter category context-compression → open only 001-llmlingua.md.
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.

