context_mastery
SKILL.md
Context Mastery & Token Optimization Protocol
1. The "Grep-First" Rule (Token Saver)
- Problem:
read_fileon a 2000-line file consumes ~500-1000 tokens instantly. - Solution: Always use
greporread_file_rangefirst to inspect specific functions or imports. - Banned:
catorread_fileon entire directories or massive files (e.g.,package-lock.json, giant logs) unless absolutely necessary.
2. Incremental Summarization
- Trigger: When the conversation exceeds ~20 turns or you feel the context window filling.
- Action:
- Summarize what has been achieved in the last 10 turns.
- Write it to
scratchpad.mdoractive_task.md. - Explicitly state "I am clearing internal context of validated steps" (if tool allows) or just rely on the scratchpad for future lookup.
3. Focused Context Loading
- Don't: "Read all files in
src/to understand the project." (Too expensive). - Do:
- Read
CLAUDE.md/README.md. - Read directory listing
ls -R. - Selectively read only the interfaces (
types.ts) or entry points (index.ts) related to the current task.
- Read
4. Context Efficiency Checklist
- Did I use
grepinstead of reading the whole file? - Did I check if I already have this info in
MEMORY.md? - Is my next prompt efficient? (Avoid repeating massive code blocks back to the user).
Weekly Installs
2
Repository
cityfish91159/maihousesFirst Seen
1 day ago
Installed on
opencode2
codex2
claude-code2
antigravity2
gemini-cli2
windsurf1