Writing AGENTS.md
AGENTS.md is the Agent's permission slip. Not who it is — that's
SOUL.md. Not what it knows about you — that's USER.md. Just: what
is it always required to do, and what is it never allowed to do,
regardless of how the request is phrased.
AGENTS.md has become something close to an open standard — it's
read natively by a wide range of AI coding tools, not just Cline, and
the same principles apply whether the rules are about code or about
client work. The research on what makes these files effective is
blunt: vague rules do nothing. "Write clean code" or "be careful
with client data" sound like guidance but give the Agent nothing to
actually check itself against. Specific, checkable rules are the only
kind that reliably change behaviour.
What goes into it
| Section | Answers |
|---|---|
| Always | Non-negotiable actions — formatting, sourcing, saving conventions |
| Never | Hard boundaries — what it must not do, no matter the request |
| Defaults | Standing choices that apply unless told otherwise — output language, length limits |
| Missing information | What to do when something critical is missing, instead of guessing |
A worked example
This is a trimmed version of an AGENTS.md, adapted from a real
clearxx Workshop template:
---
name: agents
description: Operating rules and permissions for this workspace.
---
# AGENTS — Rules and Permissions
## What you always do
- Format all output as Markdown unless explicitly told otherwise
- Cite the source file or document when referencing project content
- Ask one clarifying question before starting a complex task, if
something critical is missing
- Save all outputs using the exact filename given in the task
## What you never do
- Invent facts, figures, or quotes
- Send, share, or publish anything externally
- Skip the client's situation — you establish context before recommending
- Produce output longer than requested
- Use bullet points in narrative or executive-summary sections
## Defaults
- Output language: English, unless the user requests otherwise
- Executive summaries: one page maximum
- Tables: always Markdown format
## Handling missing information
- State what's missing and why it matters before proceeding
- Do not assume or invent missing details
- Use placeholder text marked [TO BE CONFIRMED] where information is
absent
Every line here is checkable. "Cite the source document" is something you can look at a draft and confirm did or didn't happen. "Be thorough" is not.
Good vs. weak examples, side by side
| Weak | Better | Why |
|---|---|---|
| "Be careful with client information." | "Never send, share, or publish anything externally without explicit confirmation." | The weak version gives no test. The better version can be checked against any specific action. |
| "Write good executive summaries." | "Executive summaries: maximum one page. Situation → Complication → Resolution → Approach → Why Us." | Structure and a limit are checkable; "good" is not. |
| "Use your judgement on missing information." | "If a key fact is missing, state what's missing and why it matters before proceeding. Never invent it." | Judgement without a rule tends to default to filling the gap plausibly — which is exactly the failure mode this is meant to prevent. |
| "Follow best practices for client communication." | "Anticipate the client's likely objections and address them before they're raised." | "Best practices" is a phrase the Agent already has generic training on — it adds instruction-following cost without adding information. A concrete behaviour is new information. |
Don'ts
- Don't restate what the Agent already knows. "Write clear,
professional English" is true of virtually every model by default —
including it costs context and adds nothing. Reserve
AGENTS.mdfor rules specific to your firm that it wouldn't otherwise guess. - Don't let it become an essay. Research on these files across thousands of real repositories found that length past roughly 150 lines produces no further improvement in behaviour, and can actively increase cost without benefit. If it's growing long, that's a sign to cut, not to add a table of contents.
- Don't contradict yourself between sections. "Always ask a clarifying question first" and "always act immediately on the first request" can't both survive an edit — a rule that conflicts with an earlier one usually means the earlier one needs updating, not that the Agent should pick a winner at runtime.
- Don't write it by having the Agent generate it for you. Auto-generated rules tend to be generic and plausible-sounding rather than specific to how your firm actually works, which is the opposite of what makes this file useful. Write it by hand, from your own working method.
- Don't put identity or tone here. "Sound confident but not
arrogant" is
SOUL.md. If a line inAGENTS.mdisn't checkable as a yes/no rule, it's probably misfiled.
Where and how to use it
clearxx Agent & Build Workspace. Save it as AGENTS.md in your
project folder, alongside SOUL.md, SKILL.md, and USER.md. Cline
reads files if you tell it before a task in that project starts.
clearxx Assistant — one-off. Paste it into the chat input before your first message, for a single conversation.
clearxx Assistant — recurring. Create a Folder and paste the
combined content of AGENTS.md (with SOUL.md and USER.md) into
the Folder's System Prompt field. Do not create a Knowledge, which
vectorizes files for retrieval rather than reading them whole.
Every new chat started from that Folder then has the Skill available
automatically. Start a chat either directly from the Folder or add the
Folder to the chat.
If you have a new topic with new requirements you may need a new Agent file. Before using it, always think about where to put it, and when and how to bring it into your work.