Docs The agent
Instructions and commands
Give the agent standing instructions with QUAD.md, AGENTS.md or CLAUDE.md, write your own slash commands, and name specialist agents in plain Markdown files.
Three kinds of Markdown file shape what the agent does: instruction files it reads on every turn, slash commands you run by name, and named agents it can hand work to. All three are plain files. There is no editor for them in the window yet: create them in your editor, or ask the agent to write them.
Instruction files
Instruction files are read the way people already keep them. In each folder, the first of these that exists is used:
QUAD.md.quad/QUAD.mdAGENTS.md.quad/AGENTS.mdCLAUDE.md.claude/CLAUDE.md
Only one file per folder is read, so a repository that keeps the same text under two names does not say it twice.
Which folders
The app reads one instruction file per folder, from the top of the git repository down to the session’s workspace. If you work in ~/code/my-app/packages/parser and the repository starts at ~/code/my-app, it reads:
~/code/my-app/QUAD.md (or AGENTS.md, CLAUDE.md ...)
~/code/my-app/packages/QUAD.md
~/code/my-app/packages/parser/QUAD.md
The walk up stops at the top of the git repository, looks at most eight folders up, and never goes above your home folder. If the workspace is not in a git repository, only the workspace folder itself is read.
Your global file
Your own instructions, for every project, come first. The first of these that exists is used:
instructions.mdin the app’s data folder (~/Library/Application Support/dev.quad.harness/instructions.md)~/.quad/QUAD.md~/.claude/CLAUDE.md
Order and limits
Files go into the system prompt most general first: your global file, then the repository top, then each folder down to the workspace. Where they disagree, the more specific one wins.
| Limit | Value |
|---|---|
| Read from one file | 32,000 characters |
| All instruction files together | 64,000 characters |
Files are read again on every turn, so an edit applies to the next message. They stay the same text until a file changes, so they do not disturb the provider’s prompt cache.
What to put in them
Good instruction files are short and specific:
# my-app
- Build with `cargo build`. Run tests with `cargo test -p parser` before saying a fix is done.
- Format with `cargo fmt` after every edit.
- The parser lives in `crates/parser`. Do not change the public API in `src/lib.rs` without asking.
- Commit messages: one short line, then a blank line, then why.
Tip. Type
/initin the composer to put a request in the box that asks the agent to create or updateQUAD.mdwith the project’s build, test, architecture and contribution notes.
The goal rides along
When a session has an active goal, a line Goal for this session, set by the person: <your goal> is added to the system prompt until you complete it. See Goals, checkpoints and rewind.
Note. Agent providers such as Claude Code run their own loop and read their own instruction files. Quad’s system prompt is not passed to them.
Your own slash commands
A slash command is a Markdown file whose text is a prompt you run by name. .quad/commands/review.md makes /review.
Where commands live
Folders are looked at in this order, and the first file with a given name wins, so a project can override one of your own:
| Folder | Shown as |
|---|---|
<workspace>/.quad/commands/ |
Project command |
<workspace>/.claude/commands/ |
Project command |
commands/ in the app’s data folder |
Your command |
~/.quad/commands/ |
Your command |
~/.claude/commands/ |
Your command |
A file in a subfolder gets the folder in its name: frontend/test.md is /frontend:test. Names use letters, digits, dashes, underscores and colons.
Arguments
The file’s text is what is sent. Placeholders are filled from what you type after the command:
| Placeholder | Becomes |
|---|---|
$ARGUMENTS |
Everything typed after the command |
$1, $2, … |
The first, second, … word typed after it |
A short block at the top may give a description: (shown in the / menu) and an argument-hint: (shown after the name).
Example
.quad/commands/fix-issue.md:
---
description: Fix a GitHub issue and add a test for it
argument-hint: <issue number>
---
Read GitHub issue #$1 with the gh tool. Find the cause, fix it, add a test that fails
without the fix, and run the tests. Summarise what you changed in three lines.
Type /fix-issue 42 and press Return. The text is sent with $1 replaced by 42.
Another, using every word:
.quad/commands/explain.md:
---
description: Explain a part of the code for a newcomer
argument-hint: <file or symbol>
---
Explain $ARGUMENTS to someone new to this codebase: what it does, who calls it,
and the one thing most likely to surprise them.
Using them
Type / in the composer. Your commands appear in the menu with the built-in ones, marked Project command or Your command unless they have a description. Choosing one puts /name in the box so you can add arguments, then send.
Limits: up to 200 commands, files up to 64 KB, subfolders up to three deep.
Named agents
A named agent is a specialist the main agent can hand work to. .quad/agents/reviewer.md describes an agent called reviewer.
Where they live
The same pattern as commands, first match wins:
| Folder | Kind |
|---|---|
<workspace>/.quad/agents/ |
Project |
<workspace>/.claude/agents/ |
Project |
agents/ in the app’s data folder |
Yours |
~/.quad/agents/ |
Yours |
~/.claude/agents/ |
Yours |
The file
A block at the top with:
description:when to use it. The main agent reads this to decide.tools:optional, a comma-separated list of the tools it may use. Leave it out for all of them.
Then the instructions that make it what it is.
---
description: Reviews a diff for correctness, regressions and missing tests. Use after a change is made.
tools: Read, Grep, Glob, git
---
You review changes. Read the diff with git, then the files around each change.
Report problems as a numbered list with file and line. For each fix you expect,
say which test should cover it. Do not edit anything.
Tool names can be this app’s (read_file, grep, glob, bash, git) or the names other agents’ files use: Read, Write, Edit, MultiEdit, Bash, Grep, Glob, LS, WebFetch, WebSearch and Task are mapped to their equivalents. Anything else is kept as written.
How they are used
The main agent sees the list of named agents. When a task fits one, it calls its subagent tool with that agent’s name. The child runs with the file’s instructions added to its prompt and only the listed tools, then returns its answer. You can also ask for one directly: “Ask the reviewer agent to look at the parser change.”
Settings → Models and agents → Agents lists your named agents under Your named agents.
Limits: up to 50 named agents, files up to 64 KB, and up to 16,000 characters of instructions each.
Named agents need the Subagents and workflows feature switched on.