# Gemini Context Master

> Advanced context optimization and token-saving strategies. Use when dealing with large codebases, long sessions, or when token usage needs to be minimized without losing project state.

- Skill: `boonyaritpornuan/gemini-context-master` (Agent Skill)
- Install (CLI): `npx skillmds@latest add boonyaritpornuan/gemini-context-master`
- Raw SKILL.md: https://api.skillmd.com/api/skills/boonyaritpornuan/gemini-context-master/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: boonyaritpornuan (https://skillmd.com/u/boonyaritpornuan)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/boonyaritpornuan/gemini-context-master

---


# Gemini Context Master

This skill implements senior-level context engineering to maximize token efficiency and maintain long-term project memory.

## 1. Strategic Compaction
Do not wait for auto-compaction. Manually trigger or suggest compaction at logical task boundaries to prune old exploration data while keeping the "Final Plan" and "Current Progress".

**When to Compact:**
- After a long research phase and before starting execution.
- After successfully completing a major milestone.
- When the context feels "sluggish" or token count is high (>50k).

**Compaction Workflow:**
1. Summarize the **Current State** (what has been done).
2. Carry over the **Pending Tasks** (what is next).
3. Carry over any **Crucial Findings** (API keys locations, architectural decisions).
4. Run `/compact`.

## 2. Surgical Context Pruning
Avoid reading entire large files. Use targeted tools to keep the context clean.

- **Prefer `grep_search`**: Find specific lines instead of reading 1000+ lines.
- **Use `read_file` with line ranges**: Only read the relevant function or class.
- **Prune Output**: If a command produces massive output, only carry over the error or the relevant success message.

## 3. Persistent Project Memory (GEMINI.md)
Every project should have a `GEMINI.md` file in the root. This acts as a "Source of Truth" that saves tokens by preventing repetitive questions.

**GEMINI.md Structure:**
- **Tech Stack**: Languages, frameworks, versions.
- **Conventions**: Naming styles, directory structure.
- **Manual Overrides**: Specific instructions for this project only.

## 4. Token-Saving Guidelines
- **No Chitchat**: Keep responses technical and direct.
- **Aggregated Tool Calls**: Run independent tasks in parallel within one turn.
- **Contextual Precedence**: Always check `GEMINI.md` before asking for project details.

