context-engineering
Skill16 starsChanged 4 days agoMITView on GitHub
Optimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets injected into a task. SKIP: persisting knowledge across sessions (use agent-memory); semantic recall tuning (use semantic-memory-mcp).
131 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- gerivdb/SKILLStheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- gopalparashar421/agent-skillstheir own version, first seen Nov 8, 2026
- Rvey/agent-engineering-kittheir own version, first seen Nov 2, 2026
Used with
Projects with it also use using-agent-skills, idea-refine and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 36 projects that use this
LLl0k0laDSkillidea-refine
Refine ideas through structured divergent and convergent thinking. Use "idea-refine" or "ideate" to trigger.
Also in 44 projects that use this
HK-hubSkilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 40 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 14 projects that use this
HK-hubSkillsource-driven-development
Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
Also in 44 projects that use this
- +6 more from LLl0k0laD
- +1 more from HK-hub
Other versions131 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 131
- addyosmani/agent-skills★ 114ksame name
- bojieli/ai-agent-book-projects★ 53ksame name
- bojieli/ai-agent-book★ 53ksame name
- rohitg00/pro-workflow★ 2.9ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- kdlbs/kandev★ 1.1ksame name
- liza-mas/liza★ 418same name
- typv/nest-turbo-starter★ 224same name
- VAMFI/claude-user-memory★ 206same name
- shashankswe2020-ux/whoop-mcp★ 174same name
121 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 repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-commsSkill
- agent-memorySkill
- api-designSkill
- database-optimizationSkill
- distillSkill
- docker-templatesSkill
- error-handlingSkill
- frontend-designSkill
- github-actions-templateSkill
- git-operationsSkill
- logging-standardsSkill
- mcp-toolsSkill
- monitoring-observabilitySkill
- mui-stylingSkill
- necessity-firstSkill
- pattern-recognitionSkill
- planning-methodologySkill
- python-patternsSkill
- quality-validationSkill
- react-patternsSkill
- research-methodologySkill
- reverse-engineer-anythingSkill
- security-review-checklistsSkill
- semantic-memory-mcpSkill
- skill-authoringSkill
- sofa-searchSkill
- spec-designSkill
- spec-developSkill
- spec-researchSkill
- spec-reviewSkill
- spec-workflowSkill
- state-managementSkill
- systematic-debuggingSkill
- testing-strategySkill
- ui-ux-pro-maxSkill
- verification-before-completionSkill
- watch-patternsSkill
- worktree-managementSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 117 edited versions we read keep these.
6
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 14
Every 50 messages in conversation
- Distinctive: line 16
When context feels stale
- Distinctive: line 23
Keep only relevant information
- Distinctive: line 24
Remove completed task details
- Distinctive: line 139
Use tables instead of prose
- Distinctive: line 141
Remove examples from main docs
“Common” is measured: kept by at least 6 in 10 of the 117 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
Context Engineering Skill
Optimizes Claude Code context for better performance and accuracy.
Tracked files in repo: !git ls-files 2>/dev/null | wc -l || true
Auto-Invoke Triggers
- Every 50 messages in conversation
- After major refactoring
- When context feels stale
- Task switching
- User requests
/contextcommand
Context Principles
Active Curation
- Keep only relevant information
- Remove completed task details
- Archive outdated patterns
- Focus on current work
Signal-to-Noise Ratio
| High Signal | Low Signal |
| Current APIs | Old experiments |
| Active patterns | Completed tasks |
| Recent decisions | Historical context |
| Project structure | Implementation details |
Token Budget
| File | Limit | Purpose |
| CLAUDE.md | < 2000 tokens | Quick reference |
| Agent docs | < 500 per agent | Role definition |
| Skills | < 300 per skill | Methodology |
Context Analysis Process
Step 1: Measure Current State
## Context Analysis
### Token Counts
- CLAUDE.md: XXX tokens
- Agent docs: XXX tokens total
- Skills: XXX tokens total
- Total: XXXX tokens
### Staleness Check
- [ ] Last updated: [date]
- [ ] References current project state
- [ ] No deprecated APIs/patternsStep 2: Identify Issues
### Issues Found
#### Stale Content
- Section X: Outdated [reason]
- Section Y: No longer relevant
#### Redundant Content
- Duplicated in files A and B
- Can consolidate X and Y
#### Missing Content
- Current API not documented
- New pattern not capturedStep 3: Optimization Actions
### Optimization Plan
1. **Archive**: Move section X to knowledge-core.md
2. **Remove**: Delete duplicate Y
3. **Update**: Refresh API documentation
4. **Add**: Document new pattern ZCLAUDE.md Structure
Optimal structure for quick reference:
# Project Name
[One-line description]
## Quick Reference
| Action | Command |
|--------|---------|
| Run | command |
| Test | command |
| Build | command |
## Agent System
[Link to detailed docs]
## Tech Stack
- Frontend: [stack]
- Backend: [stack]
## Project Structure
[Key directories only]
## Key Rules
1. [Critical rule]
2. [Critical rule]Always-loaded vs lazy path-scoped rules
CLAUDE.md content splits into two tiers by when it must be available:
| Tier | Lives in | Loads | Examples |
| Always-loaded | project-root CLAUDE.md | every message, before any file is touched | routing Protocol + Decision Tree + Agents table |
| Lazy / path-scoped | nested CLAUDE.md in a subdir | only while editing under that directory tree | per-area code conventions, stack notes, types location |
Hard rule: the routing sections NEVER move into a nested CLAUDE.md — routing
must fire on the first message, but a nested file only loads on Edit/Write under
its tree (too late to route). Only path-specific code conventions are
candidates to relocate, and only via the opt-in /init-rules scaffolder. This
trims always-loaded tokens (modest for the plugin CLAUDE.md, larger for heavy
project repos) without weakening routing. /doctor asserts the routing section
is still present in the root CLAUDE.md.
Optimization Strategies
Token Reduction
- Use tables instead of prose
- Link to details instead of inline
- Remove examples from main docs
- Keep explanations brief
Information Hierarchy
- Immediate: In CLAUDE.md
- Reference: In linked docs
- Archive: In knowledge-core.md
- Delete: Truly obsolete
Import Chain Management
- Max 5 levels of imports
- No circular references
- Clear dependency direction
Context Health Metrics
| Metric | Healthy | Warning | Critical |
| CLAUDE.md tokens | < 1500 | 1500-2500 | > 2500 |
| Stale sections | 0 | 1-2 | 3+ |
| Redundancy | 0% | < 10% | > 10% |
| Missing critical | 0 | 1 | 2+ |
Maintenance Schedule
| Trigger | Action |
| Every 50 messages | Quick analysis |
| After major change | Update relevant sections |
| Weekly | Full review |
| Task switch | Clear task-specific context |
Output: Context Report
## Context Report
**Date**: [date]
**Health**: Healthy | Warning | Critical
### Metrics
- Total tokens: XXXX
- Stale sections: X
- Redundancy: X%
### Findings
1. [Finding]
2. [Finding]
### Recommendations
1. [Action to take]
2. [Action to take]
### Potential Savings
- Current: XXXX tokens
- After optimization: XXXX tokens
- Savings: XX%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.

