---
title: Files in your repository's .stamp/
description: The files Stamp reads from a repository's .stamp/ directory, .stamp/AGENTS_GUIDE.md, .stamp/CODEOWNERS, .stamp/routing.yml and .stamp/prompts/after-merge.md, who reads each one, from which branch, and when a change takes effect.
llms_section: "Daily use"
llms_order: 44
llms_summary: "Read to know what a repository can put in .stamp/: AGENTS_GUIDE.md (agent guidance), CODEOWNERS (required owners), prompts/after-merge.md (what agents do after a merge), and when changes apply."
llms_full: true
---

# Files in your repository's `.stamp/`

A repository can hold these files in a `.stamp/` directory at its root. Stamp reads no other file there.

| File | What it does | Read from | Read by |
| --- | --- | --- | --- |
| `.stamp/AGENTS_GUIDE.md` | Guidance for agents: text Stamp shows them when they work in the repository | The default branch | Agents (Stamp shows it to them) |
| `.stamp/CODEOWNERS` | The agents and people of your server who must approve changes to some paths | The pull request's base branch | Stamp (it enforces the rules) |
| `.stamp/routing.yml` | Which agent is asked to review a pull request Stamp did not open (dependabot, people on GitHub) | The pull request's base branch | Stamp (it asks the agent) |
| `.stamp/prompts/after-merge.md` | What agents are told to do after one of the repository's pull requests merges | The default branch | Agents (in the merge notice, the auto-merge's merged notice and `stamp pr merge`) |

Every file is optional. A repository without them works as usual.

::: tip Not the CLI's `~/.stamp/`
The `stamp` CLI keeps its own state (the login, the agent's SSH key, the pinned `known_hosts`) in `~/.stamp/` in your home directory. That directory has nothing to do with a repository's `.stamp/`.
:::

## `.stamp/AGENTS_GUIDE.md`

What you want every agent to know before it works in the repository, for example which branch to target or which checks to run before a pull request.

- **Who sees it:** agents. Stamp prints it after an accepted branch push and after `stamp pr create`, and `stamp repo guide OWNER/REPO` prints it on request. Nothing waits on it and nothing is refused because of it.
- **Which branch:** the default branch only. Editing it on a branch or in a pull request changes nothing until that change is merged.
- **When a change shows:** once it is merged into the default branch, and Stamp's copy in memory is older than 5 minutes. The first read after that can still show the old text while Stamp fetches the new file.
- **Limits:** shown as plain text, not rendered Markdown; only the first 4,000 characters are shown.

Details: [Guidance for agents](/agents-guide/).

## `.stamp/CODEOWNERS`

Names the agents and people of your Stamp server who must approve changes to a path, in GitHub's `CODEOWNERS` syntax. Stamp asks them for a review, and its merges (`stamp pr merge`, auto-merge, the merge queue) wait until one of them approves the exact head. To hold merges on GitHub too, make the `stamp/codeowners` status required.

- **Who reads it:** Stamp, which enforces it and posts the `stamp/codeowners` status. Agents and people see the matched rules on the pull request page and in `stamp pr view`.
- **Which branch:** the base branch of each pull request, never its head. A pull request that edits the file does not change what it itself needs.
- **When a change applies:** once it is merged into the base branch. Stamp's merges require the rules of both the file at the pull request's recorded base commit and the base branch's current file, so a rule added there holds open pull requests too, and a rule removed there can still hold a pull request opened before. The posted `stamp/codeowners` status of an open pull request moves on that pull request's next event.
- **Limits:** up to 64 KiB and 500 rules.

Details: [Code owners](/code-owners/).

## `.stamp/routing.yml`

Routes pull requests Stamp did not open (a dependabot update, a pull request a person opens on GitHub) to an agent of your server, by author, label or changed paths. Stamp asks that agent for a review through Stamp's review requests, once, and reminds it once after 3 days of no activity.

- **Who reads it:** Stamp, when such a pull request is opened, reopened, marked ready for review or labeled.
- **Which branch:** the base branch of each pull request, never its head.
- **Limits:** up to 64 KiB and 50 routes; read strictly (an unknown key makes the file unusable).

Details: [Route pull requests to an agent](/routing/).

## `.stamp/prompts/after-merge.md`

What an agent does once one of the repository's pull requests has merged. Without the file, Stamp tells agents to clean up what they made for the pull request: its worktree, branch and any temporary files. With it, the file's text replaces that line. Stamp presents it as the repository's words, not its own: quoted, after "The repository asks (.stamp/prompts/after-merge.md):". It does so in:

- the merge notice Stamp sends the pull request's author, followers, reviewers and approvers;
- the merge queue's notice that the request merged;
- the output of `stamp pr merge`, and of `stamp pr merge --auto` when the registration will merge it (under "After it merges, the repository asks"). The CLI prints each line of the file after `> `. The merge's answer also carries it as one line, quoted as in a notice (`cleanup`);
- the notice an auto-merge sends the agent that registered it once it merged ("Auto-merge merged OWNER/REPO PR N as SHA7."), read at the base the merge was pinned to.

Example:

```markdown
Clean up what you made for this pull request: remove its worktree
(`git worktree remove`), delete the local branch, and remove anything
you left under /tmp.
If it changed a migration, post the migration's name in the #deploys channel.
```

- **Format:** plain text. Stamp does not render Markdown or HTML; it drops control characters. A notice is one line, so its line breaks become spaces there, and its double quotes and backticks become `'` so the text cannot end Stamp's quote or read as a command; `stamp pr merge` prints the lines as written.
- **Which branch and commit:** the default branch as it was **before** the merge, so a pull request never sets what its own merge says:
  - `stamp pr merge` and `stamp pr merge --auto` read the file at the base commit the merge is pinned to (`--base`).
  - The merge notice reads it at the commit before the merge: the merge commit's first parent when GitHub made a merge commit; the parent of the single commit a squash of a one-commit pull request makes; the base Stamp pinned when Stamp merged it; and, for the merge queue, the parent of the pull request's own commit.
  - When the commit before the merge cannot be told for certain (a rebase merge of several commits, or a squash merge GitHub did not make through Stamp), the notice uses the built-in cleanup line.
  - A pull request merged into another branch leaves the default branch untouched, so its notice reads the default branch's current commit.
- **When a change shows:** from the first merge after the edit reaches the default branch. The pull request that edits the file still gets the old text.
- **Limits:** the first 2 KB of the file; a longer file is cut and ends "…(truncated)". A notice holds at most 500 characters, so a long text is cut further there and ends "…".
- **If Stamp cannot read it:** the merge and the notices go ahead with the built-in cleanup line.

The `.stamp/prompts/` directory is where Stamp will look for prompts at other moments too. Today it reads only `after-merge.md`.
