DM-Code-Agent

A local-first, fully auditable Python coding agent whose runs you can replay, diff, fork and reproduce.

Stars
★ 153
Last updated
2mo ago
FARS reviewed
Oct 30, 2026
License
MIT
Primary language
Python

At a glance

How it runs
CLIWeb app
Works with
Universal · cross-platformOpenAI API · Claude API
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Python 3.10+uv or pipAt least one LLM API key (DeepSeek / OpenAI / Claude / Gemini)Shell / CLINetwork accessLocal filesystemMCP Server
Typical use
Researchers debugging agent behaviour who need to see which stage failed, whether a replan recovered it, and whether verification was skipped.
Not a fit if
  • Teams that must run untrusted code in an isolated sandbox
  • Users who want a zero-setup hosted UI instead of a local install
  • Chat-only workflows that never need to run tests or shell commands
Maintenance
Commits in the last 6 monthslast commit 2026-08-27

What does this agent do, and when should you use it?

DM-Code-Agent is a Python code agent that reads and writes files in your local workspace, runs tests and lint, and calls MCP tools, with a single ReAct loop at its core and everything else attached as lifecycle hooks. Every plan step, tool call and observation is written to an append-only JSONL session tree where each entry carries an id and parent_id; context folding appends a derived record instead of deleting the original text. The CLI ships dm-agent, dm-agent-eval, dm-agent-bench, dm-agent-trace, dm-agent-economics and dm-agent-manifest-diff, plus a dm-agent-web console that spawns a CLI subprocess so the browser and the terminal perform the same operation. Model clients for deepseek, openai, claude and gemini are built in, and custom providers can be registered. Evaluation is bundled: a 30-task hidden-test benchmark (15 coding, 15 maintenance) and a separate SWE-bench Verified subsystem measured with the official SWE-bench 4.1.0 harness (21/50 resolved, final error=0), with negative results published. Defaults follow a stated rule of guardrails on, behavioural algorithms off: read-before-edit, atomic writes with backup, observation truncation and token-budget folding are enabled, while Adaptive Replanning and similar modules require explicit flags.

Running dm-agent "<task>" --trace sessions/fix.jsonl --show-steps enters the ReAct loop: plan, parse the model response with response_parser, dispatch tools through tool_invoker, and pass a completion gate before delivery. The tool layer holds 17 built-in tools plus dynamically loaded MCP tools that read and write files, run tests and lint, and execute shell commands; a read-before-edit guard forces a read before any edit, and writes are atomic with automatic backup. Context folding runs locally and deterministically (Mem0-style atomic memory) and only commits when estimated_tokens_after < estimated_tokens_before, otherwise the candidate is rolled back together with memory, cadence and summary state. Afterwards dm-agent-trace view shows the timeline, analyze reports failure stage, replan recovery, verification gaps and a health score, diff compares two runs, fork --at <id> re-runs from any entry, replay re-executes tool calls, and analyze-dir aggregates a folder. dm-agent-bench runs the 30-task suite and dm-agent-score-diff reports per-task pass/fail flips rather than a single total. dm-agent-web exposes four audit views (session library, run detail, diagnostics, behaviour diff); --read-only needs no API key and can be statically hosted. Extensions are written as a module exporting setup(api) with register_tool, register_skill, register_provider and on, hooking before_tool_call, after_tool_result, before_llm_request, before_finish, on_run_start and on_run_end. Layer boundaries (clients → tools → tracing → core → extensions → cli) are enforced in CI by ruff TID251.

  1. Researchers debugging agent behaviour who need to see which stage failed, whether a replan recovered it, and whether verification was skipped.
  2. Engineers comparing two versions of a prompt or tool: dm-agent-trace diff shows the entry where the runs diverge.
  3. Teams adding a safety guard: drop in a Python file exporting setup(api) and block dangerous shell commands in before_tool_call without touching core code.
  4. Ablation work: behavioural modules are off by default, so you enable one flag at a time while the unfolded originals stay in the log for re-verification.
  5. Maintainers validating changes in CI with no network spend: pytest, deterministic evals and manifest checks run without an API key.
  6. Project leads who want a conversational workbench and an audit console in one place, including a read-only gallery that runs without a key.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • pip install -e ".[dev]"
Config files
.env.example .env bench_reports/after.json bench_reports/before.json
Runtime
Python 3.10+

