CommitLore 标志

CommitLore

社区
MongLong0214

Git-native decision memory for Claude Code, Codex, Cursor and other coding agents. Preserve constraints and rejected alternatives; surface only the decisions still in force.

发布者MongLong0214
代码仓库commitlore
语言TypeScript
复刻数
3
星标数
18
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    CommitLore 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 18 个 Star 和 3 个 Fork。

bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.5.1/install.sh | sh -s v1.5.1
bash
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.5.1/install.sh
sh install.sh v1.5.1

# Or skip the script: the checkout it makes is one you can make yourself.
git clone --depth 1 --branch v1.5.1 https://github.com/MongLong0214/commitlore
node commitlore/dist/commitlore.mjs --version

It installs a pinned source checkout and a wrapper that runs node <checkout>/dist/commitlore.mjs — no compiled download, no build step.


The code survives. The judgment doesn't.

An agent proposes an approach. Your team rejects it because of a non-obvious constraint. The final code preserves the outcome, but usually not why the alternative was rejected. A later agent sees only the code and proposes the same idea again.

CommitLore keeps that judgment beside the code.

What CommitLore does

BehaviorProduct path
CapturesPreserves constraints, rejected alternatives, and warnings that a diff cannot show. Candidates are checked against the session transcript and the staged diff.commitlore capture
PreservesStores accepted records in Git trailers or notes instead of a hosted memory database.commit hooks · refs/notes/commitlore
Tracks lifecycleKeeps active, superseded, and expired decisions distinct.commitlore stale
ScopesSelects decisions for the path an agent is about to edit.commitlore context
Grades trustDelivers records as directives, claims, or withheld content.default / signed mode
DeliversGives supported agents current context before an edit.plugin hook · MCP

Most commits should carry no record. CommitLore is for judgment the code cannot preserve, not for narrating every change.

60 seconds to decision-aware agents

1. Install the CLI

macOS and Linux:

bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.5.1/install.sh | sh -s v1.5.1

Windows:

powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.5.1/install.ps1))) v1.5.1

Requires Node.js 22.23.2+ and Git. The script checks both before it writes anything.

2. Connect your agent

Claude Code:

text
/plugin marketplace add MongLong0214/commitlore
/plugin install commitlore@commitlore

Codex:

bash
commitlore plugin install-codex

The plugin puts no commitlore on PATH, so the commands below need the CLI install as well. The installers also detect and wire supported MCP hosts where they can do so safely; the exact matrix is below.

3. Initialize a repository

bash
cd your-repository
commitlore init
commitlore context .

Start a new agent session after installing or updating a plugin: a running session keeps the runtime it loaded.

Then work and commit normally. On supported skill integrations, CommitLore is considered during ordinary commit requests and stays silent when there is nothing worth preserving. You do not need to name CommitLore on every commit.

Want accepted records to stage without a per-record prompt? The repository can opt in once with commitlore auto on. That policy is repository-owned and applies to the team, so it is not silently enabled by this page.

What the agent receives

Before editing src/pricing.ts:

text
commitlore: active records for src/pricing.ts

Limit
  [claim]      r-price01  a1b2c3d4  calculatePrice owns final checkout pricing only

Ruled-out
  [claim]      r-price01  a1b2c3d4  Reuse it for admin quotes | eligibility and rounding semantics differ

[claim] means "weigh this as information." A repository can opt into the stronger signed-authority mode. Delivery gives the agent context; it does not block the edit.

Security model →

Why Git?

The repository should own the judgment behind its code.

CommitLore stores records in ordinary Git trailers and notes, so they branch, merge, clone, review, and survive provider changes with the code they explain.

SQLite is only a rebuildable index. Delete it and Git still holds the record.

Finding an old decision is not enough

A general memory or retrieval system asks:

Which old text looks related?

CommitLore asks:

Which recorded decisions still apply to this path now?

A superseded decision can be highly relevant and still be wrong as current guidance. Relevance and authority are different questions.

How it works

  1. Capture — an agent drafts only decision context the diff cannot show.
  2. Verify — CommitLore checks the draft against the session and staged diff.
  3. Preserve — the accepted record lives in Git with identity and lifecycle.
  4. Deliver — before a later edit, only active records for that path are returned.

Most commits carry no record. The commit hook validates a record when one is present; it does not invent one.

An existing hook is not overwritten. commitlore init honours core.hooksPath, moves any hook already installed to <hook>.commitlore-chained, and calls it first; commitlore hooks uninstall puts it back.

What happens automatically

