Project instructions and rules
Which instruction files the agent reads, how long they may be, how MCP servers are discovered, and what is not supported.
A project can tell the agent how to behave: which file to read, what conventions to follow, which MCP servers to start. The mechanism differs between surfaces, and the differences are big enough to write down.
AGENTS.md, then CLAUDE.mdLimit 64,000 characters, longer content is truncated with a note
Desktop default project instructions off until enabled
MCP
~/.agents/mcp.json and, in Desktop, ~/.freebuff/mcp.jsonHooks file-change hooks are not supported in the SDK environment
Which file the agent reads
In the Desktop harness, the root AGENTS.md is the instruction file. If it is
empty, CLAUDE.md is used instead; the Claude-style harness additionally reads
.claude/CLAUDE.md. A file that cannot be read is skipped rather than treated as an
error, so a permissions problem can look like instructions that were ignored.
The CLI finds .agents/mcp.json by walking up from the project directory; the same
walk-up logic is what makes a home-level config reachable from any project. Do not assume a
single global instruction file is read everywhere — the surfaces resolve their files
separately.
Size limit and truncation
Project instructions are capped at 64,000 characters. Content past that point is cut and marked as truncated — the agent does not see it, and nothing warns you at write time. A 2,000-line instruction file is therefore not "thorough"; it is a file whose second half is invisible.
Keep instructions short and checkable: build command, test command, style rules, paths that must not be touched. Prose about the product's philosophy competes with the actual task for the same budget and loses.
It is a setting, not an automatic read
In Desktop the project-instruction field is off until the user turns it on. The hosted Web
client uses a different default for guest sessions. These are different surfaces with
different defaults, so "the agent ignored my AGENTS.md" is worth checking against
the setting before rewriting the file.
The security reason for the toggle is the same reason a repository you have not read is dangerous: instructions in a repo are input from whoever wrote the repo, and an agent that follows them blindly will follow the wrong ones too.
MCP servers
MCP servers are declared in JSON. Desktop reads a shared ~/.agents/mcp.json and
its own sidecar ~/.freebuff/mcp.json; unset args, env
and headers default to empty.
- Errors are per server — a broken entry is reported in the interface instead of hiding the entries that work.
- The environment is restricted — Desktop limits which variables from its own environment a server may inherit, so a server cannot read every secret the app can.
- Merging is order-dependent — in the CLI, a later file wins for a server with the same name, which means the home config overrides the repository's.
Trust is a file on disk
In the CLI, executable agents and MCP configuration from a project's .agents
directory — or from a parent directory — require trust. Trust is remembered per absolute path
in <configDir>/trusted-agent-dirs.json.
- Declining the prompt skips that directory for the run; it is not remembered as trusted.
- In a non-interactive run there is nobody to ask, so an untrusted directory is skipped rather than loaded.
--trust-agentsloads it without asking, for that invocation.
This is trust in agent code and server definitions, not permission for every terminal command. A trusted repository can still start a server that does something you did not intend, which is why the path and the person who added it matter.
Ignore files
Reading and searching honour .gitignore, .codebuffignore and
.manicodeignore, including rules in nested directories. A pattern that does not
parse is skipped on its own; the remaining rules still apply.
The three are not equivalent. A file ignored by .gitignore can still be read when
you ask for it explicitly, while .codebuffignore and .manicodeignore
block an explicit read of that path. Use the latter two for things the agent must not open even
when named.
Ignore files steer the agent's reading and searching tools; they are not a sandbox. A shell command can still reach a path that an ignore rule hides, so a secret has to be made unreadable by permissions, not by a pattern.
The config format, transport types and a working example are on MCP servers.
Hooks
File-change hooks are not supported in the SDK environment: the hook runner is a no-op and says so. Do not build a workflow that depends on a hook firing after an edit — put the check in the build or test command, which the agent runs and sees the output of.
What the agent may do
Approvals are a property of the client, not of AGENTS.md. An instruction file can
ask the agent not to touch a path, and a well-behaved run will respect it, but that is a
convention rather than a sandbox: the agent runs with your user's permissions and can read
files outside the project when a command or a read points there. If something must be
unreachable, make it unreachable at the filesystem level.
For how the agent plans, asks questions and verifies work, see working with the agent.