new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

LangChain · Deep Agents · all subjects

deep agents/configuration

284 notes in this subject, read out of this brain and free to use. This is page 1 of 5.

Managed deployments auto-update and update check settings

Auto-update is enabled by default for managed installs. To opt out, set `DEEPAGENTS_CODE_AUTO_UPDATE=0` in user's shell profile or deploy `config.toml` with `[update] auto_update = false` to `~/.deepagents/config.toml`. To suppress automatic updates and update checks entirely, set `DEEPAGENTS_CODE_NO_UPDATE_CHECK=1` or deploy `[update] check = false`.

DEEPAGENTS_CODE_ environment variable prefix

All Deep Agents Code-specific environment variables use a `DEEPAGENTS_CODE_` prefix (e.g., `DEEPAGENTS_CODE_AUTO_UPDATE`, `DEEPAGENTS_CODE_DEBUG`). The prefix also works as an override mechanism for any environment variable Deep Agents Code reads, including third-party credentials. Deep Agents Code checks `DEEPAGENTS_CODE_{NAME}` first, then falls back to `{NAME}`. For example, set `DEEPAGENTS_CODE_OPENAI_API_KEY=sk-cli-only` to give Deep Agents Code its own value without affecting other tools, or set it empty so Deep Agents Code ignores a key exported in shell.

Skill directory containment allowlist

By default, Deep Agents Code validates that a resolved skill file path stays inside one of the standard skill directories, preventing symlinks from reading arbitrary files outside those roots. To allow symlink targets in non-standard locations, add the location to the containment allowlist via `[skills] extra_allowed_dirs` in `config.toml` or the `DEEPAGENTS_CODE_EXTRA_SKILLS_DIRS` environment variable (colon-separated paths). This does not add a new skill discovery location—skills are still only discovered from standard directories. The environment variable takes precedence over the config file value. Changes take effect on `/reload`.

Theme configuration and selection

Use `/theme` to open an interactive theme selector. Navigate the list to preview themes in real-time, press `Enter` to persist choice to `config.toml`. Deep Agents Code ships with many built-in themes; the default is `langchain`, a dark theme with LangChain-branded colors. The selected theme is persisted under `[ui]` as `theme = "langchain-dark"`. User-defined themes are defined under `[themes.<name>]` sections requiring `label` (str) and optional `dark` (bool, defaults to `false`). All color fields are optional—omitted fields fall back to built-in dark or light palette based on `dark` flag. User-defined themes appear alongside built-in themes in the `/theme` selector.

Install script environment variable pinning

The install script reads environment variables that let you pin version, select extras, and choose Python version fleet-wide. Set them on same line as piped install: `curl -LsSf https://langch.in/dcode | DEEPAGENTS_CODE_VERSION="0.1.16" bash`. Environment variables: `DEEPAGENTS_CODE_VERSION` (exact package version to install, e.g. `0.1.0` or pre-release like `0.1.0rc1`; mutually exclusive with `DEEPAGENTS_CODE_PRERELEASE`), `DEEPAGENTS_CODE_PRERELEASE` (uv pre-release strategy: `disallow`, `allow`, `if-necessary`, `explicit`, or `if-necessary-or-explicit`; mutually exclusive with `DEEPAGENTS_CODE_VERSION`), `DEEPAGENTS_CODE_EXTRAS` (comma-separated pip extras like `ollama`, `ollama,groq`, or `daytona`), `DEEPAGENTS_CODE_PYTHON` (Python version to use; default `3.13`), `DEEPAGENTS_CODE_SKIP_OPTIONAL` (set to `1` to skip optional tool checks), `DEEPAGENTS_CODE_VERBOSE` (set to `1` to show uv's raw stderr and quiet-by-default status lines for debugging), `UV_BIN` (path to uv binary; auto-detected if unset).

Skills precedence rules

When same skill exists in multiple locations, higher precedence wins completely (no merging). Skills precedence order from lowest to highest: 1) `~/.deepagents/{agent}/skills/` (user Deep Agents Code), 2) `~/.agents/skills/` (user tool-agnostic), 3) `.deepagents/skills/` (project Deep Agents Code), 4) `.agents/skills/` (project tool-agnostic, highest). When skill is loaded, Deep Agents Code verifies resolved file path stays within one of these directories. Symlinks resolving outside all skill roots are rejected. To allow symlink targets in additional directories, use `[skills].extra_allowed_dirs`.

