Skip to content

Project Context

Polytoken reads an AGENTS.md file from your project root and adds its contents to what the model sees every turn. This is where standing instructions about the project live: how to build it, which conventions to follow, what to avoid. You write it once, and Polytoken loads it for every session in that project.

AGENTS.md is the cross-agent convention other coding tools already use, and Polytoken reads the same file. An existing one works as written, with no Polytoken-specific syntax. If a project has no AGENTS.md, Polytoken falls back to CLAUDE.md, then GEMINI.md, and uses the first one it finds.

Polytoken reads AGENTS.md from $XDG_CONFIG_HOME/polytoken/ (default: ~/.config/polytoken/) first, then from the project root. To include another file, reference it with @path/to/file.md, and Polytoken adds that file’s contents too.

Polytoken also discovers AGENTS.md files in directories above the project root at startup and on /reload. This is useful in monorepos or nested workspaces where a parent directory holds shared context.

Polytoken uses a plain AGENTS.md as written. It can also render the file as a template before the model sees it, so the instructions can adapt to the active model or the current setup. To turn this on, add a frontmatter block with polytoken: true:

---
polytoken: true
---
Build the project with `just build` and run the tests with `just test`.
{% if is_model_variant("claude") %}
Prefer small, focused commits.
{% endif %}

Without polytoken: true, Polytoken uses the file verbatim, braces and all. With it, the body is a template: the example above adds a line only when a Claude-family model is active. A template can read the same variables and functions facets use, which Templating describes.