Context
Everything the model knows about your project passes through one context window, and every token in it costs money and attention. This page covers what Maki puts there, when, and where you should put things so they land well.
What loads when
session start (paid every request) on demand (paid when used)
────────────────────────────────── ─────────────────────────────────
system prompt file contents read / index / grep
tool definitions skill bodies skill tool
instruction files (AGENTS.md, ...) memory notes memory tool
memory tag names subdir rules first read there
skill names + descriptions MCP tool defs tool_search
The left column is the fixed overhead of every single request, so Maki keeps it small on purpose: a skill contributes one description line, memories one list of tags, a big MCP server one search tool. The bodies stay on disk until the agent asks.
Instruction files
At session start Maki walks from the project git root down to the working directory (no .git root, only the cwd). In each directory it loads one project instruction file, first match wins:
| Order | File |
|---|---|
| 1 | AGENTS.md |
| 2 | CLAUDE.md |
| 3 | .github/copilot-instructions.md |
| 4 | COPILOT.md |
| 5 | .cursorrules |
| 6 | .windsurfrules |
| 7 | .clinerules |
| 8 | CONVENTIONS.md |
| 9 | GEMINI.md |
| 10 | CODING_AGENT.md |
After the match it always loads AGENTS.local.md from the same directory if present: that one is yours, keep it gitignored. Closer directories win on conflicts. Finally one global ~/.config/maki/AGENTS.md for preferences that follow you across projects.
~/repo/AGENTS.md loaded (root)
~/repo/AGENTS.local.md loaded (yours, gitignored)
~/repo/api/CLAUDE.md loaded when cwd is ~/repo/api, wins over root
~/repo/web/AGENTS.md not loaded yet...
~/.config/maki/AGENTS.md loaded (global)
That web/AGENTS.md is not dead weight. The first time the agent reads a file under a subdirectory whose instruction file was never loaded, Maki pulls it in. Monorepo rules live next to the code they govern and cost nothing until someone works there.
Put coding conventions, repo quirks, and off-limits directories in these files. Keep them short; the next section explains why.
Four places to put knowledge
All four end up in context, but at different times and prices:
| Loaded | Costs | Good for | |
|---|---|---|---|
AGENTS.md | every session | every request | short rules: conventions, build commands, no-go areas |
| Skills | when the agent picks one | a description line until then | long playbooks: release process, plugin authoring |
| Memory | when the agent recalls a tag | tag names until then | gotchas the agent learns while working |
| Commands | when you type /name | nothing until invoked | prompts you keep retyping |
Rule of thumb: when AGENTS.md grows past a screen, the new material probably wants to be a skill. AGENTS.md is a tax on every request; a skill is a tax only on the sessions that need it.
When the window fills
Long sessions eventually approach the model's context limit. Maki reserves a slice of the window (agent.compaction_buffer, default 20%) and before running out it summarizes the older turns and continues from the summary. /compact triggers it early, /usage shows where the tokens went, and agent.compaction_instructions steers what the summary keeps.
Related: Token Economy for why all this frugality exists, Configuration for the knobs.