Skip to main content
Glama

code-dioxide

CI License: MIT Python 3.12+ MCP

code-dioxide (CO₂) is a local MCP server that runs delegated work as headless Claude Code sessions. A caller (a Claude Code session or a person) sends one delegate_task. dioxide then runs the whole feature loop as a Claude Code workflow script: plan, set up a git worktree, implement, review, QA, optional deploy, and merge. If the run needs a human decision, it waits, and the answer continues the same session and the same workflow run.

Task state is stored in SQLite. Every attempt (one launch of claude for a task) has its output kept on disk, so a crash, a rate limit or a server restart resumes the work in a new attempt instead of starting over. Everything that happened can be read through the API without shell access to the host.

Status: alpha (0.1.0). The background service is macOS only.

code-dioxide is an independent project, not affiliated with or endorsed by Anthropic. It runs Claude Code, which you install and log in to yourself.

How it works

  • Lifecycle tasks. A task whose agent resolves to lifecycle_agent (see roles.yaml) runs workflows/feature-lifecycle.js in one claude -p session. The parent session only calls the Workflow tool. Each stage is an agent with a structured output schema, and agents never delegate to each other.

  • Single tasks. Any other agent runs as claude -p --agent <slug> with the task brief.

  • Your config, not dioxide's. Permissions, models, effort, tools, skills, hooks, review focus and commit conventions come from your Claude Code settings, your agent files and the target repo's CLAUDE.md. The only permission dioxide adds is --allowedTools Workflow.

Stages of the lifecycle workflow:

Stage

Role

What it does

plan

planner

Steps, acceptance criteria, whether a deploy is needed. Skipped when a plan is pinned.

setup

none

Runs setup.sh: creates or reuses the task branch and worktree.

implement

implementer

Commits the change and its tests on the task branch.

review-r{n}-{reviewer}

each of reviewers, in parallel

Approves or returns findings; fix-r{n} (implementer) addresses them.

qa-r{n}

qa

Gate green or red; qa-fix-r{n} (implementer) on red.

deploy

deployer

Only when the plan says a deploy is needed and a deployer role exists.

merge

none

Runs merge.sh: merges the QA-approved head into the base branch.

Worktrees live outside the target repo, under <home>/worktrees/.

Related MCP server: codex-claude-bridge

Requirements

  • Python 3.12 or later.

  • Claude Code with the Workflow tool, logged in. Development and testing used Claude Code 2.1.328.

  • git. gh only for merge_strategy=pr.

  • macOS for dioxide service install (launchd). Linux is untested; use dioxide up there.

Quick start

git clone https://github.com/quieromas-ai/code-dioxide.git
cd code-dioxide
python3.12 -m venv .venv
.venv/bin/pip install .

.venv/bin/dioxide init               # home dir, example agents and roles, auth token
.venv/bin/dioxide service install    # launchd user agent; or run `dioxide up` in the foreground
.venv/bin/dioxide status             # is the server answering?
.venv/bin/dioxide register           # prints the `claude mcp add` command

dioxide init creates the home ($DIOXIDE_HOME, default ~/.code-dioxide) with agents/, data/ and logs/, copies the example agents and roles.yaml if they are missing, and writes a random token to <home>/.env (mode 0600). It prints the token the server will use, masked (a DIOXIDE_AUTH_TOKEN in the environment overrides the file). For a home other than the default, the commands that follow need DIOXIDE_HOME=<home> set; init prints it in its hint.

dioxide register prints a command of this form. Run it to add the server to Claude Code. It uses the user scope because the default (local) scope would make the server available in one project directory only:

claude mcp add --scope user --transport http dioxide http://127.0.0.1:8500/mcp \
  --header "Authorization: Bearer <token>"

The printed command contains the real token. Do not paste it anywhere public.

Then, from a Claude Code session, delegate work:

delegate_task(agent="coordinator",
              description="Add a --dry-run flag to the export command",
              input_context={"project_dir": "<path to a git repo>"})

In the example roles.yaml, lifecycle_agent is coordinator, so this runs the full lifecycle; delegating to any other agent runs it as a single task. Poll with check_task_status(task_id).

The MCP tools page lists every tool and how asks are answered.

Documentation

Topic

Page

Commands (init, up, service, logs, repair-usage, ...)

CLI

delegate_task and the other MCP tools; asks and answers

MCP tools and task lifecycle

DIOXIDE_* settings, orchestrator model, model fallback, roles.yaml

Configuration

Credentials for the sessions dioxide starts

Credentials

Guarantees, process policy, stall detection, known limits

Reliability

Auth, loopback trust, redaction and kill limits

Security model

Logs, debug bundles, reading a task remotely

Remote debugging

Read-only HTTP API for dashboards

Reporting API, reference

Building dashboards (Grafana, custom pages)

Dashboards

Upgrading and rolling back

Upgrade and rollback

Roadmap

Planned: Slack ask/continue, a cleanup hook with a cleaner agent, and custom workflows.

Contributing

Contributions are welcome. Please:

  1. Open a Discussion before starting significant work so we can agree on the approach.

  2. Follow the existing code style: ruff and mypy must pass with no new errors.

  3. Add or update tests for any changed behaviour.

  4. Keep PRs focused: one concern per PR.

See CONTRIBUTING.md for setup and SECURITY.md for reporting vulnerabilities.

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables orchestrators to drive Claude Code as a structured software-engineering worker over HTTP, with tools to submit coding tasks, poll for normalized results, resume, review, and cancel jobs.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Lets an agent delegate coding tasks and reviews to Claude Code, Codex or Grok Build CLIs running locally in isolated git worktrees, then poll an inbox for the status, question or final answer. Each caller sees only its own threads.
      7 npm
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables coding harnesses such as Claude Code, opencode, and Codex to hand tasks off to Perch AI as an autonomous worker and receive structured results with thread ids, model identity, and token usage. Supports asynchronous job tracking, thread continuation, and cancellation of long-running delegations.
      4
      MIT