Skip to main content
Deep Agents Code (dcode) is an open source coding agent built on the Deep Agents SDK. It works with any LLM that supports tool calling and allows you to switch LLMs between inputs. It retains persistent memory of learnings from conversations, maintains context across sessions, uses customizable skills, and executes code with approval controls.

Quickstart

Install and launch

OpenAI, Anthropic, and Google are installed by default. Other providers (Ollama, Groq, xAI, etc.) are available as optional extras—see Providers for details.
Deep Agents Code

Add provider credentials

Deep Agents Code works with any LLM that supports tool calling. Use the /auth command to set an API key for your chosen providers — see Provider credentials for the full flow and storage details.For additional providers and headless runs, see Providers.
Web search uses Tavily and is not configured through /auth. If you see “Web search disabled — TAVILY_API_KEY is not set” on startup, add TAVILY_API_KEY=tvly-... to ~/.deepagents/.env and run /reload (or restart). See Enable web search with Tavily.

Give the agent a task

The agent interprets the query and proposes changes with diffs for your approval before modifying files. If needed, it can run shell commands to test the code, check documentation, or search the web for up-to-date information.

Enable tracing (optional)

To log agent operations, tool calls, and decisions in LangSmith, add the following to ~/.deepagents/.env or export the variables in your shell:
~/.deepagents/.env
For more details and usage, see Trace with LangSmith.
Deep Agents Code is not officially supported on Windows. Windows users can try running it under Windows Subsystem for Linux (WSL).

Capabilities

Deep Agents Code has the following built-in capabilities:
  • File operations - read, write, and edit files with tools that enable agents to manage and modify code and documentation.
  • Shell execution - execute commands to run tests, build projects, manage dependencies, and interact with version control.
  • Remote sandboxes - run agent tools in LangSmith, Daytona, Modal, Runloop, or AgentCore instead of your local machine. The linked page covers provider installation, credentials, sandbox flags (--sandbox, --sandbox-id, --sandbox-setup), and setup scripts.
  • Web search - search the web for up-to-date information and documentation. Requires a Tavily API key in TAVILY_API_KEY.
  • HTTP requests - make HTTP requests to APIs and external services for data fetching and integration tasks.
  • Task planning and tracking - break down complex tasks into discrete steps and track progress.
  • Subagents - delegate work with the task tool. In Deep Agents Code, define custom subagents as AGENTS.md files; the linked page covers paths, frontmatter, and examples.
  • Memory storage and retrieval - store and retrieve information across sessions, enabling agents to remember project conventions and learned patterns.
  • Context compaction & offloading - summarize older conversation messages and offload originals to storage, freeing context window space during long sessions.
  • Human-in-the-loop - require human approval for sensitive tool operations.
  • Skills - extend agent capabilities with custom expertise and instructions.
  • MCP tools - load external tools from Model Context Protocol servers.
  • Tracing - trace agent operations in LangSmith for observability and debugging.

Built-in tools

The agent comes with the following built-in tools which are available without configuration:1: Potentially destructive operations require user approval before execution. To bypass human approval, you can toggle auto-approve (shift+tab) or start with the option:
When running Deep Agents Code non-interactively (via -n or piped stdin), shell execution is disabled by default even with -y/--auto-approve. Use -S/--shell-allow-list to allowlist specific commands (e.g., -S "pytest,git,make"), recommended for safe defaults, or all to permit any command. The DEEPAGENTS_CODE_SHELL_ALLOW_LIST environment variable is also supported. See Non-interactive mode and piping for more details.
2: Deep Agents Code automatically offloads the conversation in the background when token usage exceeds a model-aware threshold. Offloading summarizes older messages via the LLM, and ejects originals to storage (/conversation_history/{thread_id}.md), replacing them in context with the summary. The agent can still retrieve the full history from the offloaded file if needed. The compact_conversation tool lets the agent (or you) trigger offloading on demand. When called as a tool, it requires user approval by default.
Watch the demo video to see how Deep Agents Code works.

Command reference

All management subcommands support --json for machine-readable output. See command-line options for details.Destructive commands (agents reset, skills delete, threads delete) support --dry-run to preview what would happen without making changes. In JSON mode, --dry-run returns the same envelope with a dry_run: true field.

Configuration

For the full reference — including config.toml schema, provider parameters, profile overrides, and hook configuration — see Configuration. Deep Agents Code stores all configuration under ~/.deepagents/. Within that directory, each agent gets its own subdirectory (default: agent):

Interactive mode

