DSCC
home / extending / agents

Agents

An agent is a named prompt + model preset that the main model can spawn as a subprocess-like worker via the Agent tool. DSCC discovers agent definitions from TOML files on disk.

Discovery paths

Resolved by discover_definition_roots at crates/commands/src/lib.rs:1265–1304. Roots are searched in order; the first source that defines a given lowercase name wins.

# Source Path
1 Project ancestors .codex/agents/, .dscc/agents/
2 $CODEX_HOME $CODEX_HOME/agents/
3 User home ~/.codex/agents/, ~/.dscc/agents/

Loader: load_agents_from_roots at commands/lib.rs:1418–1459. Files are parsed with parse_toml_string; the filename stem becomes the default name.

File format

TOML, one agent per file.

Field Required Type Purpose
name no (falls back to filename stem) string Display name
description no string One-line purpose
model no string Model id
model_reasoning_effort no string Reasoning budget hint

Minimal example

.dscc/agents/verify-branch.toml:

name = "verify-the-branch"
description = "Verify that the current branch builds, tests, and lints cleanly"
model = "claude-sonnet-4-6"

Listing and shadowing

How What it shows
/agents (slash) All discovered agents
dscc agents (CLI) Same list from the CLI

If two sources define the same lowercase name, the earlier source wins; the later is recorded in shadowed_by on the winning entry.

Subagent types

From tools.rs:1687–1766. The model picks one when it invokes the Agent tool via subagent_type. Each type has a curated tool allowlist.

Subagent type Typical use
Explore Read-only codebase scouting
Plan Draft an execution plan
Verification Run checks on completed work
dscc-guide Answer questions about DSCC itself
statusline-setup Configure the statusline
general-purpose (default) Broad tasks

Invocation

The model calls the Agent tool (tools.rs:394–406) with subagent_type and prompt. A background thread runs the subagent under DangerFullAccess permission.

On-disk run artifacts

Each run writes a JSON + Markdown pair to .dscc-agents/agent-<timestamp>.json / .md (tools.rs:408–423). The JSON carries agentId, name, subagentType, model, status, createdAt, completedAt, outputFile, manifestFile, error. These are written by the runtime; do not hand-edit.

Adding a new agent

  1. Create .dscc/agents/myagent.toml with at least description (see example above).
  2. Run /agents inside DSCC to confirm it appears. # [交互] (REPL slash command; the CLI equivalent dscc agents is scriptable and unmarked.)
  3. The model can now request it via the Agent tool.

See also