Managed deployments install script root support

The install script supports running as root, targeting macOS MDM tools (Kandji, Jamf, etc.) that execute scripts in minimal root environment. When `id -u` is `0`, the script: 1) Resolves real console user's `HOME` (via `/dev/console` or `/Users` directory scan), 2) `chown`s all created files back to target user after each install step. Non-root installs are unaffected—all root-specific code paths short-circuit when not running as root.

Terminal-specific theme mapping

If switching between terminals with different color schemes, map each one to a theme under `[ui.terminal_themes]`. Deep Agents Code matches shell's `TERM_PROGRAM` and applies mapped theme automatically. Press `T` in `/theme` picker to save highlighted theme for current terminal, or manually add by finding `TERM_PROGRAM` value with `echo $TERM_PROGRAM`. Common `TERM_PROGRAM` values: Apple Terminal (`Apple_Terminal`), iTerm2 (`iTerm.app`), WezTerm (`WezTerm`), VS Code integrated terminal (`vscode`), Ghostty (`ghostty`). Theme resolution order: 1) `DEEPAGENTS_CODE_THEME` environment variable, 2) `[ui.terminal_themes]` mapping for current `TERM_PROGRAM`, 3) `[ui] theme` saved preference, 4) built-in default (`langchain`).

Cleaning up Deep Agents Code data

To reset all data: `rm -rf ~/.deepagents`. Clear sessions only: `rm ~/.deepagents/.state/sessions.db*`. Clear input history: `rm ~/.deepagents/.state/history.jsonl`. Clear stored API keys: `rm ~/.deepagents/.state/auth.json`. Clear MCP OAuth tokens: `rm -rf ~/.deepagents/.state/mcp-tokens`. Clear saved MCP project approvals: Remove `enabled_project_server_approvals` from `[mcp]` table in `~/.deepagents/config.toml`. Re-run first-run onboarding: `rm ~/.deepagents/.state/onboarding_complete`. Reset agent instructions: `dcode agents reset --agent {name}`. Remove a skill: `rm -rf ~/.deepagents/{agent}/skills/{skill-name}`. Warning: Deleting `~/.deepagents/.state/sessions.db` removes all conversation history and checkpoints and cannot be undone unless backup exists.

Deep Agents Code config file locations

Deep Agents Code stores configuration under `~/.deepagents/` and in project-level dotfiles. The main config files are: `config.toml` (model defaults, provider settings, themes, update settings), `~/.deepagents/.env` or shell exports (API keys and secrets), `hooks.json` (lifecycle event subscriptions), and `~/.deepagents/.mcp.json` (global MCP server definitions).

dcode config command group

The `dcode config` command group reports configuration in effect and where each value comes from without starting a session. Commands: `dcode config show` (resolve every option against live environment and config.toml, print effective value and source), `dcode config list` or `ls` (list every available option with type, default, and where it can be set, without resolving values), `dcode config get <key>` (show effective value and source for single option), `dcode config path` (show on-disk config file locations and whether each exists). All four commands accept `--json` for machine-readable output. Provider credentials and secrets are reported as configured/not configured only—values never printed by `config show` or `config get` for safety in bug reports.

dcode doctor diagnostics command

Use `dcode doctor` when Deep Agents Code is not starting correctly, a provider or MCP server does not connect, tracing is misconfigured, or an install or update looks wrong. It runs diagnostics without launching a session and summarizes current runtime state. Run `dcode doctor` to show diagnostics in terminal. Pair `dcode doctor` with `dcode config show` when you need both a high-level health check and exact source of a specific setting.

Data locations directory structure

Deep Agents Code stores data in two directory hierarchies: `~/.deepagents/` (Deep Agents-specific data: agent memory, skills, sessions) and `~/.agents/` (tool-agnostic data: skills shared across AI CLI tools). Directory structure: `~/.deepagents/.state/` (per-machine state managed automatically including `sessions.db` SQLite checkpoint database, `history.jsonl` command input history, `chatgpt-auth.json` ChatGPT OAuth token), `~/.deepagents/{agent}/` (per-agent directory, default "agent") containing `AGENTS.md` (user customizations to agent instructions), `skills/{skill-name}/SKILL.md` (user-level skills), `agents/{subagent-name}/AGENTS.md` (custom subagent definitions). `~/.agents/skills/{skill-name}/SKILL.md` (tool-agnostic skills). Project-level: `.deepagents/AGENTS.md` (project instructions), `.deepagents/skills/{skill-name}/SKILL.md` (project-specific skills), `.deepagents/agents/{subagent-name}/AGENTS.md` (project-specific subagents), `.agents/skills/{skill-name}/SKILL.md` (tool-agnostic project skills), or `AGENTS.md` at root (project instructions).

