コンテンツにスキップ

インストール

このページは実際のセットアップ手順です。完了すると、通常の git commit で Agent Note data を記録し、GitHub の Pull Request に PR Report を表示できます。

  1. repository で init を実行します。

    Terminal window
    npx agent-note init --agent claude

    Codex CLI の場合:

    Terminal window
    npx agent-note init --agent codex

    Cursor の場合:

    Terminal window
    npx agent-note init --agent cursor

    Gemini CLI の場合:

    Terminal window
    npx agent-note init --agent gemini

    複数 agent を同時に:

    Terminal window
    npx agent-note init --agent claude cursor

    Agent Note は次を設定します:

    • Agent hooks (.claude/settings.json、Codex CLI では .codex/config.toml.codex/hooks.json、Cursor では .cursor/hooks.json、Gemini CLI では .gemini/settings.json)
    • Git hooks (prepare-commit-msg, post-commit, pre-push)
    • GitHub Action workflow (.github/workflows/agentnote-pr-report.yml)
    • git notes の auto-fetch 設定

    共有 Dashboard も使いたい場合:

    Terminal window
    npx agent-note init --agent claude --dashboard

    この場合は .github/workflows/agentnote-dashboard.yml も追加されます。

  2. 生成された file を commit します。

    Terminal window
    git add .claude/settings.json .github/workflows/agentnote-pr-report.yml
    # --dashboard を使った場合は .github/workflows/agentnote-dashboard.yml も追加
    git commit -m "chore: enable agent-note"
    git push

    Codex CLI では .codex/config.toml.codex/hooks.json.github/workflows/agentnote-pr-report.yml を commit します。 Cursor では .cursor/hooks.json.github/workflows/agentnote-pr-report.yml を commit します。 Gemini CLI では .gemini/settings.json.github/workflows/agentnote-pr-report.yml を commit します。 --dashboard を使った場合は .github/workflows/agentnote-dashboard.yml も commit します。

  3. agent と一緒に開発を始めます。

    生成された git hook が入っていれば、通常の git commit をそのまま使えます。

各 developer は clone 後に一度 init を実行し、local git hook を入れます。

Terminal window
git clone <repository-url>
cd <repository-dir>
npx agent-note init --agent claude

セットアップ後は、現在の session に Agent Note data がある場合、通常の git commit で次が行われます。

  1. 追加 Agentnote-Session trailer を commit message に追加
  2. 記録 prompt、response、file attribution を git note として保存
  3. 送信 git push 時に notes も remote に送信

Cursor では response hook または local transcript から prompt / response も復元されます。

Terminal window
npx agent-note show
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 👤
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: は repository-local git hook の状態、commit: は通常の git commit が主経路かどうかを示します。

Flag説明
--agent <name...>1 つ以上の agent adapter を選びます: claude, codex, cursor, gemini
--dashboard共有 Dashboard 用の .github/workflows/agentnote-dashboard.yml も作成
--no-hooksagent hook 設定を skip
--no-git-hooksgit hook install を skip
--no-actionworkflow 作成を skip
--no-notesauto-fetch 設定を skip
--hooksagent hook だけ install
--actionworkflow だけ作成

詳細な取得範囲と attribution 条件は エージェント対応 を参照してください。

Claude Code
生成された git hook があれば、通常の git commit でそのまま記録できます。prompt / response は hook から復元され、attribution は既定で line-level です。

Codex CLI
生成された git hook があれば、通常の git commit でそのまま記録できます。prompt / response は local transcript から復元され、transcript の patch 行数が commit と一致したときだけ line-level に上がります。

Cursor
生成された git hook があれば、通常の git commit でそのまま記録できます。prompt / response は response hook または local transcript から復元され、edit 数が一致し、committed file が最後の AI edit と一致した file だけ line-level に昇格します。

Gemini CLI
生成された git hook があれば、通常の git commit でそのまま記録できます。prompt / response は BeforeAgent / AfterAgent hook から復元され、attribution は現状 file-level のままです。