Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

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.

…
Ultracite’s rules
Where Deep Agents looks for instructions
  1. 1default_agent_prompt.mdThe base instructions shipped with dcode, always loaded.
  2. 2~/.deepagents/<agent>/AGENTS.mdYour instructions for that agent, appended.
  3. 3.deepagents/AGENTS.mdThe project file in .deepagents/ at the git root, appended.
  4. 4AGENTS.mdUltraciteThe AGENTS.md at 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, so dcode finds the project files from anywhere inside the repository.
Per agent
--agent backend-dev reads ~/.deepagents/backend-dev/AGENTS.md. The default agent is named agent.
Extra files
Other files in .deepagents/ aren’t read at startup. The agent knows about them only when AGENTS.md references them.
Profile
DEEPAGENTS_HOME moves everything under ~/.deepagents, per-agent AGENTS.md files included.
SDK
create_deep_agent loads only the paths you pass to memory=, 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"
      }
    ]
  }
}
init --hooks deepagents
dcode -n "Run npx ultracite fix, then fix what it reports" -S "npx" --trust-project-hooks --max-turns 10
  1. 01dcode changes a file with write_file or edit_file, which hooks see as Write and Edit.
  2. 02The hook reads the file’s path from the payload and runs ultracite fix on just that file.
  3. 03If nothing is left, it exits 0 and dcode carries on.
  4. 04If problems remain, it prints them and exits 2, and dcode appends them to the tool result the model reads next.

Worth knowing about Deep Agents

  • Headless runs start without a shell

    dcode -n disables shell execution unless you pass -S with command names, recommended or all, so without it the agent can’t run ultracite at all. --max-turns and --timeout cap a run and exit with code 124 when the budget runs out.

  • A rubric can make clean lint the bar

    /rubric set gives every turn acceptance criteria that a grader model checks the work against, such as “npx ultracite check reports 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.md for you. Pass its path to memory= in create_deep_agent, and the backend you choose decides where that path resolves.

  • The Ultracite skill

    dcode loads 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 skill init installs there. Run it with /skill:ultracite.

Deep Agents questions, answered

Does Deep Agents read AGENTS.md?
Deep Agents Code does: dcode appends .deepagents/AGENTS.md and the AGENTS.md at your git root to its instructions at startup. An agent you build with the SDK reads an AGENTS.md only when you pass its path to memory=.
Does Deep Agents Code support hooks?
Yes, in Claude Code’s format. init --hooks deepagents writes a PostToolUse hook to .deepagents/hooks.json, which dcode runs once you trust the workspace; headless runs need --trust-project-hooks. When the hook exits 2, dcode appends 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 -S with the commands the agent may run, such as -S npx; keep execute available if you also restrict tools with --allow-fs-tools.
Where does Deep Agents Code keep what it learns?
In ~/.deepagents/<agent>/AGENTS.md and the memories/ folder beside it. Project instruction files are read-only to dcode, and dcode agents reset --agent <name> resets an agent’s own instructions.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.