How do you install or deploy this agent?

Requires Python 3.10+ and either uv or pip. Clone and install with dev extras:

bash

git clone https://github.com/hwfengcs/DM-Code-Agent.git && cd DM-Code-Agent
uv sync --frozen --extra dev

Or with pip:

bash

pip install -e ".[dev]"

Create the environment file and fill in at least one model API key:

bash

cp .env.example .env

Verify the install without spending anything — tests and deterministic evals need no key:

bash

python -m pytest && python -m dm_agent.evals.cli --variant full --task direct_finish

How do you use this agent?

Run a task and keep an auditable session log:

bash

dm-agent "fix the retry boundary in retry.py and run the tests" --trace sessions/fix.jsonl --show-steps

Diagnose that run immediately:

bash

dm-agent-trace analyze sessions/fix.jsonl

Replay, compare, or fork from a specific entry:

bash

dm-agent-trace view sessions/fix.jsonl
dm-agent-trace diff a.jsonl b.jsonl
dm-agent-trace fork sessions/fix.jsonl --at 4f4bdeee-0007
dm-agent-trace replay sessions/fix.jsonl

Open the browser console (the terminal prints a tokenized URL):

bash

dm-agent-web --read-only     # audit-only gallery, no API key needed
dm-agent-web                 # full workbench: multi-turn chat + SSE step stream

Score the bundled benchmark and diff two reports:

bash

dm-agent-bench --suite all --provider deepseek --output bench_reports/after.json
dm-agent-score-diff bench_reports/before.json bench_reports/after.json

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

External MCP tool bridge

Inherits capabilities of connected MCP servers; audit third-party servers before enabling.

What are this agent's strengths and limitations?

Pros
  • Context folding is guarded by a net-benefit check: it commits only when estimated_tokens_after < before, rolls back the whole candidate on a loss, and never deletes original entries.
  • The session log is an id/parent_id entry tree with view, analyze, diff, fork, replay and analyze-dir commands, so any run can be re-executed from an arbitrary step.
  • Extensions are concrete: register_tool, register_skill, register_provider and on, six interceptable hooks, five discovery tiers, and an explicit trust gate for project-local extensions.
  • Audit output is machine-readable beyond a success flag: analyze surfaces verification_gap, edit_without_read, guard_blocks and truncations with a health score.
  • Verification is broad and offline-capable: 554 passed / 1 skipped unit tests, 14 tasks × 4 variants of deterministic evals, vitest for frontend helpers, a 6-cell Ubuntu+Windows × Python 3.10/3.11/3.12 CI matrix, and layer contracts enforced by ruff TID251.
  • Reporting is conservative: no unmeasured score claims, the non-working SWE-bench Lite subsystem was removed with the reason published, and the 20-task result is stated to be a strict prefix of the 50-task run.
Limitations
  • Real tasks require your own LLM API key and per-token spend; the software is free but no hosted quota is offered.
  • Integration is CLI-shaped: the documented paths are the dm-agent commands and a spawned subprocess, with no stable library-level API for embedding ReactAgent.
  • The published cross-repo SWE-bench Verified result (21/50) comes from one deepseek configuration and does not transfer to other providers without re-running.
  • There is no Docker or sandbox layer; the agent reads, writes and executes shell in your own workspace, so protection depends on hooks you write yourself.
  • The bundled benchmark is 30 tasks, so one flip is ±3.3 percentage points and the repeat-3 noise floor is roughly ±5 tasks — coarse for small deltas.
  • v2.1 removed six default-off modules (Reflexion, Critic, Self-Consistency, breaker, memory hygiene, LLM compaction) and cut CLI flags from 35 to 23, so setups relying on them must migrate to external extensions.

How does this agent compare with similar options?

