Codeledger

io.github.codeledgerECFPublished by GitHub account codeledgerECFv0.10.82Updated Oct 30, 2026

Local context and engineering evidence for AI coding agents.

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Local MCP server that gives coding agents task-scoped repo context, activation scope contracts, prompt validation and evidence recording.

What you can do
  • Search the repo's context ledger for golden patterns and episodes relevant to a task
  • Read the active task context, its provenance and readiness signals, and the runtime activation payload defining allowed tools, files and domains
  • Record execution outcomes into an evidence buffer that compounds into repo memory
  • Validate a task prompt against prompt-engineering best practices and return a scored report with findings and fixes
  • Run agent quality checks and read a persisted unified PR judgment artifact
  • Fetch a full context cockpit snapshot of the active bundle, annotations and certification
When to use it
Useful when you want an AI coding agent to start from a bounded, task-relevant set of files instead of the whole repository, and to keep work inside an explicit scope contract with recorded evidence. Aimed at teams using CLI or MCP-compatible coding agents on an initialized repository.
Requirements
Runs as a local stdio process from the npm package @codeledger/cli (Node.js), started with codeledger mcp start. The repository must be initialized with codeledger ready; until then tool calls return not_evaluable. Tool calls other than get_activation_payload require an active Team or Enterprise license. No account is needed for the local CLI flow.
Before you install
Most tools are locked without a paid Team or Enterprise license, so the free surface is limited to get_activation_payload. Installing or updating may fetch packages and release artifacts from npm and GitHub Releases. The scoring engine and selection algorithm are a protected runtime under a separate license. Tools write context bundles and evidence into the repository, and record_interaction feeds outcomes into repo memory.

Installation

In SourceWeft

  1. Open Codeledger in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

CodeLedger

Give AI coding agents the right repo context before they start - then verify what changed.

CodeLedger is local-first context control for AI coding agents. It scans a repository, selects a bounded task-relevant set of files, and writes an evidence-backed context bundle before the agent begins work.

Works with Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and other CLI or MCP-compatible coding agents.

Try It

bash
npm install -g @codeledger/clicd your-projectcodeledger ready --task "Fix null handling in user service"

CodeLedger initializes the repo if needed, refreshes the index, and creates the task-specific bundle at .codeledger/active-bundle.md. Your agent reads that artifact first so it starts with the files most relevant to the task.

Runtime analysis is local by default. Installing or updating may fetch packages or release artifacts from npm and GitHub Releases; CodeLedger runtime analysis does not send your source code through CodeLedger telemetry by default.

[CodeLedger task flow]

Example Benchmark

Example result from a mid-sized Node.js service. Results vary by repository, task, agent, and scenario.

MetricWithout CodeLedgerWith CodeLedgerChange
Tests Passed78%94%+16%
Iterations42-50%
Files Changed179-47%
Time to Finish6m 12s3m 40s-41%
Token Usage28k18k-36%

Do not take the benchmark on faith - measure CodeLedger on your own repo:

bash
codeledger compare \  --scenario .codeledger/harness/scenarios/auth-rate-limit.json \  --guided

If CodeLedger improves your coding-agent workflow, star the repo to follow releases and help other developers discover it.

Start Here

How It Works

  1. CodeLedger scans the repo for deterministic local signals such as dependency structure, churn, tests, contracts, and task keywords.
  2. It ranks and packs a bounded set of task-relevant files.
  3. It writes .codeledger/active-bundle.md for your coding agent.
  4. After work, verification, receipts, and session summaries help show what changed and whether the selected context was useful.

Same task plus same repo state produces the same file ranking behavior.

Core Capabilities

  • Give agents the right context: deterministic file selection, scope inference, bounded budgets, blast-radius hints, and co-change context.
  • Keep work continuous: session summaries, checkpoints, mid-session refine, and handoff/recovery commands.
  • Keep agents inside the task: scope contracts, intent governance, loop detection, and multi-agent conflict checks.
  • Prove what happened: review intelligence, receipts, provenance, audit exports, and release evidence.

For the full command surface, see the CLI Reference.

Agent Integration

Claude Code can use CodeLedger hooks after codeledger ready initializes the repo. Cursor, Codex, GitHub Copilot, Gemini CLI, Aider, Windsurf, and other agents can read CLAUDE.md plus .codeledger/active-bundle.md, or use the repo-local wrappers when available.

CodeLedger also includes an MCP server for supported tiers:

bash
codeledger mcp startcodeledger mcp status

See MCP Server and Feature Tiers for setup and tier details.

