Token Optimizer Skill
Maintain context hygiene and minimize token consumption for faster, cheaper, and more accurate interactions.
Core Principles
- Surgical Reads: Never read a whole file if you only need a specific section. Use
start_lineandend_lineinread_file. - Surgical Context: Use the
@symbol to reference specific files or folders. Avoid loading the entire workspace. - Patch-First: Favor
replace(patches) overwrite_file(full overwrites) for large files to reduce input/output tokens. - Caveman Style: For mechanical or high-frequency tasks, adopt a terse, article-free style.
- Context Hygiene:
- If a task is complete, start a fresh session with
gemini resetor/clear. - Use
/rewind(orEsctwice) to remove failed attempts or redundant context from history.
- If a task is complete, start a fresh session with
Workflow
- Audit: Periodically check token usage with
/stats. - Prune: Identify redundant history and suggest
/rewind. - Optimize: Use the most specific tool possible (e.g.,
grep_searchinstead of reading multiple files to find a string).
Rationalization Table
| Excuse | Reality |
|---|---|
| "Reading the whole file is easier" | Wasteful context makes the model slower and more prone to "hallucinations" or forgetting. |
| "Verbose explanations are clearer" | Smart agents understand fragments. Save tokens for the code. |
| "I'll just keep this session going" | "Context drift" occurs in long sessions. Fresh sessions = fresh thinking. |
Red Flags
- Outputting full files when only a few lines changed.
- Reading non-relevant files just because they are in the same directory.
- Not using
/rewindafter a major tool failure or correction.