context_mastery
Installation
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.