Managing token consumption in Gemini CLI is important for both cost and performance.
| Task | Model | Reason |
|---|---|---|
| Most coding tasks | gemini-2.0-flash |
Fast, cost-effective |
| Complex architecture | gemini-2.5-pro |
Deep reasoning |
| Simple queries | gemini-2.0-flash-lite |
Minimal cost |
Set your default model in ~/.gemini/settings.json:
{
"model": "gemini-2.0-flash"
}Or per-session via environment variable:
export GEMINI_MODEL=gemini-2.5-proEach active MCP server consumes context tokens. Best practices:
- Enable fewer than 10 MCP servers per project
- Disable unused servers in project settings
- Use project-specific MCP configurations in
mcp-configs/
- Start fresh sessions for unrelated tasks
- Use
/egc-checkpointto save state before context-intensive operations - Use
/egc-sessionsto review and resume past sessions
Skills are loaded on-demand when referenced. To optimize:
- Be specific: Reference only the skills you need
- Use core skills:
coding-standards,backend-patterns,tdd-workflowcover most cases - Defer niche skills: Load language-specific skills only when working in that language
Control which hooks run to reduce overhead:
# Minimal hooks (fastest)
export ECC_HOOK_PROFILE=minimal
# Standard hooks (recommended)
export ECC_HOOK_PROFILE=standard
# Disable specific hooks
export ECC_DISABLED_HOOKS="hook-id-1,hook-id-2"| Situation | Action |
|---|---|
| Large codebase review | Use targeted agents (@go-reviewer not full review) |
| Repeated build fixes | Use language-specific resolver (/egc-go-build vs generic) |
| Documentation updates | Use /egc-update-docs instead of manual prompting |
| Architecture decisions | Use @architect with clear scope boundaries |
The /egc-learn command extracts patterns from your sessions into reusable skills, reducing the need to re-explain context in future sessions:
/egc-learn # Extract patterns from current session
/egc-evolve # Cluster instincts into efficient skills