Skip to main content

CoDD — Coherence-Driven Development

PyPI Python License Stars

日本語 | English | 中文

Write what you want. CoDD builds it from your requirements, keeps the docs and code in sync as things change, and runs the tests so they can't fake a "pass."


What is CoDD?

Picture a normal day on a real codebase:

  • You change one function — and three other places that quietly depended on it break, because nobody remembered they were connected.
  • The test suite goes green — but it never actually ran the code you just changed.
  • The design doc still describes how the feature worked last month.

On a large project — or on code an AI wrote for you — this kind of drift is everywhere, and "is everything still consistent?" becomes impossible to answer by hand.

CoDD turns that question into something a machine can answer.

It builds a map of how everything in your project connects — which requirement is implemented by which code, which code is covered by which test, which config value switches which behavior. Once CoDD has that map, it can do three things for you:

  1. Build — turn your requirements into design, code, and tests.
  2. Trace — when you change anything, show everything the change affects, so nothing breaks silently.
  3. Verify — run the real build and tests through a check that refuses to report a fake pass.
flowchart LR
    R["Requirements"] <--> D["Design"]
    D <--> C["Code"]
    C <--> T["Tests"]
    R -. "one connected map" .- T

The map works both ways: edit the code, and CoDD points to the design docs and requirements that are now out of date; add a requirement, and it points to the code and tests that need to change. That two-way consistency is the "Co" (coherence) in CoDD.

How is this different from Copilot or Cursor?

Those tools make the AI smarter. CoDD makes the AI's input smarter. It hands the AI the exact map of what a change touches — with evidence for each connection — instead of letting it guess from whatever files happen to be open. And CoDD's verification is built so it can't lie: an empty test suite, a build script that's secretly just true, a missing test report — all come back red, never a quiet green.


Install

pip install codd-dev          # needs Python 3.10+   ·   the command is `codd`
codd version                  # confirm the install

Prerequisites

  • Python 3.10+.
  • An AI CLI — used by the commands that generate or update design, code, and tests (greenfield, fix, generate, implement, brownfield, …). The default is claude --print; override it with --ai-cmd "<command>" or ai_command: in codd.yaml (e.g. to use Codex CLI).
  • No AI needed for the inspection commands (init, scan, check, doctor, measure, impact, validate, plan (show), contract verify, dag verify, lexicon, version, …) — they run as-is.

With the Claude CLI, a --tools list that omits ToolSearch loads every connected MCP server's tool definitions on each call. For an explicit empty list (--tools ""), CoDD adds --strict-mcp-config automatically unless --mcp-config or --strict-mcp-config is already present, which prevents that load.

