Instruction files (CCD.md)
Instruction files are plain markdown files that live in your repository and tell the agent how your project works: which package manager to use, where tests live, what never to touch. They are versioned with your code, so every teammate and every session gets the same rules.
Which files are read
Layers, from lowest to highest precedence. When two layers disagree, the later layer wins.
| Layer | Files | When it loads |
|---|---|---|
| 1. Global | ~/.ccd/CCD.md, or ~/.claude/CLAUDE.md if the first does not exist |
Every session on the machine CCD runs on |
| 2. Project | CCD.md, CLAUDE.md and AGENTS.md at the repository root. All that exist are read. |
Start of every session |
| 3. Subdirectory | CCD.md or CLAUDE.md in any directory between the repo root and a file the agent touches |
The first time the agent touches that directory |
On the hosted service the global layer is managed by DENDAT and applies to the machine, not to your company. Put your own rules in the project files (layer 2 and 3).
CLAUDE.md and AGENTS.md are read so a repository that already has them works without changes. AGENTS.md is only read at the repo root.
Writing one
# Project notes
- Package manager: pnpm. Never run `npm install`.
- Tests: `pnpm test`. They live in `spec/`.
- Never edit anything under `legacy/`.
- API conventions are in @docs/api-style.md
Keep it short and specific. Files are clipped when injected (project files about 4,000 characters each, subdirectory files about 3,000), so put the rules that matter first.
Imports with @path
A line such as See @docs/api-style.md pulls that file in after the body.
- Paths are relative to the file that contains the import.
~/and absolute paths are allowed. - Imports can nest up to 5 levels deep. Cycles and repeated files are skipped.
- A total of 20,000 characters of imported text is allowed per file.
@nameinside fenced code blocks or inline code is ignored, and so are things that do not look like a path, such as@mentionsand email addresses. A reference needs a slash or a file extension.
See what is active
GET /api/dev/projects/<project_id>/instructions returns every instruction file that applies to the project, with its size and imports:
curl -H "X-API-Key: $CCD_API_KEY" \
"$CCD_URL/api/dev/projects/$PID/instructions"
Add ?path=src/api/users.py (repeatable) to preview which subdirectory files a touch of that path would inject.
Instructions versus memory
Instruction files are for rules that belong to the repository and are reviewed like code. Memory is for things the agent learned that are not worth committing. If a fact should apply to every teammate, put it in CCD.md.