> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Guide agents with AGENTS.md repository instructions

> Add an AGENTS.md file to your repository so Cake agents follow your project's conventions, build commands, and lint and test steps in every session.

Repository instructions are files in your repository that tell coding agents how to work in your project. Before a Cake agent works in a repository, it looks for these files, reads them, and follows them.

Add repository instructions when you want every session to use the same conventions and commands. You don't have to repeat them in each prompt.

## Supported files

The agent looks for any of these files:

* `AGENTS.md` at the repository root
* `AGENTS.md` in the subdirectories the agent works in
* `CLAUDE.md`
* `GEMINI.md`
* `.github/copilot-instructions.md`

If your repository already has instructions for another coding tool, Cake agents use them too.

## How agents use instructions

* The agent reads the instructions for every repository it works in. This includes repositories it clones or checks out during the session.
* The guidelines, conventions, and commands in your instructions take precedence over the agent's default guidance.
* When the agent can't find a lint or typecheck command, it asks you for one. It may then suggest adding that command to `AGENTS.md` so future sessions run it automatically.

## Write an AGENTS.md file

1. Create `AGENTS.md` at the root of your repository.
2. Add the conventions and commands you want agents to follow.
3. Commit the file to the branch your sessions use.

```markdown AGENTS.md theme={null}
# Agent instructions

## Commands

- Install dependencies: `pnpm install`
- Lint: `pnpm lint`
- Typecheck: `pnpm typecheck`
- Test: `pnpm test`

## Conventions

- Use TypeScript for all new code.
- Run lint, typecheck, and tests before you commit.
- Don't edit generated files in `dist/`.
```

To give instructions that apply to one part of a monorepo, add another `AGENTS.md` in that subdirectory.

## Related pages

* [Set default repositories for new sessions](/user/default-repositories)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.