HostPre-edit deliveryVerified capture workflowDeterministic every-commit capture
Claude CodeAutomatic through the pluginAvailable through the plugin skillNot certified
CodexAutomatic through the pluginAvailable through the plugin skillNot certified
HermesAvailable after commitlore hermes installAvailable after host installNot certified
Gemini CLI, Cursor, Windsurf, opencodeMCP delivery where the host uses the registrationProcedure exposed over MCPNo
AGENTS.md hostsProcedure onlyProcedure onlyNo

"Available" means the prepare → verify → stage workflow exists. It does not mean every eligible commit is assessed automatically.

Users on supported skill hosts do not need to say "record this in CommitLore" on every commit. The remaining limitation is host initiation, not a required per-record user command.

Squash-merge repositories

A squash merge replaces a branch's commits with one new commit, and that commit does not carry the branch's trailers. If your repository merges with the squash button, a record made on a branch is dropped by the merge unless something carries it onto the commit that squashed it.

Two paths cover that, and one of them needs a one-time setup:

How the squash happensWhat carries the recordSetup
git merge --squash locallyThe installed prepare-commit-msg hook, from SQUASH_MSGNone — commitlore init already did it
GitHub's Squash and merge buttonThe action/preserve GitHub ActionThe workflow below

GitHub performs that merge on its own servers, where no local git hook runs at all, so the local hook cannot see it. The Action is the only place that has what it needs at that moment: the pull request, its commits, and the commit they were squashed into.

Add .github/workflows/commitlore-preserve.yml:

yaml
name: CommitLore squash inheritance

# pull_request_target, not pull_request: a pull request from a fork gets a
# read-only token on pull_request, so the job would build the record and then
# fail to publish it.
on:
  pull_request_target:
    types: [closed]

permissions:
  contents: write   # the one push to refs/notes/commitlore

concurrency:
  group: commitlore-notes
  cancel-in-progress: false

jobs:
  preserve:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          # the merge commit is on the base branch, and a closed pull request
          # has no merge ref left to check out
          ref: ${{ github.event.pull_request.base.ref }}
          fetch-depth: 0

      # the mirror this action writes; publishing from a checkout that never
      # read it would fork the notes history
      - run: git fetch --no-tags origin '+refs/notes/commitlore:refs/notes/commitlore'

      # a squash merge usually deletes the branch, and then the pull request's
      # own ref is the only one still reaching the commits that carry records
      - run: git fetch --no-tags --force origin
          '+refs/pull/${{ github.event.pull_request.number }}/head:refs/commitlore/pr-head'

      # The action runs CommitLore from a checkout of this repository: the
      # package is private, so there is no published npm name to fall back to.
      # `dist/` is committed (ADR-0011), so nothing needs building.
      - uses: actions/checkout@v4
        with:
          repository: MongLong0214/commitlore
          ref: v1.5.1
          path: .commitlore-cli
          persist-credentials: false

      - uses: MongLong0214/commitlore/action/preserve@v1.5.1
        with:
          cli-path: .commitlore-cli/dist/cli.js

Two rules for whoever edits this next, because pull_request_target runs with a writable token: never check out the pull request's head here, and never execute anything reachable from refs/commitlore/pr-head. The fork's commits arrive as data to read trailers from, not as code to run.

commitlore doctor reports whether this is switched on, under squash inheritance. It says so before a record is lost; squash conservation is the row that reports records already gone.

If you merge with merge commits or rebase, records survive on their own and this setup is unnecessary.

A field report, not a measurement

One run, on an unrelated repository, by someone installing v1.2.1 for the first time. Nothing here was measured and none of it is in the evidence logs. It is on this page because the paragraph above asserts a loop that no table here covers.

They asked an agent to fix a rounding bug, mentioned in passing that a decimal library had already been considered and dropped, and ended with "commit it". CommitLore was never named. Part of what the commit carried:

Ruled-out: adopting a decimal library such as Decimal.js | the backend is a
  number contract, so it is meaningless
Warn: do not revert the test file to console.assert: it exits 0 even on
  failure, so CI passes silently
Provenance: drafted

The Warn was not dictated to the agent. It hit the trap while working and left it for whoever came next. Provenance: drafted records that no human read the record, which grades it claim — delivered as a report to weigh, not an order.

A later session with no shared history was asked to adopt the decimal library after all. It did not, and named the record as its reason. It also read the grade: a claim is not an instruction, so it checked the stated reason against the code before agreeing with it.

Unlike memory storage

