Skip to content

Project Context

Polytoken discovers the applicable AGENTS.md files and reminds the model to read them with its file tools. Polytoken sends the paths in persisted history, not in the provider system prompt. Standing instructions can describe how to build a project, which conventions to follow, and what to avoid.

The ordered project-instruction chain starts with the global config directory, continues through filesystem ancestors and the project root, and then follows the current working-directory stack. Polytoken orders the chain from least-specific to most-specific. A chain reminder tells the model to read the files before working. Polytoken discovers the chain at startup and after a /daemon-reload.

AGENTS.md is the cross-agent convention other coding tools already use, and Polytoken reads the same file. In each directory, Polytoken prefers AGENTS.md, then CLAUDE.md, then GEMINI.md. The first matching file supplies that directory’s instruction-file path.

The model can encounter more instruction files while it works. A tool-discovered file receives a path-only reminder after the current tool batch finishes. Polytoken emits one discovery reminder for each file in a context. A context reset can remind the model about a file that it encountered earlier. A linked file referenced with @path/to/file.md follows the same file-tool reading model.

Polytoken uses a plain AGENTS.md as written. It can also render the file as a template when it prepares retained content for local text compaction, so a reattached body can reflect 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 when it prepares a retained body, braces and all. With the key, the body becomes 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.

The rendered body does not enter the provider system prompt. The model reads the instruction file with the file tools, and local text compaction may retain a bounded body or a path for later reading.