Trust And Verification

  • Runtime source analysis runs locally by default.
  • Source code is not sent through CodeLedger telemetry by default.
  • No account is required for the local CLI flow.
  • Public releases include SHA256SUMS and release-evidence artifacts.
  • codeledger doctor checks the local install, hooks, config, index, and ledger health.
  • The public wrapper, docs, harness, and scanning surface are inspectable in this repo; the protected hardened runtime is covered by LICENSE-CORE.

Install

bash
npm install -g @codeledger/clicodeledger --version

Or use the release zip:

  1. Download the latest release.
  2. Extract it.
  3. Run install.sh.

The installer uses the bundled package from the zip, so the installed wrapper version matches the release. The wrapper then fetches the matching hardened binary from the GitHub release unless your environment already provides it.

Everyday Flow

bash
cd your-projectcodeledger readycodeledger ready --task "Fix null handling in user service"

Inside an initialized repo, you can also use:

bash
codeledger activate --task "Fix null handling in user service"codeledger doctor

Browser, cloud, and sandboxed environments can use the repo-local runtime deployed under .codeledger/bin/ after initialization or vendoring.

Architecture

CodeLedger has an open public surface and a protected hardened runtime:

text
PUBLIC:    CLI wrapper, types, repo scanner, harness, reports, docs, hooksPROTECTED: Scoring engine, selection algorithm, confidence internals

Use codeledger about, codeledger doctor, and command-specific --explain output to inspect behavior and evidence without exposing protected implementation internals.

Privacy

  • Installation may use npm and GitHub Releases.
  • Runtime analysis runs on your local machine by default.
  • Runtime analysis makes zero source-code telemetry calls by default.
  • Your source code is not required to leave your machine for the local CLI flow.
  • Uninstall at any time.

License

  • Public wrapper, types, repo scanning, harness, reports, docs, and examples: MIT
  • Downloaded hardened binary: CodeLedger Core License

GitHub may classify the combined licensing structure as "Other" because the repo includes both MIT-covered public files and separately licensed protected runtime terms. Changing the license files should be a human legal decision.

Part Of ContextECF

CodeLedger applies Intelligent Context AI's context-control architecture to software engineering. For enterprise-wide governed context across applications and agents, see ContextECF.

CodeLedger is produced by Intelligent Context AI, Inc. See codeledger.dev.

Source: README.md at commit cf70f98

Tools

8

query_ledger

Search the Enterprise Context Ledger for Golden Patterns and episodes relevant to a task. Returns the highest-density context from repo memory.

ParametersintentrequiredrepoRootmaxResults

get_active_context

Read current task context with provenance and separate readiness signals. Nonempty intent is authoritative for this invocation; empty arguments preserve prior activation. Security constraints still apply. Use get_activation_payload to inspect the activated scope.

ParametersintentcompactrepoRootexpectedRuntimeVersion

record_interaction

Record an execution outcome into the evidence buffer. Used by agents to report success/failure signals that compound into repo memory.

ParametersintentrequiredstatusrequiredrepoRootthoughtTracefilesModified

prompt_validate

Validate a task prompt against enterprise prompt engineering best practices. Returns a scored report with findings, fix suggestions, and source attribution. Covers clarity, structure, safety (injection/secrets), examples, governance, and software-dev patterns.

ParameterstaskrequiredcategoryrepoRoot

get_activation_payload

Retrieve the current Runtime Activation Payload — the machine-readable contract that governs what tools, files, and domains an agent is permitted to access for the active task. Use to understand task scope, allowed tool surface, risk posture, and enforcement rules before beginning implementation. This is the authoritative scope document for the session.

ParametersrepoRoot

codeledger_agent_quality

Run CodeLedger Agent Quality checks for bounded scope, prompt budget, roadmap slice coverage, and quality wins. Uses the same canonical builders and artifacts as codeledger agent-audit.

ParametersmodetaskformatpersistsessionrepoRoottargetTokens

codeledger_unified_pr_judgment

Read the persisted canonical codeledger/unified-pr-judgment/v2 artifact for PR review adapters. Does not recompute PR truth.

ParameterspathrepoRoot

panel_snapshot

Get the full CodeLedger context cockpit snapshot: active bundle, status, file annotations, certification, and insight tabs. Use AFTER get_activation_payload to get the enriched view for an already-activated task.

ParameterstaskrepoRoot

Version history

2
  1. v0.10.82LatestOct 30, 2026
  2. v0.10.7Sep 16, 2026

Score

80% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.