.deepagents vs .agents directory comparison

`.deepagents/` is for Deep Agents Code-specific skills and config that use Deep Agents Code-specific features. `.agents/` is for tool-agnostic skills you want to share across different AI CLI tools. Use `.agents/skills/` for skills that work with any AI coding assistant. Use `.deepagents/skills/` for skills that rely on Deep Agents-specific tools or conventions.

Auto-update configuration

Deep Agents Code automatically checks for and installs updates by default. To opt out, set `[update] auto_update = false` in `config.toml` or export `DEEPAGENTS_CODE_AUTO_UPDATE=0` (environment variable takes precedence). When enabled, Deep Agents Code checks PyPI at session start and automatically upgrades. When disabled, shows update hint with appropriate install command. To suppress automatic update checks entirely, set `[update] check = false` or export `DEEPAGENTS_CODE_NO_UPDATE_CHECK=1`. Disabling update checks also prevents automatic update installs at startup. Manual updates can be checked and installed anytime with `/update` slash command. After upgrade, what's new banner appears on next launch with changelog link. At session exit, if newer version was detected, update banner displays as reminder.

Dotenv file loading order and precedence

Deep Agents Code reads the nearest project `.env` by searching from launch directory and walking up through parents (first `.env` found wins), then `~/.deepagents/.env` as global fallback for all projects. A project `.env` wins over the global one, and neither overrides values already set in shell. Running `/reload` re-reads both `.env` files so keys can change without restarting, with shell values still taking precedence. This applies to every variable Deep Agents Code reads (e.g., `TAVILY_API_KEY` or `DEEPAGENTS_CODE_*` settings), except `DEEPAGENTS_CODE_DANGEROUSLY_ENABLE_PROJECT_MCP_SERVERS` and `DEEPAGENTS_CODE_DISABLED_PROJECT_MCP_SERVERS`, which Deep Agents Code ignores in project `.env` to prevent repositories from approving their own servers.

General options settings resolution order

General options (interpreter limits, update settings, themes, and other `config.toml` keys) resolve in this order: 1) `DEEPAGENTS_CODE_`-prefixed environment variable, 2) Canonical environment variable (when applicable), 3) `~/.deepagents/config.toml`, 4) Built-in default. Use `dcode config show` or `dcode config get <key>` to see the effective value and source.

Deep Agents Code uninstall

To remove the `dcode` and `deepagents-code` binaries and isolated tool environment, run: `uv tool uninstall deepagents-code`. The uninstall command does not remove user configuration or session data. Deep Agents Code stores those files under `~/.deepagents/`, including `config.toml`, `hooks.json`, global `.env`, and `.state/` contents such as saved sessions and credentials. To delete that data as well, run: `rm -rf ~/.deepagents`.

Instructions combination across multiple sources

All instruction sources are combined (not overridden). Instructions combine in order: 1) Package base prompt (always loaded), 2) `~/.deepagents/{agent}/AGENTS.md` (appended), 3) `.deepagents/AGENTS.md` (appended), 4) `AGENTS.md` at project root (appended).

Data storage locations and read/write access

Sessions stored at `~/.deepagents/.state/sessions.db` (R/W, SQLite checkpoint database). Input history at `~/.deepagents/.state/history.jsonl` (R/W, JSON-lines, up/down arrow recall). ChatGPT OAuth token at `~/.deepagents/.state/chatgpt-auth.json` (R/W, backs `openai_codex` provider; created when signing in with ChatGPT and refreshed automatically; readable only by user account). Base instructions from package `default_agent_prompt.md` (R, immutable, updated with upgrades). User customizations at `~/.deepagents/{agent}/AGENTS.md` (R/W, appended to base). Project instructions at `.deepagents/AGENTS.md` or `AGENTS.md` (R, both loaded if present). User skills at `~/.deepagents/{agent}/skills/` (R/W, agent-specific). Shared skills at `~/.agents/skills/` (R, tool-agnostic, cross-CLI). Project skills at `.deepagents/skills/` or `.agents/skills/` (R, project-scoped). Custom subagents at `~/.deepagents/{agent}/agents/` (R/W, user-defined). Project subagents at `.deepagents/agents/` (R, project-defined).

