Skip to content

How It Works

This page explains the mechanics behind the report: what is captured locally, what becomes a git note, and how that data reaches PR Report and Dashboard. You do not need every detail to use Agent Note, but this is the place to check the model when something looks surprising.

With the generated git hooks installed, most repos can keep using plain git commit and git push. Cursor can also recover prompt / response pairs from local transcripts, and its shell hooks can keep tracking commits when git hooks are unavailable.

Layer 1: Local Temp

Session data in .git/agentnote/sessions/. JSONL files for prompts, changes, and blob hashes. Rotated after each commit. Never pushed.

Layer 2: Git Notes

Permanent record in refs/notes/agentnote. One JSON per commit. Pushable, fetchable, shareable with the team.

FilePurpose
prompts.jsonlOne prompt per line with turn number
changes.jsonlFiles touched by AI with post-edit blob hashes
pre_blobs.jsonlFile state before each AI edit
heartbeatSession activity timestamp
turnMonotonic counter incremented on each prompt
{
"v": 1,
"agent": "claude",
"session_id": "a1b2c3d4-...",
"timestamp": "2026-04-02T10:30:00Z",
"model": "claude-sonnet-4-20250514",
"interactions": [
{
"prompt": "Implement JWT auth middleware",
"contexts": [
{ "kind": "reference", "source": "previous_response", "text": "The previous response explains why this middleware needs to change." }
],
"selection": {
"schema": 1,
"source": "primary",
"signals": ["primary_edit_turn"]
},
"response": "I'll create the middleware...",
"files_touched": ["src/auth.ts"],
"tools": ["Edit"]
}
],
"files": [
{ "path": "src/auth.ts", "by_ai": true },
{ "path": "CHANGELOG.md", "by_ai": false }
],
"attribution": {
"ai_ratio": 73,
"method": "line",
"lines": { "ai_added": 146, "total_added": 200, "deleted": 12 }
}
}

Claude Code

Usually line-level. Agent Note compares the file before and after each AI edit, then removes later human edits from the final diff.

Codex CLI

Starts as file-level. It upgrades to line-level only when the transcript patch count matches the final commit diff.

Cursor

Starts as file-level. It upgrades to line-level only when edit counts match and the final file still matches the last AI edit.

Gemini CLI

Records prompt / response and file-level attribution from hooks and transcripts. Line-level attribution is not available yet.

📝 Context is a display-only note for short prompts such as “continue” or “do the next one”. It helps readers understand the prompt without changing attribution.

Agent Note Dashboard showing Context before a short prompt
  • reference context comes from the immediately previous response when it mentions a changed file path, file name, or code identifier from the final diff.
  • scope context comes from the current response when its opening lines clearly name the work being done.
  • Agent Note does not use approval words such as yes, continue, or お願いします as selection rules. If there is no concrete file or code clue, it skips Context.
  • Context never changes files_touched, prompt ownership, AI Ratio, attribution method, or whether a git note is saved.

Agent Note and Entire solve related but different problems.

  • Agent Note links git commits to the AI conversation that produced them. Entire is a broader checkpoint product with rewind / resume workflows.
  • Agent Note stores the permanent record in refs/notes/agentnote; temporary session files stay under .git/agentnote/. Entire centers checkpoint metadata and a hosted web application.
  • Agent Note’s Dashboard is optional static GitHub Pages backed by git notes. You can keep using Agent Note without a hosted service.
  • Agent Note does not try to restore an old workspace state. It focuses on reviewability: why a commit changed, which prompts were involved, and how much of the diff was AI-authored.
EventWhat happens
SessionStartCreates session directory, writes heartbeat
UserPromptSubmitAppends prompt, increments turn counter, rotates logs
PreToolUse Edit/WriteCaptures pre-edit blob hash (synchronous)
PostToolUse Edit/WriteCaptures post-edit blob hash + file path
StopLogs stop event (heartbeat stays active — Stop = response end, not session end)

Git notes are invisible to branch listings, GitHub UI, and CI — but pushable and fetchable.

Terminal window
# Share with team
git push origin refs/notes/agentnote
# Fetch from remote
git fetch origin refs/notes/agentnote:refs/notes/agentnote
# View a note
git notes --ref=agentnote show <commit>

For storage boundaries, visibility, and what is never uploaded to an Agent Note service, see Data & Privacy.