Deep Agents Code picks up the root AGENTS.md
Deep Agents Code (dcode), LangChain’s terminal agent, appends the AGENTS.md at your git root to its instructions every session, so it starts with Ultracite’s rules. With init --hooks deepagents, a hook runs ultracite fix on every file it writes and hands back what’s left in the same turn. Agents you build on the SDK load an AGENTS.md only when you pass it to memory=.
Deep Agents by LangChainChecked against October 2026
# Ultracite Code Standards
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
## Quick Reference
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`
Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
…- 1
default_agent_prompt.mdThe base instructions shipped withdcode, always loaded. - 2
~/.deepagents/<agent>/AGENTS.mdYour instructions for that agent, appended. - 3
.deepagents/AGENTS.mdThe project file in.deepagents/at the git root, appended. - 4
AGENTS.mdUltraciteTheAGENTS.mdat the git root, appended too. Both project files load when present.
How Deep Agents reads the rules
dcode combines its instruction sources instead of choosing one: the built-in prompt, your per-agent file, then the project’s .deepagents/AGENTS.md and root AGENTS.md.
- Combined
- Every source is appended; none replaces another.
- Project root
- The folder with
.git, sodcodefinds the project files from anywhere inside the repository. - Per agent
--agent backend-devreads~/.deepagents/backend-dev/AGENTS.md. The default agent is namedagent.- Extra files
- Other files in
.deepagents/aren’t read at startup. The agent knows about them only whenAGENTS.mdreferences them. - Profile
DEEPAGENTS_HOMEmoves everything under~/.deepagents, per-agentAGENTS.mdfiles included.- SDK
create_deep_agentloads only the paths you pass tomemory=, read through its backend.
A hook on every Write and Edit
init --hooks deepagents adds a PostToolUse hook to .deepagents/hooks.json in Claude Code’s format. dcode runs it once you trust the workspace, and when problems remain the hook exits with code 2, which dcode turns into feedback on the edit.
{
"hooks": {
"PostToolUse": [
{
"hooks": [
{
"command": "npx ultracite fix --hook",
"type": "command"
}
],
"matcher": "Write|Edit"
}
]
}
}dcode -n "Run npx ultracite fix, then fix what it reports" -S "npx" --trust-project-hooks --max-turns 10- 01
dcodechanges a file withwrite_fileoredit_file, which hooks see asWriteandEdit. - 02The hook reads the file’s path from the payload and runs
ultracite fixon just that file. - 03If nothing is left, it exits 0 and
dcodecarries on. - 04If problems remain, it prints them and exits 2, and
dcodeappends them to the tool result the model reads next.
Worth knowing about Deep Agents
Headless runs start without a shell
dcode -ndisables shell execution unless you pass-Swith command names,recommendedorall, so without it the agent can’t runultraciteat all.--max-turnsand--timeoutcap a run and exit with code 124 when the budget runs out.A rubric can make clean lint the bar
/rubric setgives every turn acceptance criteria that a grader model checks the work against, such as “npx ultracite checkreports no problems”. Headless runs take the same criteria with--rubric.SDK agents load only what you pass
If you build on the Deep Agents SDK, nothing reads
AGENTS.mdfor you. Pass its path tomemory=increate_deep_agent, and the backend you choose decides where that path resolves.The Ultracite skill
dcodeloads skills from.agents/skills/,.deepagents/skills/,~/.agents/skills/and~/.deepagents/<agent>/skills/, with the project’s.agents/skills/taking precedence, so it finds the Ultracite skillinitinstalls there. Run it with/skill:ultracite.
Deep Agents questions, answered
- Does Deep Agents read AGENTS.md?
- Deep Agents Code does:
dcodeappends.deepagents/AGENTS.mdand theAGENTS.mdat your git root to its instructions at startup. An agent you build with the SDK reads anAGENTS.mdonly when you pass its path tomemory=. - Does Deep Agents Code support hooks?
- Yes, in Claude Code’s format.
init --hooks deepagentswrites aPostToolUsehook to.deepagents/hooks.json, whichdcoderuns once you trust the workspace; headless runs need--trust-project-hooks. When the hook exits 2,dcodeappends its stderr to the tool result the model reads. - Why can’t dcode run Ultracite in CI?
- Non-interactive runs disable shell execution by default. Pass
-Swith the commands the agent may run, such as-S npx; keepexecuteavailable if you also restrict tools with--allow-fs-tools. - Where does Deep Agents Code keep what it learns?
- In
~/.deepagents/<agent>/AGENTS.mdand thememories/folder beside it. Project instruction files are read-only todcode, anddcode agents reset --agent <name>resets an agent’s own instructions.
Keep going
- AgentOpenHandsOpen-source agent platform with a GUI, CLI, SDK and cloud that runs agents in sandboxes.
- AgentPiMinimal open-source terminal agent you extend with TypeScript extensions and skills.
- AgentCodexOpenAI’s coding agent for the terminal, IDEs, the ChatGPT desktop app and cloud tasks.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.