dcode auth command group for shell credential management

The dcode auth command group is the scriptable equivalent of the /auth manager for managing stored credentials from the shell without launching the TUI. Available subcommands are: dcode auth list (or ls) to list every known provider and its key resolution source, dcode auth status <provider> to print the resolution source for one provider, dcode auth set <provider> to store an API key, dcode auth remove <provider> (aliases rm, delete) to delete a stored credential, and dcode auth path to print the resolved path to the credential store (auth.json).

/auth base URL field for custom endpoints

The /auth credential manager includes an optional base URL field. Leave it blank to use the provider's default endpoint, or set a custom endpoint to use with the API key. The base URL is saved alongside the key and resolves as a pair with the API key from the same source.

Provider row labels in /auth manager

The /auth credential manager displays provider rows with labels indicating the key source: [stored] means a key saved via /auth, [env: VARNAME] means the key comes from an environment variable (such as DEEPAGENTS_CODE_OPENAI_API_KEY or OPENAI_API_KEY), and [missing] means no key is stored and the env var is unset.

Example: environment variables for API keys

Example of setting provider API keys via environment variables: ```bash export ANTHROPIC_API_KEY="sk-ant-..." export OPENAI_API_KEY="sk-..." # Prefix with DEEPAGENTS_CODE_ to scope a key to Deep Agents Code only, # leaving a shared key used by other CI steps untouched export DEEPAGENTS_CODE_OPENAI_API_KEY="sk-..." ```

/auth credential manager for LLM providers

The /auth command opens an interactive credential manager that lists installed LLM providers and their key sources, surfaces known providers that can be added, and includes non-model services such as Tavily web search. Users can select a provider to add, replace, or remove its API key. Keys added persist across sessions.

Example: DEEPAGENTS_CODE_ prefix overriding stored keys

Example demonstrating the DEEPAGENTS_CODE_ prefix for overriding stored keys: ```bash # With a key already stored via /auth, a plain env var does not override it. # dcode still uses the app-stored key for this run: OPENAI_API_KEY=sk-xxxx dcode -n "..." # The DEEPAGENTS_CODE_ prefix does override it, for this run only: DEEPAGENTS_CODE_OPENAI_API_KEY=sk-xxxx dcode -n "..." ```

Example: dcode auth commands for storing and removing keys

Example commands for managing credentials via dcode auth: ```bash # Pipe the key in (stdin) echo "$ANTHROPIC_API_KEY" | dcode auth set anthropic # Copy it from an existing environment variable dcode auth set openai --from-env OPENAI_API_KEY # Remove a stored key dcode auth remove anthropic # Print the store location dcode auth path ```

dcode auth set only manages API keys, not browser sign-in

The dcode auth set command manages API keys only. The openai_codex provider uses a ChatGPT browser sign-in rather than an API key, so users must run /auth and select openai_codex to sign in. The dcode auth remove openai_codex command does sign out from openai_codex.

API keys are user-scoped on the machine

API keys stored in Deep Agents Code are scoped to the user account on the machine. Deep Agents Code never transmits stored credentials anywhere except to the configured provider's API.

dcode auth set reads from stdin by default

The dcode auth set <provider> command reads the API key from stdin by default, so it never lands in shell history or argv. Users can pipe the key in or use --from-env VAR to copy it from a process environment variable. The set command refuses to run in an interactive terminal to prevent accidental invocation from hanging waiting on input.

Stored base URL is not a secret

A stored base URL in the /auth credential manager is not a secret and may be logged. However, the API key paired with it is never logged.

Tavily API key for web search

The built-in web_search tool uses Tavily for web search functionality. Users can store the Tavily key in the /auth credential manager where Tavily appears as a non-model service, or set the TAVILY_API_KEY environment variable. Tavily keys start with tvly-, and the free tier is sufficient for most Deep Agents Code usage. Deep Agents Code shows a 'Web search disabled' notification on startup until a key is provided.

DEEPAGENTS_CODE_ prefix for scoping keys to Deep Agents Code