A non-empty --tools list is left unchanged; codd doctor warns when such a list has neither ToolSearch nor one of the MCP flags above (default, the CLI's own default tool set, includes ToolSearch and is not reported). To use MCP tools on purpose, pass --mcp-config <file> explicitly. docs/ai-cli-context-overhead.md shows how much fixed context an AI CLI adds per call and how to measure it.


Quickstart (60 seconds, no AI)

Drop CoDD into an existing repo, build the connection map, and run the health check. Everything here works without an AI CLI and is copy-paste-ready.

pip install codd-dev

cd path/to/your-repo
codd init myproject --language python   # create the CoDD config (codd/codd.yaml)
codd scan                                # build the "connection map" from your code
codd check                               # health check — start here

codd check is the front door: it runs doctor (config diagnostics) → dag verify (connection completeness) → contract verify (artifact contract) in one shot. Drill into details with codd doctor, or see metrics with codd measure.

From here, pick the entry point that matches where you are — build from scratch, recover design from existing code, or fix something already shipping.


Three ways to start

1. Start a brand-new project — codd greenfield

Write what you want as a plain Markdown file, then let CoDD build the whole thing unattended (design → code → tests → verify, fixing problems as it goes):

codd greenfield --requirements docs/requirements/requirements.md \
                --project-name myapp --language python

It saves a checkpoint after every step, so codd greenfield --resume continues where it left off. Add --dry-run to preview the plan without calling the AI, or --ntfy-topic <topic> to get progress pings on your phone.

Language coverage today: unattended greenfield is empirically validated end-to-end on all six top languages — Python, TypeScript, JavaScript, Java, C++, and C# — from the same neutral requirements spec (a multi-module calculator library, 15–20 files). Validation is execution-based: each run's verifiable behaviors are cross-checked against the language's native test report (pytest / vitest / surefire / ctest / dotnet-trx), and a run that does not converge is stopped honestly rather than reported as a false pass. Repetition is not uniform — TypeScript and Python have ≥2-of-3 independent green runs; JavaScript, Java, C++, and C# have n≥1. This validates the pipeline's cross-language wiring and convergence machinery at library scale; it does not yet claim enterprise-scale complexity (the subject of a follow-on real-spec campaign).

The same one-command pipeline (codd greenfield --requirements FILE) also ships as three transparent, adaptable vehicles you can read and tweak: a shell script (examples/greenfield_autopilot.sh), a Claude Code workflow (examples/claude_workflows/codd-greenfield.js), and a skill (codd skills install codd-greenfield --target both).

2. Work on an existing codebase — codd init + codd scan

CoDD reads your existing code, works out the design behind it, and keeps the two in sync from then on:

codd init                 # set CoDD up in your repo
codd scan                 # build the connection map from your code
codd brownfield .         # recover design docs, compare them to reality, list the gaps

3. Already shipping? Just describe the change — codd fix

codd fix "the login error messages are confusing"

CoDD finds the design docs your request touches, updates them, then carries the change through design → code → tests → verify. It only edits the files the map says are involved, and if the final check fails, it rolls back exactly those files — nothing else.

With no argument, codd fix is a legacy mode that picks up your failing tests or CI and repairs them (codd fix --ci / --local / --dry-run).

Within one automatic repair session, the built-in LLM engine carries related prior hypotheses, actual applied changes, and verification results into the next attempt, for both Codex and Claude. Private records live under .codd/repair_history/ (owner-only and Git-ignored); prompts receive at most 16,000 characters of history excerpts, with truncation and unread originals identified. Missing observations—including model/token metadata an adapter does not expose—stay unknown. Existing retry limits and safety gates remain unchanged; this does not automatically switch to a larger model.


How it works — three jobs, one map

Job What it does Main commands
1. Build from intent Turns requirements into design options, then code and test scaffolding. The AI proposes; you choose (you stay in control). greenfield, plan, generate, implement, fix
2. Trace every change (the core) A connection map across requirements, design, code, config, data, and tests. Change one thing and CoDD shows the ripple — sorted into Green (safe to auto-fix), Amber (please review), Gray (just so you know) — with the reason for each link. scan, impact, propagate, diff
3. Verify for real Runs your actual build and tests so they can't fake a pass, and traces any failure back to the artifact that caused it. verify, check, coverage

These three feed each other in a loop: building decides what changes, tracing finds where it lands, verifying proves it holds — and every commit you make sharpens the map for next time. (Want the full story? See docs/explainer.md.)


Command map

The most-used commands, grouped by purpose. Run codd --help for the complete list and codd <command> --help for the details of any one.

Purpose Commands
Build greenfield (unattended) · plan (derive tasks) · generate (design/tests) · implement (code) · assemble (stitch fragments) · fix (from a phenomenon)
Trace scan (update the map) · impact (ripple of a diff) · propagate (code → design) · diff (implementation vs requirements) · watch (file changes) · drift (URL/design drift)
Verify verify (build + tests) · check (health — start here) · doctor (config diagnostics) · dag (completeness gate) · contract (artifact contract) · coverage (coverage gate) · measure (metrics) · policy (policy rules) · validate (frontmatter)
Elicit & shape elicit (find spec gaps) · lexicon (industry checklists) · brownfield (recover from code) · extract / require / restore (facts → design) · qc (evaluate criteria) · preflight (task pre-check)
Integrate & ship mcp-server (MCP) · skills (install skills) · hooks (Git hooks) · deploy (deploy) · e2e (E2E generation)

The Contract Kernel (introduced in v3.0)

Older CoDD had knowledge of specific languages and frameworks (Go, Python, Next.js…) baked into its core. v3.0 took all of that out of the core and moved it into swappable description files ("profiles") plus small adapters:

  • The core no longer knows any language or framework by name. It just reads the profiles. So adding support for a new language or framework is a new profile + adapter — no change to the core. Bundled profiles: Python / TypeScript / JavaScript / Java / C++ / C# / Go.
  • Frameworks compose. Next.js + TypeScript + Playwright + Prisma combine into one resolved description that codd verify runs against your project, live.
  • The "no fake green" rule belongs to the core. A profile can adjust settings, but it can never weaken the anti-fake-pass guarantee. (Proven end-to-end on a real Next.js app, on the actual toolchain, with deliberate breakages that each correctly come back red.)

In short: one core now serves Next.js, Django, FastAPI, Rails, Go services, and more — and anyone can add support without touching it.


Use it with your AI tools

  • MCP server — codd mcp-server exposes CoDD to any MCP client (such as Claude Code or Cursor) over stdio. Configure it in Claude Code with:
    "mcpServers": { "codd": { "command": "codd", "args": ["mcp-server"] } }
    
  • Skills for Claude Code & Codex CLI — codd skills install <name> --target both drops ready-made skills (e.g. the greenfield autopilot) into ~/.claude/skills/ and ~/.agents/skills/. Use codd skills list to see them and codd skills remove <name> to uninstall.
  • Codex App Server — route AI calls through a persistent connection instead of a fresh subprocess each time (codex_app_server.enabled: true in codd.yaml), with automatic fallback.

Hook Integration

CoDD ships ready-made hook recipes (under codd/hooks/recipes/) so coherence checks run automatically as you work:

  • Claude Code PostToolUse hook (claude_settings_example.json) — runs CoDD checks right after each file edit.
  • Git pre-commit hook (git_pre_commit.sh) — blocks a commit when it would break coherence. codd hooks install sets this up in one command.
  • Git post-commit hook (git_post_commit.sh) and a Codex CLI hook (codex_hook.sh) — keep the connection map fresh as you commit.
  • A requirements-nudge recipe (claude_requirements_nudge.json) — reminds you to re-run codd greenfield --resume when your requirements change (print-only; it never runs a pipeline on its own).

Copy the recipe you want from codd/hooks/recipes/ into your editor or Git config to turn it on.


Coverage lexicons

CoDD ships 39 ready-made "lexicons" — checklists drawn from real industry standards — that you can switch on so codd elicit finds the gaps in your spec. They span Web (WCAG, OWASP, Web Vitals), Mobile (HIG, Material 3, MASVS), Backend (REST, GraphQL, gRPC), Data (SQL, JSON Schema), Ops (Kubernetes, Terraform, DORA), Compliance (ISO 27001, HIPAA, PCI DSS, GDPR, EU AI Act), and more. List them with codd lexicon list and enable one with codd lexicon install <name>. Turn on the ones that fit; add your own without touching the core.


Acceptance evidence

What becomes visible. Every acceptance criterion in your requirement tables is reconciled against evidence a machine runs: codd verify now reports criteria bound to no test, evidence that asserts nothing or is skipped, runtime obligations in a project whose runtime stage is off, values retyped instead of read by name, and evidence that never runs through the entry point users actually reach. Findings are advisory (amber) by default — upgrading CoDD never turns your build red on its own — and they are never silent: each one names the criterion and what to do about it.

A switch is a declaration, not evidence. A criterion whose evidence is "the running system does X" is discharged by a runtime stage that RAN, not by one that is configured. Each codd verify --runtime writes <codd-dir>/runtime_ledger.json — what ran, whether it passed, and a digest of the runtime configuration it ran against — and the check reads that record: no record, a record written against a configuration you have since changed, a record older than acceptance_evidence.runtime_max_age_hours (unset by default), or a verified_by: runtime:<case> no check answered to, and the criterion is reported as runtime_evidence_not_executed and still bound to nothing. Commit the ledger like any other evidence artifact. This class stays amber even under mode: strict unless you set runtime_execution_severity: red: no record means unproven, not proven wrong.

Turning it into a gate. Put acceptance_evidence: {mode: strict} in codd.yaml (codd init writes it for new projects) and the same findings become red. Per-class overrides let you hard-fail one class while the rest stay advisory: acceptance_evidence: {unbound_severity: red}. Opt out entirely with acceptance_evidence: {enabled: false} — the findings disappear with it, which is the point of choosing.

Migrating an existing project. Run codd acceptance list to see what each criterion is bound to today, then codd acceptance sync to derive one verifiable-behavior row per criterion into docs/test/test_strategy.md (deterministic, no AI, append-only, safe to re-run). Write the tests those rows name, mark each with codd: covers vb=<id>, and add verified_by: test:<name> / params: <name>=<value> columns to the requirement table as you go. For a criterion only a person can check, codd acceptance record <ID> pass --by <owner> stores the verdict bound to the implementation it accepted — it expires when that implementation changes.

Known limits — what it does not catch, and who has to. These are boundaries of the mechanism, not bugs; a reviewer still has to look.

  • A test that asserts, but asserts nothing real. The check asks whether the test attached to a marker runs and asserts — never whether the assertion is meaningful. expect(true).toBe(true), or re-typing the criterion's own number on both sides (expect(15).toBe(15)), binds the criterion. Look at the assertions during code review; the check cannot.
  • Dependencies resolved at runtime. The shipped-path closure and the freshness hash both follow static imports (including barrel re-exports, await import(), require() and tsconfig path aliases). A computed specifier — require('../tools/' + name), import(`${dir}/x`) — is invisible to both: expect a false off_shipped_path (amber), and know that changing such a dependency does not expire a manual record. Check those by hand when a criterion depends on one.
  • A marker attaches to the test written under it. Not to the file. A codd: covers vb= line above a skipped test proves nothing even if the file's other tests pass.

FAQ & troubleshooting

Q. codd: command not found. A. pip's script directory isn't on your PATH. If you used pip install --user, add ~/.local/bin to PATH. As a quick workaround, python -m codd ... does the same thing.

Q. Which AI CLI do I need? A. The default is claude --print. Override it with --ai-cmd "<command>" or ai_command: in codd.yaml (e.g. Codex CLI). Commands like init, scan, check, doctor, and measure need no AI at all.

Q. greenfield stopped or failed partway. A. Run codd greenfield --resume to continue from the last successful step (the checkpoint lives in .codd/greenfield_session.yaml).

Q. codd check shows mostly SKIP or "vacuous." A. That's expected on a fresh project with no design docs or tests yet. As you run scan → generate/implement, the checks that read real data light up one by one.

Q. Where does the config live? A. By default codd/codd.yaml. If your source directory is already codd/, use codd init --config-dir .codd to place it under .codd/ instead.

Q. verify fails even though everything looks green. A. That's anti-false-green at work. An empty test suite, a build that's secretly just true, or a missing test report is deliberately turned red. Check that your tests actually exercise the code.

Q. How do I add a new language or framework? A. Add a profile (plus a small adapter) — the core stays untouched (that's the Contract Kernel). Bundled profiles: Python / TypeScript / JavaScript / Java / C++ / C# / Go.

Q. How do I upgrade or uninstall? A. Upgrade with pip install -U codd-dev; uninstall with pip uninstall codd-dev.


Documentation

  • docs/explainer.en.md — the full idea, from the connection map to AI-driven development (日本語 · 简体中文)
  • docs/positioning.md — where CoDD sits vs Spec Kit / coding agents / Copilot, on the false-green axis
  • CHANGELOG.md — every release
  • codd --help — the full command reference (in any project, codd check is the best place to start)
  • docs/ — architecture notes, setup guides, and a cookbook

Contributing

Issues, pull requests, and lexicon proposals are all welcome — see Issues. CoDD is maintained by @yohey-w, with thanks to everyone who reported the bugs and ideas that shaped it.


MIT — see LICENSE.

Metadata

Release files for codd-dev 3.45.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codd-dev 3.45.1
File Size Uploaded Provenance Actions
codd_dev-3.45.1.tar.gz 2.0 MB Without provenance Details for codd_dev-3.45.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codd-dev 3.45.1
File Interpreter ABI Platform Actions
codd_dev-3.45.1-py3-none-any.whl Python 3 none any Details for codd_dev-3.45.1-py3-none-any.whl

Total release size: 4.3 MB

Release files / codd_dev-3.45.1.tar.gz

Download URL codd_dev-3.45.1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
e4d0a590a0fdef981b9715f838d55f8a049e740915dab127a91732bab2f5c13e
BLAKE2b-256 checksum
How to use checksums
7215a127d000d0e74ce2875f9ba2115afdd7d1de1e34ce6661b39319f6527536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / codd_dev-3.45.1-py3-none-any.whl

Download URL codd_dev-3.45.1-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7870de235eb18531ac6c05449c56f155fcf6853170d8954bd30f03eab959f9e2
BLAKE2b-256 checksum
How to use checksums
24a65ab29064a66f15042e03bdef7eb7df748d1ff1c9a4fd97a7a20300f9a1ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for codd-dev 3.45.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.45.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page