Codeledger

io.github.codeledgerECF由 GitHub 账号 codeledgerECF 发布v0.10.82更新于 Oct 30, 2026

Local context and engineering evidence for AI coding agents.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,为编码智能体提供任务范围内的仓库上下文、激活范围契约、提示词校验与证据记录。

可以做什么
  • 在仓库上下文账本中检索与任务相关的黄金模式与历史片段
  • 读取当前任务上下文及其来源与就绪信号,并获取规定可用工具、文件与域名的运行时激活载荷
  • 把执行结果写入证据缓冲区,累积为仓库记忆
  • 按提示词工程最佳实践校验任务提示词,返回带发现项与修复建议的评分报告
  • 运行智能体质量检查,并读取已持久化的统一 PR 判定产物
  • 获取包含活动包、文件标注与认证信息的上下文驾驶舱快照
适用场景
适合希望编码智能体从一组有界、与任务相关的文件而非整个仓库入手,并把工作约束在明确范围契约内、留下可核查证据的场景。面向在已初始化仓库上使用 CLI 或兼容 MCP 的编码智能体的团队。
运行要求
以本地 stdio 进程运行,来自 npm 包 @codeledger/cli(需 Node.js),通过 codeledger mcp start 启动。仓库须先用 codeledger ready 初始化,否则工具调用返回 not_evaluable。除 get_activation_payload 外的工具调用需要有效的 Team 或 Enterprise 许可证。本地 CLI 流程无需账号。
安装前请注意
多数工具在没有付费 Team 或 Enterprise 许可证时处于锁定状态,免费可用的仅 get_activation_payload。安装或更新可能从 npm 与 GitHub Releases 下载包和发布产物。评分引擎与选择算法属于受单独许可保护的运行时。工具会向仓库写入上下文包与证据,record_interaction 会把结果汇入仓库记忆。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Codeledger,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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.

来源:README.md,提交 cf70f98

工具

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.

输入参数intent必填repoRootmaxResults

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.

输入参数intentcompactrepoRootexpectedRuntimeVersion

record_interaction

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

输入参数intent必填status必填repoRootthoughtTracefilesModified

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.

输入参数task必填categoryrepoRoot

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.

输入参数repoRoot

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.

输入参数modetaskformatpersistsessionrepoRoottargetTokens

codeledger_unified_pr_judgment

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

输入参数pathrepoRoot

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.

输入参数taskrepoRoot

版本历史

2
  1. v0.10.82最新Oct 30, 2026
  2. v0.10.7Sep 16, 2026

评分

已满足适用检查项的 80%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。