The DEEPAGENTS_CODE_ prefix is the explicit override mechanism to use a specific API key in Deep Agents Code without affecting keys used by other tools. This allows avoiding accidental reuse of shared environment variables. For example, a plain OPENAI_API_KEY used by other tools will not override an app-stored key, but DEEPAGENTS_CODE_OPENAI_API_KEY will override an app-stored key for a single run without clearing it.

API key resolution order in Deep Agents Code

When a provider's key is set in multiple places, Deep Agents Code uses the first of these that is set: (1) DEEPAGENTS_CODE_-prefixed environment variable (e.g., DEEPAGENTS_CODE_OPENAI_API_KEY), (2) App-stored key entered in /auth credential manager, (3) Plain provider environment variable (e.g., OPENAI_API_KEY) from shell or .env files. An app-stored key wins over a plain env-var key, but a DEEPAGENTS_CODE_-prefixed key wins over an app-stored key.

Rubric grader model configuration

Use `/rubric model <provider:model>` to set the model that grades rubric results.

Rubric file from path

Use `/rubric file <path>` to load acceptance criteria from a file. Example: `/rubric file acceptance.md`

Rubric next for one-turn criteria

Use `/rubric next <criteria>` to apply criteria only to the next submitted task. This acts as a one-turn quality gate. Example: `/rubric next only change the auth callback; do not refactor unrelated code`

Rubric set for persistent criteria

Use `/rubric set <criteria>` to apply criteria to future turns until cleared. A sticky rubric acts as a quality gate for the agent's work across multiple turns. Example: `/rubric set tests pass; no unrelated files changed; help text is updated`

Rubric show and clear commands

Use `/rubric show` to inspect the active rubric. Use `/rubric clear` to remove the active rubric.

Goal show and clear commands

Use `/goal show` to inspect the current goal, its status, and its criteria. Use `/goal clear` to remove the active goal.

Goal pause and resume commands

Use `/goal pause` to save the goal without letting it drive work or grading, so intervening prompts run without it. Use `/goal resume` to reactivate a paused goal and continue from the existing conversation.

Goal amendment without cancellation

Use `/goal amend <feedback>` to propose coordinated updates to the objective and criteria without cancelling the current task and replaying work. The amendment goes through the same inline review (accept, edit, revise, or cancel) before finalizing. Example: `/goal amend remove JSON export, add streaming CSV support, keep the CSV tests`

Goal lifecycle across turns

Once a goal's acceptance criteria are accepted, the goal stays active across turns until it is paused, completed, blocked, or cleared. Each follow-up turn is graded against the goal's acceptance criteria until the work is done. This approach lets you work toward a larger objective over multiple turns without restarting.

Goal command: /goal add objective

Use `/goal <objective>` to draft acceptance criteria from a plain-language objective and review them before work begins. This is used when you know the outcome you want but want Deep Agents Code to propose the acceptance criteria before work begins. Example: `/goal add OAuth refresh handling`

Goal vs Rubric: when to use each

Use a goal when you have one measurable objective and want Deep Agents Code to draft acceptance criteria before it starts. Use a rubric when you already know the criteria you want the agent graded against. A goal has a lifecycle: once accepted it stays active across turns until you pause it, the agent marks it completed or blocked, or you clear it. A rubric can apply to the next turn only or persist across future turns.

Goal grader model configuration

Use `/goal model [provider:model|clear]` to set or clear the model that grades the goal. Use `/goal max-iterations <N|clear>` to set or clear the maximum grading iterations for the goal.

MCP advanced allow and deny policy via environment

Use `[mcp].disabled_project_servers` in `~/.deepagents/config.toml`, or `DEEPAGENTS_CODE_DISABLED_PROJECT_MCP_SERVERS` in shell or global `~/.deepagents/.env`, to always reject project MCP servers by name. Denies win over saved approvals and the `--trust-project-mcp` flag. Set `DEEPAGENTS_CODE_DANGEROUSLY_ENABLE_PROJECT_MCP_SERVERS` in shell or global `~/.deepagents/.env` to a comma-separated list of server names for automation that must pre-approve project MCP servers by name; this is a process-wide escape hatch where a different project or server-definition change still matches. When this variable is set, Deep Agents Code ignores saved approvals. `deepagents-code>=0.1.40` ignores the former `DEEPAGENTS_CODE_ENABLED_PROJECT_MCP_SERVERS` variable.

MCP saved approvals configuration in config.toml

