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 分

    請在儲存庫或註冊中心條目中宣告授權條款。