The README benchmarks the project against Aider, OpenHands, SWE-agent and smolagents. The concrete deltas it claims: session logs (JSONL entry tree with dry/tool replay, diff and fork, versus git diff in Aider, server log in OpenHands, trajectory in SWE-agent); an extension system with six interceptable lifecycle hooks (Aider and SWE-agent have no plugin path, OpenHands has plugins with partial hook coverage); non-destructive context folding where originals survive and can be recomputed offline (partial in OpenHands, weak in smolagents); a visual audit console (DM-Code-Agent and OpenHands ship full web UIs, Aider has a chat GUI); MCP integration (DM-Code-Agent and OpenHands yes, the others no); and a bundled hidden-test benchmark (only DM-Code-Agent offers a 30-task scored suite, while SWE-agent targets SWE-bench). Licensing: MIT here and for OpenHands and SWE-agent, Apache-2.0 for Aider and smolagents.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
DM-Code-Agent This agent 54 · Major gaps CLIFree + model costs ★ 153 2mo ago Python OpenAI API · Claude API
Hello-Agents 53 · Major gaps Web appFree + model costs ★ 88k 10d ago Python OpenAI API
Beacon 79 · Good CLIFreemium ★ 3.6k today Go Codex · Claude Code
AgentLoom 69 · Some gaps — ★ 168 10d ago Python OpenAI API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
54/ 100 5-point scale 2.7 / 5
Trust 13/29
Reliability 9/14
Adaptability 10/18
Convention 11/18
Effectiveness 7/13
Verifiability 4/8
Why each dimension lost points
Trust13 / 29 · 2.2/5

least_privilege: SECURITY.md explicitly states this is not a sandbox and can execute local files/Python/shell/MCP tools; permission boundaries rely on user isolation, so points deducted. user_confirmation: README mentions a before_tool_call hook can intercept dangerous operations and project-local extensions require explicit trust, but the default execution path shows no per-step confirmation, relying only on an optional hook, which is weak. data_flow_transparency: getting-started states the API key is read only from environment variables and not written to traces, and traces exclude full prompts and raw outputs by default, so transparency is good. sensitive_data_handling: there is a .env lookup order, BOM handling, and a conftest mechanism blocking real keys, but no details on mandatory redaction of sensitive content in traces, scored 2. dependency_security: dependencies have version upper bounds but openai/anthropic/google-genai have none, requirements.txt and pyproject are not fully consistent, and no vulnerability scanning or SBOM is present, points deducted. external_effects: the agent writes files, runs shell, and runs tests; despite atomic writes and backups, external side effects are broad and enabled by default, scored 1. rollback: atomic writes plus automatic backups, checkpoint/resume, fork re-runs, and collapse rollback are all described and test-supported, scored 2. source_attribution: README references devlog and bench_reports paths, but publisher identity is unverified and the author is only hwfengcs, so attribution evidence is limited.

Reliability9 / 14 · 3.2/5

self_consistency: README and pyproject version 2.0.0 agree, but README repeatedly says v2.1 while pyproject remains 2.0.0, a version inconsistency, points deducted. dependency_availability: pyproject and requirements.txt both list dependencies, web is an optional extra, and CI uses uv.lock --frozen, so availability is good; but the two dependency lists are not fully in sync. failure_messages: devlog 32 specifically fixed the missing-key error not including the path and improved the specific error message, with test coverage, scored 2.

Adaptability10 / 18 · 2.8/5

audience_and_scenarios: aimed at developers; README and getting-started cover CLI, Web, benchmark, and extension scenarios, scored 2. capability_boundaries: SECURITY.md clearly states non-sandbox and only main branch support, and README notes the non-working SWE-bench Lite was removed, so boundaries are clear. trigger_precision: the CLI has seven entry points and many switches, but there is no precise description of trigger conditions, and the five-level extension discovery priority is described coarsely, scored 1. environment_fit: CI covers Ubuntu+Windows x 3.10/3.11/3.12 and handles Windows BOM, USERPROFILE, etc., so environment fit is good.

Convention11 / 18 · 3.1/5

information_architecture: docs/ has navigation, six common documents, and 43 research-log entries, clearly structured. install_notes: getting-started gives pip/uv/venv installation methods and .env configuration in detail. naming_stability: seven console scripts have stable names, clearly defined in pyproject. examples_and_faq: there is examples/block_dangerous_shell.py and a known-pitfalls section, but the FAQ is not systematic. known_limitations: README explicitly avoids score inflation and lists removed modules and frozen evaluations, so limitations are transparent. license: the MIT LICENSE file is complete and the pyproject license field matches, scored 3. versioning_changelog: there is a research-log but no formal CHANGELOG, and the version number differs between README and pyproject, scored 1. maintenance_responsibility: the publisher is unverified, only main branch is supported, and maintenance responsibility is unclear, scored 1.

Effectiveness7 / 13 · 2.7/5

