A context file is a short set of instructions your agent loads at the start of every session. It replaces the paragraph you'd otherwise retype each time.
Where it lives
| Tool | File |
|---|---|
| Claude Code | CLAUDE.md (root, plus optional per-folder files) |
| Cursor | .cursor/rules/ |
| GitHub Copilot | .github/copilot-instructions.md |
| Many others | AGENTS.md |
What belongs in it
- Stack: one or two lines.
- Commands: dev, build, test, lint, exactly as typed.
- Conventions that differ from the defaults.
- Red lines: five or fewer things that need your explicit OK.
- Memory: a pointer to your decisions log.
What doesn't
- Explanations of how the code works. The agent can read the code.
- Generic advice like "write clean code".
- Anything that changes weekly. Put that in the task prompt.
The test
For every line, ask: would the agent behave differently without it? If not, delete it. Most good context files are under 60 lines.
Set one up step by step in the agent-ready repo tutorial.