AGENTS.md is a scoped runtime bootstrap contract. It gives an agent the
minimum high-value context needed to understand its environment, make correct
decisions, follow constraints, use the right workflows, and discover sources
that would otherwise be easy to miss.
It is not comprehensive documentation, a catalog of everything in the
repository, or a guide for maintaining AGENTS.md itself.
Decide what belongs inline
Add content when at least one of these tests is met:- It has demonstrated behavioral value, or its absence has caused observable mistakes or wasted work.
- It defines a historically misunderstood or rare but high-consequence boundary.
- It provides durable company, product, customer, system, or operating context that changes which otherwise valid decision is best.
- It routes work correctly or reveals a valuable tool, workflow, entrypoint, or source an agent may not discover on its own.
Prefer enforcement and progressive disclosure
Use the earliest reliable intervention. Prefer code structure, types, linting, formatting, tests, or CI when they can enforce an invariant effectively. Keep a concise instruction when enforcement is late, partial, expensive, unreliable, or unclear enough that an agent still needs guidance. Give detailed material one canonical home. When useful content is too large for runtime context:- Move it to the appropriate specification, runbook, or reference.
- Keep the decision-critical summary or trigger inline.
- Link directly to the canonical source and explain when and why to read it.
AGENTS.md shorter.
Orient decisions before implementation
State concise, durable context that changes tradeoffs: what the company or product does, who it serves, the role of this system, and any resource or operating priors that materially affect the best solution. Link to canonical sources for the extended context instead of making agents reconstruct purpose from low-level code. Keep current work, detailed customer evidence, ownership, versions, migration state, and other mutable facts in live or regularly reviewed sources whenever a pointer provides enough runtime value. If a mutable fact must remain inline, keep it brief and link to its authority. Avoid unanchored terms such as “currently,” “recently,” “new,” or “legacy for now”; use an absolute date or a live source.Layer instructions by scope
- The root
AGENTS.mdcontains only repository-wide context, rules, defaults, and discovery. - A nested
AGENTS.mdcontains only subtree-specific additions, qualifications, explicit overrides, and local discovery. - Do not repeat parent wording. Review the combined parent and nested context, not each file in isolation.
- State scope and precedence briefly when they are not obvious. Make overrides explicit instead of requiring the agent to infer them.
Make links useful at decision time
Curate high-value tools, workflows, real entrypoints, and source-of-truth files rather than listing the repository landscape. A path appearing in source code,ls, or package.json does not explain its authority or when to use it.
For every non-obvious link, say what it contains, when to open it, and why it
matters. Phrase links as an explicit condition, canonical target, and reason to
read it.
Link to the most specific canonical target. Verify that it contains the
promised information, is accessible, is current or explicitly dated, and is
written for the person or agent making the decision.
Write for retrieval and correct application
After a minimal scope statement, order content in the sequence an agent needs to decide and act. Put the most consequential mental models, boundaries, and guardrails first; follow with workflows, verification, conventions, and delivery guidance as needed for the scope.- Use operational, grepable headings and canonical terminology.
- Keep related instructions together and near the workflow that triggers them.
- Use short prose for coherent orientation and one-idea bullets for independent rules, references, and actions.
- Use
must,never,always, andonlyfor invariants;preferordefault tofor heuristics; andbeforeorwhenfor conditions. - State real exceptions and scope boundaries. Give every prohibition a safe alternative, a source to consult, or a condition for requesting judgment.
- Name exact commands, paths, tools, and concepts. Keep broadly applicable verification commands inline; link to uncommon variants and troubleshooting.
- Keep concise terminology distinctions that change decisions or have been repeatedly misunderstood. Link to comprehensive glossaries, inventories, data models, and architecture references.
Keep authoring governance outside runtime files
Runtime content tells agents how to operate in the repository. The process for authoring, evaluating, and maintaining that content belongs in an external policy or review workflow. Do not paste meta-instructions such as “keep this file short,” “avoid duplication,” “maintainAGENTS.md,” or “update this file when behavior
changes” into runtime files. Size is a review signal, not the objective;
retrieval and correct behavior are the objective.
Use interaction audits, repeated corrections, incidents, rejected changes,
support patterns, and representative evaluations as evidence. When a failure
occurs, decide whether the best fix is clearer code, types, enforcement,
tooling, canonical documentation, discovery guidance, or a runtime instruction.
Review and refactor safely
Before revising an instruction file:- Inventory the applicable root and nested files, then resolve the inherited instruction chain.
- Read the complete target, parent instructions, linked canonical sources, and relevant evidence.
- Measure the target and inherited context, then classify each block as keep, compress, move and link, delete, or replace with mechanical enforcement.
- Review exact proposed wording, including interactions, misleading implications, and over-application risk.
- Reread the complete result and validate formatting, links, duplication, scope, retrieval, and representative agent behavior.
Charlie-specific instruction loading
Charlie loads sharedAGENTS.md and CLAUDE.md instructions at any directory
depth. Charlie-specific CHARLIE.md instructions load only at the repository
root or anywhere beneath the root .agents/ directory. CHARLIE.md is ordinary
repository content, not a confidentiality, authorization, or access boundary.
See Customization for the supported instruction, skill, and
daemon surfaces.