Logbook

io.github.promptwheel-ai由 GitHub 账号 promptwheel-ai 发布v0.8.0更新于 Nov 6, 2026

Git-history memory for coding agents: reverts, weakened tests, hot spots, and unreviewed notes.

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

概览

AI 生成的概览

把仓库的 Git 历史变成助手可读的记忆:热点文件、被回滚的做法、被抑制的测试,以及持久化的笔记。

可以做什么
  • 读取有界的仓库历史摘要,含热点、勿重试的回滚、抑制清单、脆弱区域与单文件历史
  • 按文件与事件类型精确筛选完整提交事件记录,返回准确计数并处理截断
  • 以紧凑、有界的分页返回同样的筛选历史,供助手上下文使用
  • 审计 HEAD 中仍被抑制的内容、起始时间,以及某抑制是否反复出现
  • 在调查某次提交后写入机器生成、明确未审核的笔记,可选引文会对照原始 Git 对象校验
适用场景
适合在陌生的或历史密集的仓库开始工作、重构或大改动之前,或需要判断通过的测试是否可信时使用。README 也说明其收益并非普遍,主要出现在困难且历史密集的任务上。
运行要求
以 stdio 本地进程运行,来自 npm 包 @promptwheel/logbook-mcp,需要 Node.js 18 或更高版本。它读取本地 Git 仓库,无需账号、API 密钥或网络访问。README 建议先运行 CLI 的 init 步骤生成历史产物与助手工作流文件。
安装前请注意
annotate 工具会在没有人工审核环节的情况下向仓库写入笔记;笔记标注为机器生成且未审核,提交 annotations.jsonl 会与团队共享。结论只是线索而非定论,检测基于正则,会漏掉被 squash 或 rebase 抹掉的历史,浅克隆也会削弱分析。README 称仓库数据不会发送到任何地方。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

logbook

[ci] [npm]

Git history is large. When coding agents do not inspect it, they can re-propose approaches a repository already rejected.

Logbook turns a repository's Git history into memory an agent can use: a deterministic recall layer (hotspots, reverted approaches, suppressions, assertion weakening, and bounded history queries) plus durable notes an agent writes down after it investigates why a change happened.

Everything runs locally. The CLI has zero npm dependencies, reads raw Git objects for evidence checks, and never sends repository data anywhere. Node.js 18 or newer is required.

bash
npx -y @promptwheel/logbook@latest init

init analyzes the repo, writes the history artifacts, and installs a compact workflow in AGENTS.md, CLAUDE.md, or .cursorrules so the agent reads history before it plans: read LOGBOOK.md, page each task path with context --file, verify leads with git show, refresh, audit, and annotate what it verified. The same workflow ships as an agent skill in plugin/skills/logbook/SKILL.md.

Its output, shortened:

text
  1,326 commits · 322 files · 7.3 years · 354 authors
  ✓ wrote LOGBOOK.md     hotspots · do-not-retry · suppression ledger  ✓ wrote events.jsonl   1,326 structured events

The examples below use logbook as the binary name. Run them through the exact package above, or install @promptwheel/logbook@latest locally or globally.

Quick start

bash
logbook                                      # refresh the history artifactslogbook context --file src/cache.ts --revert # bounded history for a pathlogbook audit                                # what is still suppressed, and since whenlogbook query --json --file src/cache.ts     # the same events as JSONLlogbook doctor                               # read-only artifact and wiring health

context returns history in pages of at most 20 events and 8 KiB; repeat the identical filters with each NEXT cursor until END complete.

When an agent investigates why a prior change happened during real work, it can preserve the result immediately, with no prompt or human gate:

bash
logbook annotate <commit> "why this approach was rejected" --by codex

The note is durably appended to annotations.jsonl and appears in LOGBOOK.md before the command exits. It is always labeled machine-authored and unreviewed and is bounded in the startup digest. An optional exact quote can be attached with --span, --side, and (for diff evidence) --evidence-file; a quote that does not ground in raw Git objects is rejected rather than guessed.

What it stores

PathPurpose
LOGBOOK.mdBounded history brief for agents: hotspots, do-not-retry reverts, suppressions, weakened assertions, and fragile areas
events.jsonlStructured deterministic history events for tools and queries
annotations.jsonlDurable machine-authored notes, shown in the digest as explicitly unreviewed leads

Commit annotations.jsonl to share the notes with the team, or add it to .gitignore to keep them local to one checkout.

History queries and context economics

context preserves filtered query order but emits pages of at most 20 events and 8 KiB. A cursor is bound to the repository HEAD, filters, analysis window, and ordered event set, so a stale or edited cursor is rejected instead of silently drifting.

The history scan is cached in bounded windows. On a history of tens of thousands of commits a cold run takes tens of seconds, a warm run that reuses the ledger on disk is well under a second, and a repeat call with an unchanged HEAD in an MCP session is milliseconds. LOGBOOK_NO_CACHE=1 forces a rebuild; LOGBOOK_WINDOW=N tunes the window.

In a random 400-repo sample of the top 2,500 GitHub repositories, the median LOGBOOK.md was about 1,000 estimated tokens while the median full git log was 82× larger. See context economics and the bounded context format.

Integrate: CLI, MCP, or import