General memory / RAGCommitLore
Primary questionWhat old text is related?Which decisions still apply here now?
AuthorityMemory store or providerGit
ScopeSemantic similarityRepository paths
LifecycleOften append-firstActive · superseded · expired
TrustRetrieved textDirective · claim · blocked
CaptureTranscript or note storageEvidence-checked decision record
PortabilityBackend-dependentOrdinary Git

CommitLore is intentionally narrower. It is not a general user-memory system, conversation archive, or vector database replacement.

Evidence

QuestionMeasured resultBoundary
Did claim-grade context change re-proposal in the registered study?2.8% (16/580) with CommitLore vs 18.8% (109/579) withoutone model, one harness, constructed tasks
Did lifecycle filtering deliver retired records in the measured active projection?0 retired recordssuperseded records were present; expiry was not
Does indexed lookup scale?496 ms p50 at 100k commitsthe no-index fallback is much slower

Index build time follows the number of records, not the number of commits: the expensive pass runs once per record, so a long history that has recorded little builds faster than a short one dense with records.

Path scope is what keeps a large history from reaching the model. On the #167 corpus, only 2 of 10,002 records did:

routemodel-visible recordsrelevant recordsmodel-visible tokens
inject everything10,0022/21,004,554
top-k lexical21/2190
CommitLore path scope22/2335

That measures exposure and recall at a fixed two-record budget — not token cost, billed cost, accuracy, or agent behaviour. One corpus, one query, one pinned embedding model.

The agent study does not establish a universal model effect. Delivery is not proof that a model read or followed a record.

Methods, full tables, exclusions, and negative results →

Limits, trust and privacy

  • Capture is assisted, not deterministic. Supported skills consider ordinary commit requests, but no host is certified to assess every eligible commit.
  • Default directive mode is not authentication. It matches the commit author header, and anyone who can write a commit can set that header — so a [directive] in default mode is policy metadata, not proof of identity. Signature mode additionally requires Git's own verified status and a match in the repository-local commitlore.trustedSigner allowlist; an absent, empty, or unreadable signer allowlist authorizes nobody, so the mode fails closed.
  • Guard is an experimental advisory, not a safety net: precision 44.8% (95% Wilson CI 32.7%–57.5%), recall 22.0% on the 417-decision corpus. An empty guard result is not a safety verdict.
  • Delivery spends tokens on every matching tool call. The pre-edit hook fires on Read as well as Edit, Write, MultiEdit and NotebookEdit, so it runs far more often than an editing agent commits. Each fire spends up to the payload budget — 800 tokens by default, changed with --budget. A repository with no records spends nothing, which means this is a cost that arrives with adoption rather than with installation.
  • An answer may be partial. Coverage is disclosed; absence from a partial result is not proof that no record exists. commitlore coverage reports what a scan reached.
  • Commit trailers travel with a clone; notes do not. Git does not fetch refs/notes/* by default, so a record in refs/notes/commitlore is absent from an ordinary clone until commitlore init configures that mirror.
  • There is no hosted backend. But once the server or hook returns context, the host handles that context under its own policy; CommitLore does not control that data flow.

Security · Compatibility · Evidence

Records are untrusted until graded. Default author matching is policy metadata, not authentication. Signed directive mode requires Git verification and a repository-local signer allowlist; an absent or unreadable allowlist authorizes nobody. Injection-shaped payload is withheld from model-readable routes.

Full security model →

The CLI installer cannot rewrite hooks inside repositories it does not know about, and running host sessions retain the runtime they loaded. commitlore doctor names both states and their repair, and commitlore upgrade reports whether a newer release exists.

Installation and upgrades →

Records are ordinary Git trailers or notes. Protocol 2.0 defines lifecycle, trust grades, validation, and compatibility.

Human guide → · Normative specification →

The repository publishes the methods, exclusions, unsuccessful measurements, and the cases where the original benchmark or diagnosis was wrong.

Evidence → · Self-audit →

Documentation

Contributing

CONTRIBUTING.md covers the record protocol this repository holds itself to, the release gate, and how to reproduce the evidence.

License

MIT — see LICENSE.

将 CommitLore MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 CommitLore 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 CommitLore 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 CommitLore MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "commitlore": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 CommitLore MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 CommitLore MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 CommitLore 帮我完成这项任务吗?
CommitLore
当然。我已阅读。
以下是我使用 CommitLore 得到的结果。

常见问题

CommitLore MCP 服务器有什么用途?

CommitLore 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 CommitLore MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 CommitLore,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 CommitLore MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 CommitLore 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 CommitLore MCP 连接到 TypingMind?

CommitLore 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

CommitLore MCP 在 TypingMind 中提供哪些工具?

CommitLore 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 CommitLore MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 CommitLore 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