~/.deepagents/ and in project-level dotfiles. For the full directory tree, session storage, and skill paths, see Data locations.
The main config files are:
Config file
Edit
config.toml for model defaults, provider settings, themes, and update settings.Environment variables
Set global API keys and secrets in
~/.deepagents/.env or shell exports.Hooks
Subscribe external commands to lifecycle events in
hooks.json.MCP servers
Define global MCP servers in
~/.deepagents/.mcp.json.How settings resolve
Deep Agents Code merges settings from several sources. Which source wins depends on the setting type. General options (interpreter limits, update settings, themes, and otherconfig.toml keys) resolve in this order:
DEEPAGENTS_CODE_-prefixed environment variable- Canonical environment variable (when applicable)
~/.deepagents/config.toml- Built-in default
dcode config show or dcode config get <key> to see the effective value and source. See Inspect configuration.
Provider API keys use a separate order. See Key resolution order.
Dotenv files load at startup: the nearest project .env (walking up from the launch directory), then ~/.deepagents/.env. Shell exports always beat .env values. See Loading order and precedence.
Provider endpoints (base_url) resolve with their matching API key. See Endpoints, keys, and gateways.
Inspect configuration
Thedcode config command group reports what configuration is in effect and where each value comes from, without starting a session. This is useful for confirming that an environment variable or config.toml setting is being picked up, and for sharing a redacted snapshot in a bug report.
| Command | Description |
|---|---|
dcode config show | Resolve every option against the live environment and config.toml, printing the effective value and which source provided it |
dcode config list (alias ls) | List every available option with its type, default, and where it can be set, without resolving values |
dcode config get <key> | Show the effective value and source for a single option, e.g. dcode config get interpreter.memory_limit_mb |
dcode config path | Show the on-disk config file locations (config.toml, project and global .env, hooks.json, and managed state files) and whether each exists |
--json for machine-readable output. For the full list of management subcommands, see CLI reference.
Environment variables
In addition to shell exports, Deep Agents Code reads environment variables from dotenv files, so you can keep API keys out of your shell profile and avoid duplicating.env files across projects.
~/.deepagents/.env
Loading order and precedence
At startup, Deep Agents Code reads the nearest project.env, found by searching the directory you launch from and walking up through its parents (the first .env found wins), then ~/.deepagents/.env as a global fallback for all projects. A project .env wins over the global one, and neither overrides a value already set in your shell. Running /reload re-reads both .env files so you can change keys without restarting, with shell values still taking precedence. This applies to every variable Deep Agents Code reads (for example, TAVILY_API_KEY or the DEEPAGENTS_CODE_* settings).
DEEPAGENTS_CODE_ prefix
All Deep Agents Code-specific environment variables use a DEEPAGENTS_CODE_ prefix (e.g., DEEPAGENTS_CODE_AUTO_UPDATE, DEEPAGENTS_CODE_DEBUG). See the environment variable reference for the full list.
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}:
~/.deepagents/.env
Skill directory allowlist
By default, when Deep Agents Code loads skills it validates that a resolved skill file path stays inside one of the standard skill directories. This prevents symlinks inside skill directories from reading arbitrary files outside those roots. If you store shared skill assets in a non-standard location and use symlinks from a standard skill directory to reference them, you can add that location to the containment allowlist. This does not add a new skill discovery location: skills are still only discovered from the standard directories.Paths added to the skill containment allowlist. Supports
~ expansion.DEEPAGENTS_CODE_EXTRA_SKILLS_DIRS environment variable as a colon-separated list:
/reload.
Themes
Use/theme to open an interactive theme selector. Navigate the list to preview themes in real-time, press Enter to persist your choice to config.toml.
Deep Agents Code ships with many built-in themes. The default theme is langchain, a dark theme with LangChain-branded colors. The selected theme is persisted under [ui]:
[themes.*] and [ui.terminal_themes] sections in Config file or configure them directly in config.toml:
User-defined themes, overrides, and terminal mapping
User-defined themes, overrides, and terminal mapping
User-defined themes
Define custom themes under[themes.<name>] sections in config.toml. Each section requires label (str). dark (bool) defaults to false if omitted — set to true for dark themes. All color fields are optional — omitted fields fall back to the built-in dark or light palette based on the dark flag./theme selector.Override built-in theme colors
To tweak a built-in theme’s colors without creating a new theme, use a[themes.<builtin-name>] section. Only color fields are read — label and dark are inherited from the built-in:[themes.*] sections take effect on /reload.Map themes to terminals
If you switch between terminals with different color schemes (for example, a dark iTerm and a light Apple Terminal), map each one to a theme under[ui.terminal_themes]. Deep Agents Code matches the shell’s TERM_PROGRAM and applies the mapped theme automatically:T in the /theme picker to save the highlighted theme for the current terminal, or run echo $TERM_PROGRAM to find your terminal’s identifier and add it by hand.Common TERM_PROGRAM values
| Terminal | TERM_PROGRAM |
|---|---|
| Apple Terminal | Apple_Terminal |
| iTerm2 | iTerm.app |
| WezTerm | WezTerm |
| VS Code integrated terminal | vscode |
| Ghostty | ghostty |
Theme resolution order
DEEPAGENTS_CODE_THEMEenvironment variable (explicit override).[ui.terminal_themes]mapping for the currentTERM_PROGRAM.[ui] themesaved preference (set by/theme).- The built-in default (
langchain).
Auto-update
Deep Agents Code automatically checks for and installs updates by default. To opt out of automatic updates:- Config file
- Environment variable
- Config file
- Environment variable
/update slash command, which runs an on-demand check and reports success or failure inline.
After an upgrade, Deep Agents Code shows a “what’s new” banner on the next launch with a link to the changelog.
At session exit, if a newer version was detected during the session, an update banner is displayed as a reminder.
Uninstall
To remove thedcode and deepagents-code binaries and the isolated tool environment, run:
~/.deepagents/, including config.toml, hooks.json, the global .env, and .state/ contents such as saved sessions and credentials. To delete that data as well, run:
Managed deployments
The install script supports running as root, targeting macOS MDM tools (Kandji, Jamf, etc.) that execute scripts in a minimal root environment. Whenid -u is 0, the script:
- Resolves the real console user’s
HOME(via/dev/consoleor a/Usersdirectory scan) chowns all created files back to the target user after each install step
Pin the install with environment variables
The install script reads environment variables that let you pin a version, select extras, and choose a Python version fleet-wide. Set them on the same line as the piped install:Exact package version to install, e.g.
0.1.0 (or a pre-release such as 0.1.0rc1). Mutually exclusive with DEEPAGENTS_CODE_PRERELEASE — setting both is an error, since an exact pin already selects a single version.uv pre-release strategy applied when resolving the latest version:
disallow, allow, if-necessary, explicit, or if-necessary-or-explicit. Mutually exclusive with DEEPAGENTS_CODE_VERSION.Comma-separated pip extras to install, e.g.
ollama, ollama,groq, or daytona. See pyproject.toml for the available extras.Python version to use for the install.
Set to
1 to skip optional tool checks.Set to
1 to show uv’s raw stderr (timing lines, unfiltered package diff) and the quiet-by-default status lines (optional-tool checks, post-install footer). Useful when debugging an install.Path to the uv binary. Auto-detected if unset.
DEEPAGENTS_CODE_AUTO_UPDATE=0 in the user’s shell profile or deploy a 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.
To route every user’s model traffic through a managed gateway (provisioning a gateway key and base URL fleet-wide), see Managed gateways.
Environment variable reference
All Deep Agents Code-specific environment variables use theDEEPAGENTS_CODE_ prefix. See DEEPAGENTS_CODE_ prefix for how the prefix also works as an override for third-party credentials.
Toggle automatic Deep Agents Code updates. Enabled by default; set to
0, false, no, or off to opt out.Enable verbose debug logging to a file. Accepts
1, true, yes, on (case-insensitive) as enabled; 0, false, no, off, empty string, or unset disables it. When enabled, the per-session server log file is preserved on shutdown and its path is printed to stderr for triage.Path for the debug log file.
Colon-separated paths added to the skill containment allowlist.
Override the LangSmith project name for Deep Agents Code’s own agent traces. Shell commands still run with the user’s original
LANGSMITH_PROJECT, so app, test, or script traces can appear in a separate project. See Trace with LangSmith.A second LangSmith project to also write agent traces to. When set and tracing is active, each agent run is dual-written to the primary project (from
DEEPAGENTS_CODE_LANGSMITH_PROJECT, or deepagents-code by default) and this project. Off by default. See Trace with LangSmith.Disable automatic update checking when set. This also prevents automatic update installs at startup.
Comma-separated shell commands to allow (or
recommended / all).Attach a user identifier to LangSmith trace metadata.
Run diagnostics with dcode doctor
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 the current runtime state.
Data locations
Deep Agents Code stores data in two directory hierarchies:~/.deepagents/— Deep Agents-specific data (agent memory, skills, sessions)~/.agents/— Tool-agnostic data (skills shared across AI CLI tools)
Directory structure
What goes where
| Data | Location | Read/Write | Notes |
|---|---|---|---|
| Sessions | ~/.deepagents/.state/sessions.db | R/W | SQLite checkpoint database |
| Input history | ~/.deepagents/.state/history.jsonl | R/W | JSON-lines, up/down arrow recall |
| ChatGPT OAuth token | ~/.deepagents/.state/chatgpt-auth.json | R/W | Backs the openai_codex provider; created when you sign in with ChatGPT and refreshed automatically. Readable only by your user account. |
| Base instructions | Package default_agent_prompt.md | R | Immutable, updated with Deep Agents Code upgrades |
| User customizations | ~/.deepagents/{agent}/AGENTS.md | R/W | Appended to base instructions |
| Project instructions | .deepagents/AGENTS.md or AGENTS.md | R | Both loaded if present |
| User skills | ~/.deepagents/{agent}/skills/ | R/W | Agent-specific skills |
| Shared skills | ~/.agents/skills/ | R | Tool-agnostic, cross-CLI |
| Project skills | .deepagents/skills/ or .agents/skills/ | R | Project-scoped |
| Custom subagents | ~/.deepagents/{agent}/agents/ | R/W | User-defined subagents |
| Project subagents | .deepagents/agents/ | R | Project-defined subagents |
Precedence rules
When the same item exists in multiple locations, higher precedence wins completely (no merging).Skills
Precedence order (lowest to highest):~/.deepagents/{agent}/skills/— User Deep Agents Code~/.agents/skills/— User tool-agnostic.deepagents/skills/— Project Deep Agents Code.agents/skills/— Project tool-agnostic (highest)
[skills].extra_allowed_dirs.
Subagents
Precedence order (lowest to highest):~/.deepagents/{agent}/agents/— User-level.deepagents/agents/— Project-level (highest)
AGENTS.md file with YAML frontmatter (name, description, optional model) and a markdown body for the system prompt. See Use subagents in Deep Agents Code for the full format reference.
Instructions
All instruction sources are combined (not overridden):- Package base prompt (always loaded)
~/.deepagents/{agent}/AGENTS.md(appended).deepagents/AGENTS.md(appended)AGENTS.mdat project root (appended)
.deepagents vs .agents
| Directory | Purpose | When to use |
|---|---|---|
.deepagents/ | Deep Agents Code-specific | Skills and config that use Deep Agents Code-specific features |
.agents/ | Tool-agnostic | Skills you want to share across different AI CLI tools |
Cleaning up
| Need | Action |
|---|---|
| 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 MCP project trust | rm ~/.deepagents/.state/mcp_trust.json |
| 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} |
See also
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