Three surfaces over the same deterministic history layer:

  • CLI + JSON. logbook query --json (filtered, 200 rows unless you pass --limit) and logbook --json (the full ledger) emit JSONL you can shell from any language. logbook audit --json returns the live suppressions as one array. The JSON is cache-invariant (byte-identical with and without LOGBOOK_NO_CACHE=1), so it is safe to parse in CI.
  • MCP. @promptwheel/logbook-mcp (bin logbook-mcp) serves the history to an agent over the Model Context Protocol: a Claude Code or other MCP client reads hotspots, do-not-retry reverts, and suppression signals without shelling anything.
  • Import. The package is importable and importing it never runs the CLI. queryEvents, analyze, auditHead, and hotspots are exported for advanced in-process use; the scan and cache entry points take explicit options, so the CLI and MCP are the first-class surfaces for most integrations.

The paired check engine, promptwheel, has the matching surface. Both are described in its INTEGRATE.md.

Evidence status

An internal six-task planning experiment on history-dense repos found that agents without history re-proposed already-tried or already-finished work in 4 of 6 repos and 0 of 6 with LOGBOOK.md in context, at about 4.7k extra plan tokens. A later sealed held-out screen on ten new tasks found no advantage over a strong raw-Git instruction, and traced the gap to retrieval rather than the index. The calibrated claim is: valuable on sufficiently difficult, history-dense tasks; not universally better. Details and limits are in wrong-work-benchmark.md and does-it-change-agent-behavior.md.

Honest scope

  • Findings are leads, not verdicts. A suppression means "look here," not misconduct.
  • Detection is deterministic regex over commit subjects and diffs. It misses history erased by squash/rebase and anything never committed.
  • Shallow clones starve historical analysis; fetch the missing history before treating absence as evidence.
  • Code maps explain where code is. Logbook focuses on what happened over time.

Command reference

text
logbook init [path]logbook [path] [--json]logbook audit [path] [--json [--file P ...] [--ref REF]]logbook doctor [path]logbook query [path] [filters] [--json]logbook context [path] [filters] [--cursor TOKEN]logbook annotate SHA "WHY" [optional evidence] [--by WHO]

logbook --help lists every filter and option.

Upgrading

0.11.0 removes logbook refine, logbook journey, and --out. Both commands now fail with not a git repository, and --out is an unknown option. Artifacts always go to the repository root. The analyze result no longer carries first, last, threshold, mentor, abyss, winter, or trials, and renderJourneyAnsi, journeyBeats, almanacStats, GATE_PAT, and MENTOR_PAT are no longer exported. The event and --json shapes, the five MCP tools, and doctor did not change. MCP server 0.8.0 requires this core.

0.10.0 removed the experimental reviewed-decision layer and the OKF export: annotate-draft, pending, accept/accept-draft, accept-lead, reject-lead, check, publish, outcomes, and export. Files that layer left behind (.logbook/, decision-cards.jsonl, annotation-reviews.jsonl) are ignored and can be deleted by hand.

From any release, a normal refresh rewrites a ## Repo memory block that an earlier release generated, so doctor passes after an upgrade. User-edited blocks are never touched. Existing annotations.jsonl rows stay unreviewed digest notes. A JOURNEY.md left by a release before 0.9.7 is ignored and can be deleted. If 0.8 wrote annotations to a custom directory, move that annotations.jsonl to the repository root. Earlier notes are in the git history of this file.

The logbook records what happened; the check verifies what holds

Logbook tells you what history says. promptwheel is the check that verifies whether today's claimed improvement came from the code rather than moving the goalposts.

Apache 2.0.

来源:README.md,提交 acf69e2

工具

5

logbook_digest

The repo's history digest: hotspots, do-not-retry reverts, suppression ledger, fragile areas, notable events, per-file history. Use when starting work in an unfamiliar repo, before a refactor or large change, or when deciding whether green tests can be trusted.

输入参数repo

logbook_annotate

Persist a machine-authored, explicitly unreviewed note after investigating a commit. It appears immediately in the repo digest. Optional quoted evidence is raw-object verified.

输入参数bysha必填why必填reposidespanevidenceFile

logbook_audit

What is STILL suppressed in HEAD and since when (blame-dated), with re-silencing fight logs. Use when asked what tests are skipped, what debt is live, or whether a suppression keeps coming back.

输入参数repo

logbook_query

Filter the full commit-event record with precision. Start with all relevant files + event type before broad grep. Repeated paths use OR; other filters use AND. Returns up to `limit` matches, default 100, with exact counts and explicit truncation recovery.

输入参数filegreprepofileslimitsinceuntilrevertweakensuppressdowngrade

logbook_context

Return the same filtered history order as logbook_query in compact, bounded pages for agent context. Pass all relevant paths in files; paths use OR and other filters use AND. This is deterministic delivery, not relevance ranking. Repeat identical filters with every NEXT cursor until END complete when completeness matters.

输入参数filegreprepofilessinceuntilcursorrevertweakensuppressdowngrade

版本历史

5
  1. v0.8.0最新Nov 6, 2026
  2. v0.6.4Nov 4, 2026
  3. v0.6.3Nov 4, 2026
  4. v0.6.1Nov 4, 2026
  5. v0.4.0Sep 16, 2026

评分

已满足适用检查项的 90%

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

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

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

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