output_usability: trace view/analyze/diff/fork outputs are structured and benchmark output shows per-question flips, so usability is good. marginal_value: local-first plus auditable traces plus an extension system differentiate it from peers, but the core is still a ReAct loop, so marginal value is moderate. cost_benefit: an API key is needed to call the LLM, and the 30-question benchmark and 50-question SWE-bench are not cheap, with no cost quantification, scored 1.

Verifiability4 / 8 · 2.5/5

claim_traceability: README claims such as 554 passed and SWE-bench 21/50 point to specific files and devlogs, so traceability is good, but static review cannot verify the numbers. cross_source_corroboration: README, devlog, and CI configuration corroborate some claims, but key numbers such as test counts have a single source, scored 1. fact_inference_separation: README clearly distinguishes measured from unmeasured and notes the 13-question baseline is not comparable to the 30-question one, so facts and inferences are well separated.

Risks and how to mitigate them
  • SECURITY.md explicitly states this is not a sandbox and can execute shell and write files; use only in isolated workspaces, never on sensitive repositories.
  • Publisher identity is unverified; review source and dependencies before installing the pip package.
  • README repeatedly references v2.1 while pyproject version is 2.0.0, an inconsistency that undermines reproducibility claims.
  • requirements.txt and pyproject.toml dependency lists diverge, and some SDKs lack upper bounds, risking dependency drift.
  • Benchmark and SWE-bench scores are self-reported; static review cannot independently reproduce them, so do not rely on them alone for selection.
Evidence confidence: Low Reviewed Oct 30, 2026 Reviewed revision e4530be37e6f
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/dm-code-agent.svg)](https://followagents.com/en/agents/dm-code-agent)
<a href="https://followagents.com/en/agents/dm-code-agent"><img src="https://followagents.com/badge/dm-code-agent.svg" alt="FARS review"></a>

FAQ

How far can I get without an API key?
Unit tests (554 passed, 1 skipped), the deterministic evals (14 tasks × 4 variants driven by a scripted client, no network calls) and the benchmark manifest checks all run keyless, and dm-agent-web --read-only is an audit-only gallery that needs no key. The ReAct loop for real tasks requires at least one configured provider key.
What can it actually touch on my machine?
It works directly in your local workspace: reading and writing files, running tests and lint, and executing shell commands, with no Docker sandbox. Guardrails that are on by default include read-before-edit, atomic writes with automatic backup, observation truncation and token-budget folding. To block operations like rm -rf, return {block, reason} from a before_tool_call hook; examples/block_dangerous_shell.py is a 25-line runnable example. Project-local extensions load only after explicit trust.
Can I point it at my own model provider?
Four clients ship in-tree (deepseek, openai, claude, gemini), and register_provider lets an extension add others. Keep in mind the published SWE-bench Verified numbers were produced with deepseek, so a different provider needs its own dm-agent-bench run before you quote results.
Does folding the context lose history, and where does the log live?
The log is a local append-only JSONL entry tree with privacy tiers, and folding only appends a derived record — no original entry is deleted — so replay, diff and fork still work on the full history. A read-only web build plus its session JSONL can be dropped onto any static host with no backend and no key.
How do I tell whether a change improved anything?
Run dm-agent-bench on the bundled 30 tasks (15 coding, 15 maintenance, hidden tests for pass/fail, no Docker or HuggingFace dependency), then dm-agent-score-diff the two reports. It lists per-task pass/fail flips so regressions show up even when the total rises; at 30 tasks one flip is ±3.3 points and the empirical repeat-3 noise floor is about ±5 tasks.
Is DM-Code-Agent free?
The software is free, but DM-Code-Agent calls an AI model, and you pay that model provider for usage (or run a local model).
Is DM-Code-Agent open source?
Yes. The source code is on GitHub (hwfengcs/DM-Code-Agent) under the MIT licence.
Is DM-Code-Agent safe to use?
FollowAgents' FARS review (Oct 30, 2026) scored DM-Code-Agent 13/29 on trust and safety. None of the eight safety controls the review checks for was missing outright.
Is DM-Code-Agent still maintained?
Development has slowed: the latest commit on GitHub is from 2026-08-27, within the last six months but not the last 30 days.
Who makes DM-Code-Agent?
DM-Code-Agent is published on GitHub by the account hwfengcs. FollowAgents has not verified which person or company is behind that account.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts