Skip to main content

Quickstart

Deep Agents Code (dcode) is a terminal coding agent built on the Deep Agents SDK. This guide covers installation, your first task, daily interactive use, automation with piping, and LangSmith tracing. For a feature overview, see Deep Agents Code overview. For config.toml and provider settings, see Configuration.

Install and run your first task

  1. Install and launch

    curl -LsSf https://langch.in/dcode | bash
  2. Add provider credentials

    Deep Agents Code works with any tool-calling LLM. OpenAI, Anthropic, and Google are available out of the box.

    Use the /auth command to connect with a provider. See Providers for the full list and credential details.

    Note

    Web search uses Tavily. Add a key with /auth. See Enable web search.

  3. Give the agent a task

    Create a Python script that prints "Hello, World!"

    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.

  4. Enable tracing (optional)

    To log agent operations, tool calls, and decisions in LangSmith, run /auth and add your LangSmith API key. Tracing is enabled on the next launch.

    For choosing an agent environment, advanced options, and CI or headless setup, see Trace with LangSmith.

Note

Deep Agents Code is not officially supported on Windows. Windows users can try running it under Windows Subsystem for Linux (WSL).

Interactive mode

Type naturally as you would in a chat interface. The agent uses its built-in tools, skills, and memory to help you with tasks.

Slash commands

Shell commands

Keyboard shortcuts

Inspect context-window usage

Run /context to open a color-coded report of the current model's context-window usage. The report shows the model's context limit, used tokens, remaining capacity, and a breakdown between the conversation and system prompt plus tools when those values are available.

Provider-reported totals remain distinct from local conversation estimates. When a provider total is unavailable, the report labels the conversation count as an estimate and marks the total usage as unavailable. Use /tokens when you want a text summary in the conversation transcript instead.

When usage grows faster than expected, run /context-doctor to attribute tokens to each injected component: the base system prompt, memory files, the skills index, built-in tool schemas, and MCP tool schemas. To confirm which tools the agent can currently call, run /tools. For the thread's running cost estimate, run /cost; the same figure appears in the status bar. See Diagnose and audit a session.

External editor

Press Ctrl+G or type /editor to compose prompts in an external editor. Deep Agents Code checks $VISUAL, then $EDITOR, then falls back to vi (macOS/Linux) or notepad (Windows). GUI editors (VS Code, Cursor, Zed, etc.) automatically receive a --wait flag so Deep Agents Code blocks until you close the file.

# Set in your shell profile (~/.zshrc, ~/.bashrc, etc.)
export VISUAL="code"    # GUI editor (--wait auto-injected)
export EDITOR="nvim"    # Terminal fallback

Non-interactive mode and piping

Use -n to run a single task without launching the interactive UI:

dcode -n "Write a Python script that prints hello world"

Each non-interactive run starts a fresh thread—conversation history does not carry between invocations. File-based state (memory, skills, configuration) persists.

You can also pipe input via stdin. When input is piped, Deep Agents Code automatically runs non-interactively:

echo "Explain this code" | dcode
cat error.log | dcode -n "What's causing this error?"
git diff | dcode -n "Review these changes"
git diff | dcode --skill code-review -n 'summarize changes'

When you combine piped input with -n or -m, the piped content appears first, followed by the text you pass to the flag.

Note

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.

Cap turn count

Cap wall-clock time

Clean output and buffering

Shell execution examples

Warning

Use with caution.

-S all (or --shell-allow-list all) lets the agent execute arbitrary shell commands with no human confirmation.

Trace with LangSmith

Note

This integration uses a legacy destination setting such as project_name or LANGSMITH_PROJECT. Create an agent, choose its environment, and retrieve that environment's tracer_session_name. Use that returned value in the destination setting and any overrides. For integrations that support agent addressing, use the agent identifier and environment directly.

Enable LangSmith tracing to see agent operations, tool calls, and decisions in a LangSmith agent environment.

Run /auth and add your LangSmith API key. Tracing is enabled on the next launch and persists across sessions. See Provider credentials for details on the credential manager.

To select the agent environment or configure tracing without the TUI, add keys to ~/.deepagents/.env so tracing is enabled in every session without per-shell exports:

~/.deepagents/.env
LANGSMITH_TRACING=true
LANGSMITH_API_KEY=lsv2_...
DEEPAGENTS_CODE_LANGSMITH_PROJECT="<coding-agent-tracer-session-name>"

Set DEEPAGENTS_CODE_LANGSMITH_PROJECT to the coding agent environment's tracer_session_name. This setting controls Deep Agents Code's own traces. A separate LANGSMITH_PROJECT in your repository's .env controls traces from code run in shell commands. See Separate coding-agent traces from shell-command traces below.

To override the destination for a specific working directory, add DEEPAGENTS_CODE_LANGSMITH_PROJECT to a .env in that directory. See environment variables for the full loading order.

Disable agent tracing

Separate coding-agent traces from shell-command traces

Copy traces to a second agent environment

When configured, Deep Agents Code displays a status line with a link to its trace destination in LangSmith. 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.

✓ LangSmith tracing: '<coding-agent-tracer-session-name>'

Tip

We recommend you also set up LangSmith Engine, which monitors your traces, detects issues, and proposes fixes.

See also