context-guard
Skill1 starsChanged 7 months agoApache-2.0View on GitHub
Context window protection. Auto-activates when the conversation is getting long, when the user is about to do a large file read or exploration task, or when the context is approaching its limit. Helps route expensive operations to sub-agents to protect the main session.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- Cand1ePower/codex-context-guard-skilltheir own version, first seen Nov 8, 2026
- CorvusWing/CorvusWingtheir own version, first seen Oct 25, 2026
- freema/ai-skillstheir own version, first seen Oct 13, 2026
- iAstroUnicorn/astro-skillstheir own version, first seen Jul 29, 2026
- littlebearapps/contextdocstheir own version, first seen May 6, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- freema/ai-skills★ 5same name
- littlebearapps/contextdocs★ 5same name
- Cand1ePower/codex-context-guard-skill★ 1same name
- CorvusWing/CorvusWing★ 1same name
- iAstroUnicorn/astro-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 repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- analyze-repoSkill
- augmentSkill
- code-reviewSkill
- dep-checkSkill
- doctorSkill
- forgeSkill
- git-workflowSkill
- learnSkill
- onboardingSkill
- security-scanSkill
- self-updateSkill
- test-runnerSkill
- tipsSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before the expensive operation happens, estimate the token cost:
- Distinctive: line 26
If the operation is HIGH risk, do NOT execute it in the main context.
- Distinctive: line 34
If a sub-agent result is returned to you, summarize it before adding it to the main conversation:
- Distinctive: line 37
Always structured (JSON or bullet list), never raw file dumps
- Distinctive: line 40
If the current context is approaching the limit:
“Common” is measured: kept by at least 6 in 10 of the 4 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
Purpose
Protect the user's context window from expensive operations that should run in a sub-agent instead. This skill activates automatically when it detects patterns that commonly cause context blowout.
When I Activate
- User asks to "read", "scan", "explore", or "analyze" a large codebase
- User asks to run tests and see all output
- Context window is getting long and a compaction is likely soon
- User is about to do something that will dump large amounts of text into the main context
What I Do
1. Assess the Risk
Before the expensive operation happens, estimate the token cost:
- Reading a large file: HIGH risk
- Exploring a directory: MEDIUM-HIGH risk
- Running tests with verbose output: HIGH risk
- A targeted grep: LOW risk
2. Route to Sub-agent If High Risk
If the operation is HIGH risk, do NOT execute it in the main context. Instead:
I'm routing this to the [explorer/test-runner] sub-agent to keep our main context clean.
Use: "[agent-name] — [what you need]"3. Compress Before Returning
If a sub-agent result is returned to you, summarize it before adding it to the main conversation:
- Max 20 lines for any exploration result
- Max 10 lines for a test run summary
- Always structured (JSON or bullet list), never raw file dumps
4. Warn When Context Is Large
If the current context is approaching the limit:
⚠️ Context Warning: Our session is getting long. I recommend:
1. Using /compact to compress history
2. Starting a new session for the next distinct task
3. Current state will be saved to SESSION_STATE.md firstWhat I Do NOT Do
- Block the user from doing anything
- Make the decision unilaterally — always explain and ask if the rerouting is okay
- Obsessively activate on every message (only on genuinely expensive operations)
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.