Type naturally as you would in a chat interface. The agent will use its built-in tools, skills, and memory to help you with tasks.
Use these commands within a Deep Agents Code session:
  • /model - Switch models or open the interactive model selector.
  • /agents - Hot-swap between pre-configured agents without relaunching. See Command reference for details
  • /auth - Manage stored API keys for model providers. See Provider credentials for details
  • /remember [context] - Review conversation and update memory and skills. Optionally pass additional context
  • /skill:<name> [args] - Directly invoke a skill by name. The skill’s SKILL.md instructions are injected into the prompt along with any arguments you provide
  • /skill-creator [args] - Guide for creating effective agent skills
  • /offload (alias /compact) - Free up context window space by offloading messages to storage with a summary placeholder. The agent can retrieve the full history from the offloaded file if needed
  • /tokens - Display current context window token usage breakdown
  • /clear - Clear conversation history and start a new thread
  • /threads - Browse and resume previous conversation threads
  • /mcp - Show active MCP servers and tools
  • /reload - Re-read .env files, refresh configuration, and re-discover skills without restarting. Conversation state is preserved. See DEEPAGENTS_CODE_ prefix for override behavior
  • /theme - Open the interactive theme selector to switch color themes. Built-in themes are available plus any user-defined themes
  • /update - Check for and install Deep Agents Code updates inline. Detects your install method (uv, Homebrew, pip) and runs the appropriate upgrade command
  • /auto-update - Toggle automatic updates on or off
  • /trace - Open the current thread in LangSmith (requires LANGSMITH_API_KEY)
  • /editor - Open the current prompt in your external editor ($VISUAL / $EDITOR). See External editor
  • /changelog - Open Deep Agents Code changelog in your browser
  • /docs - Open the documentation in your browser
  • /feedback - Open the GitHub issues page to file a bug report or feature request
  • /version - Show installed deepagents-code and SDK versions
  • /help - Show help and available commands
  • /quit - Exit Deep Agents Code
Type ! to enter shell mode, then type your command.
General

Non-interactive mode and piping

Use -n to run a single task without launching the interactive UI:
You can also pipe input via stdin. When input is piped, Deep Agents Code automatically runs non-interactively:
When you combine piped input with -n or -m, the piped content appears first, followed by the text you pass to the flag.
The maximum piped input size is 10 MiB.
Shell execution is disabled by default in non-interactive mode. Use -S/--shell-allow-list to enable specific commands (e.g., -S "pytest,git,make"), recommended for safe defaults, or all to permit any command.
Long-running or misbehaving agents in CI/CD pipelines can loop indefinitely. --max-turns N gives operators a hard upper bound without having to touch SDK internals:
N must be a positive integer, and overrides the internal safety default that otherwise caps runaway loops. Exits with code 124 (matching GNU timeout) when the budget is exceeded, so CI can distinguish a budget hit from a generic failure. Requires -n or piped stdin; otherwise exits with code 2.For a time-based limit instead of (or in addition to) a turn-count limit, see Cap wall-clock time with --timeout.
--timeout SECONDS enforces a hard wall-clock limit on a non-interactive run. It complements --max-turns (turn count) with a time-based budget—whichever limit is hit first cancels the agent.
On expiry the agent is cancelled and the process exits with code 124, the same code used by --max-turns, so CI can treat both budget hits uniformly. Requires -n or piped stdin; otherwise exits with code 2.
Use -q for clean output suitable for piping into other commands, and --no-stream to buffer the full response (instead of streaming) before writing to stdout:
In non-interactive mode, the agent is instructed to make reasonable assumptions and proceed autonomously rather than ask clarifying questions. It also favors non-interactive command variants (e.g., npm init -y, apt-get install -y).
Use with caution.-S all (or --shell-allow-list all) lets the agent execute arbitrary shell commands with no human confirmation.

Trace with LangSmith

Enable LangSmith tracing to see agent operations, tool calls, and decisions in a LangSmith project. Add your tracing keys to ~/.deepagents/.env so tracing is enabled in every session without per-shell exports:
~/.deepagents/.env
To override for a specific project, add the same keys to a .env in the project directory. See environment variables for the full loading order. You can also set these as shell environment variables if you prefer. Shell exports always take precedence over .env values, so this is a good option for temporary overrides or testing:
When invoking Deep Agents Code programmatically from a LangChain application (e.g., as a subprocess in non-interactive mode), both your app and Deep Agents Code produce LangSmith traces. By default, these all land in the same project.To send Deep Agents Code traces to a dedicated project, set DEEPAGENTS_CODE_LANGSMITH_PROJECT:
~/.deepagents/.env
Then configure LANGSMITH_PROJECT for your parent application’s traces:
~/.deepagents/.env
This keeps your app-level observability clean while still capturing the agent’s internal execution in a separate project.You can also scope LangSmith credentials to Deep Agents Code using the DEEPAGENTS_CODE_ prefix (e.g., DEEPAGENTS_CODE_LANGSMITH_API_KEY).
When configured, Deep Agents Code displays a status line with a link to the LangSmith project. In supported terminals, click the link to open it directly. You can also use /trace to print the URL and open it in your browser.