跳转到内容

Agent Note

git commit 记录了什么改变了。 Agent Note 记录了为什么改变。

为什么做这个

半年前我重新阅读了 AI 帮我写的代码,却无法回答「为什么要这样做?」。git log 里只有 diff。提示词、响应——全都消失了。


于是我开始把 AI 对话附加到每一个 commit 上。

Agent Note dashboard preview

记录 AI 参与的变更

查看哪些提交和文件得到了 AI 帮助。证据足够时,Agent Note 也会估算 AI 编写的行数。

提示词和响应一并保存

模型名称和工具使用情况也一起——全部与变更捆绑存入 git notes。

自动生成 PR 报告

AI Ratio、提示词数量、commit 哈希,以及供 AI Review 工具读取的隐藏补充上下文。

仅写入 git notes

分支保持干净。push / fetch 与团队共享,也可以在 GitHub Pages 上发布可选的静态 Dashboard。

如果你想…阅读
安装前先了解 Agent Note 会添加什么快速开始
在仓库中安装 Agent Note安装
添加 PR 中显示的报告GitHub Action
发布团队共享的历史页面Dashboard
查看每个 agent 能记录什么Agent 支持
了解会保存什么、谁能看到Data & Privacy
修复缺失的 notes、prompt 或 Dashboard 数据Troubleshooting
  1. 在仓库中运行 init

    Terminal window
    npx agent-note init --agent claude
    • 如果你使用 Codex CLI:npx agent-note init --agent codex
    • 如果你使用 Cursor:npx agent-note init --agent cursor
    • Gemini CLI 请运行:npx agent-note init --agent gemini
    • 同时使用多个 agent:npx agent-note init --agent claude cursor
  2. 提交生成的文件

    Terminal window
    git add .claude/settings.json .github/workflows/agentnote-pr-report.yml
    git commit -m "chore: enable agent-note"
    git push
    • Codex CLI: 提交 .codex/config.toml.codex/hooks.json
    • Cursor: 提交 .cursor/hooks.json
    • Gemini CLI: 提交 .gemini/settings.json
  3. 用 AI 编写代码。 装好生成的 git hook 后,直接继续使用普通 git commit 即可。

Terminal window
npx agent-note status
agent-note v1.x.x
agent: active (cursor)
capture: cursor(prompt, response, edits, shell)
git: active (prepare-commit-msg, post-commit, pre-push)
commit: tracked via git hooks
session: a1b2c3d4…
agent: cursor
linked: 3/20 recent commits

agent: 显示已启用的 adapter,capture: 汇总当前 hook 收集的内容,git: 显示受管理的 git hook 是否已安装,commit: 显示普通 git commit 是否为主路径。

commit: ce941f7 feat: add JWT auth middleware
session: a1b2c3d4-5678-4abc-8def-111122223333
ai: 60% (45/75 lines) [█████░░░]
model: claude-sonnet-4-20250514
agent: claude
files: 3 changed, 2 by AI
src/middleware/auth.ts 🤖
src/types/token.ts 🤖
CHANGELOG.md 👤
功能
Claude Code
Codex CLI
Cursor
Gemini CLI
状态
完全支持
支持
支持
预览
提示词
响应
文件
AI Ratio
行数估算
默认显示
Codex patch 记录与最终 commit 匹配时
edit 数匹配,且最终文件仍匹配最后一次 AI 编辑时
尚未支持

详情请查看 Agent 支持