Saved MCP approvals are stored in `~/.deepagents/config.toml` under the `[mcp]` section as `enabled_project_server_approvals`, an array of objects each containing `project_root`, `name`, and `fingerprint` fields. To revoke an approval, remove its entry from `enabled_project_server_approvals`. To force a re-approval without editing `config.toml`, change the server definition in the project's `.mcp.json`; the saved fingerprint no longer matches. The legacy flat `[mcp].enabled_project_servers` list is ignored.

MCP trust covers stdio and remote entries

Remote MCP servers can SSRF into localhost or cloud-metadata endpoints during the pre-flight probe and exfiltrate `${VAR}` values through headers, so Deep Agents Code gates them the same way as stdio servers. User-level configs (`~/.deepagents/.mcp.json`) are always trusted, following the same trust model as `config.toml` and `hooks.json`. The `dcode mcp login` command also honors project trust: an untrusted project-level config is skipped during login discovery so an attacker-controlled remote entry cannot pull secrets into the OAuth handshake.

MCP project trust modes: interactive, saved approvals, and non-interactive

Interactive mode prompts for approval before activating project servers. Saved approvals write selected server approvals to `~/.deepagents/config.toml`, each scoped to the resolved project root, server name, and a SHA-256 fingerprint of the server definition; if config fields change, Deep Agents Code prompts again. Non-interactive mode (`-n`) silently skips project servers without a matching saved or environment approval unless `--trust-project-mcp` is passed; explicit denies still apply.

MCP project-level trust model for security

Project-level MCP configs can contain stdio servers that execute local commands and remote servers whose `headers` may interpolate `${VAR}` from environment. To prevent untrusted repositories from running arbitrary code or exfiltrating local secrets on CLI startup, Deep Agents Code enforces a default-deny policy for project-level entries. In interactive mode, Deep Agents Code prompts for approval before activating project servers, showing each stdio command and remote URL. Choose `Allow once` to activate every prompted server for the current session, or `Allow for this project — until changed` to activate and save approvals for future sessions. Saved project MCP approvals require `deepagents-code>=0.1.40`.

MCP system prompt awareness of connected servers

Connected MCP servers and their tools are automatically listed in the agent's system prompt, grouped by server name and transport type. This helps the model reason about tool provenance and failure domains without requiring manual context.

Update memory and skills with /remember command

Use the /remember command to explicitly prompt the agent to update its memory and skills from the current conversation.

Two primary customization methods: Memory and Skills

There are two primary ways to customize an agent in Deep Agents Code: Memory using AGENTS.md files and auto-saved memories that persist across sessions for general coding style, preferences, and learned conventions. Skills are reusable, on-demand capabilities that the agent discovers and reads only when relevant for task-specific context such as workflows, best practices, and reference docs.

Automatic memory storage location and structure

As you use the agent, it automatically stores information in ~/.deepagents/<agent_name>/memories/ as markdown files. The agent organizes its memories by topic with descriptive filenames.

Three-step memory protocol: Research, Response, Learning

The memory-first protocol works in three steps: Research (searches memory for relevant context before starting tasks), Response (checks memory when uncertain during execution), and Learning (automatically saves new information for future sessions).

Agent updates AGENTS.md with behavior instructions and patterns

The agent updates AGENTS.md as you provide information on how it should behave, feedback on its work, or instructions to remember something. It also updates its memory if it identifies patterns or preferences from your interactions.

AGENTS.md files provide persistent context loaded at session start

AGENTS.md files provide persistent context that is always loaded at session start. Global AGENTS.md is located at ~/.deepagents/<agent_name>/AGENTS.md and is loaded every session. Project AGENTS.md is located at .deepagents/AGENTS.md in any git project root and is loaded when Deep Agents Code is run from within that project. Both files are appended to the system prompt at startup.

Additional structured project knowledge files must be referenced in AGENTS.md

To add more structured project knowledge in additional memory files, add them in .deepagents/ and reference them in the AGENTS.md file. You must reference additional files in the AGENTS.md file for the agent to be aware of them. The additional files are not read on startup but the agent can reference and update them when needed.

Global AGENTS.md usage guidelines

Use a global AGENTS.md (located at ~/.deepagents/agent/AGENTS.md) for: your personality, style, and universal coding preferences; general tone and communication style; universal coding preferences such as formatting and type hints; tool usage patterns that apply everywhere; workflows and methodologies that don't change per-project.

Give your agent this brain