Chronicle
Git commits record what changed. Chronicle records why.
Chronicle is a CLI tool that captures the intent, reasoning, and constraints behind code changes as structured metadata stored alongside your commits. It works with any git repository, requires no external services, and integrates directly into your existing workflow.
$ git chronicle read src/auth/middleware.rs --anchor validate_token
intent: Extract token validation into standalone function for testability
reasoning: Previous inline validation made unit testing impossible without
spinning up a full HTTP server. Standalone function can be tested
with mock tokens.
constraints:
- Must validate expiry before signature check (short-circuit on expired tokens)
depends on: src/auth/jwt.rs::decode (assumes valid UTF-8 payload)
Why
Every line of code exists because someone made a decision. They chose this data structure, added that retry loop, bounded a cache at four entries for a reason. That reasoning lives in the developer's head -- or the AI agent's context window -- and is gone within hours.
Chronicle captures this knowledge at commit time and makes it queryable. When you (or an AI agent) modify code later, you can check what assumptions it was built on, what depends on its behavior, and what will break if you change it.
Install
This puts the git-chronicle binary on your PATH. Git discovers it automatically -- all commands are available as git chronicle <command>.
Requires Rust 1.70+ and git.
Getting started
# One-time machine setup (configures your LLM provider, installs Claude Code skills)
# Initialize Chronicle in a repository
# That's it. Make commits normally:
# Then annotate the commit:
Annotation paths
Chronicle has two ways to annotate commits:
Batch path -- an LLM reads the diff and produces annotations automatically. Requires an API key (ANTHROPIC_API_KEY).
Live path -- you (or an AI agent) provide the annotation as JSON. Zero cost, instant.
The live path is what Claude Code and other AI agents use -- they already know the intent behind their changes, so no LLM call is needed.
Reading annotations
# Read annotations for a file
# Read a specific function's annotations
# Find code that depends on a function's behavior
# See how a file's annotations evolved over time
# Get a condensed overview of all annotations in a file
Correcting annotations
Annotations can be wrong. Chronicle provides a correction mechanism rather than silent overwrites, so the evolution of understanding is preserved.
# Flag an annotation as potentially inaccurate
# Apply a correction
Team workflows
Annotations are stored as git notes and can be synced across your team.
# Enable sync with your remote
# Pull annotations from teammates
# Check sync status
# Export/import for backups or migration
# Run diagnostics
Backfilling historical commits
Already have a repository with history? Chronicle can annotate past commits.
# Annotate the last 20 commits
Claude Code integration
Chronicle is designed to work seamlessly with Claude Code. After running git chronicle setup, Claude Code will:
- Read annotations before modifying code -- checking intent, constraints, and dependencies to avoid breaking assumptions
- Annotate after committing -- using the live path (zero LLM cost) since it already knows why it made each change
This creates a feedback loop: agents leave structured context for future agents, dramatically reducing regressions from lost reasoning.
How it works
Annotations are stored as git notes under refs/notes/chronicle. Each commit gets a structured JSON annotation containing:
- Summary -- what the commit accomplishes and why
- Regions -- per-function annotations with intent, reasoning, constraints, and dependencies
- Cross-cutting concerns -- patterns that span multiple regions
- Provenance -- how the annotation was produced (initial, amended, synthesized from squash)
Reading uses git blame to find which commits produced the lines you're looking at, then fetches their annotations. No external database, no index to build -- it's just git.
All commands
| Command | Description |
|---|---|
git chronicle setup |
One-time machine-wide setup (LLM provider, skills, hooks) |
git chronicle init |
Initialize Chronicle in the current repository |
git chronicle annotate |
Annotate a commit (--commit <sha> for batch, --live for stdin) |
git chronicle backfill |
Annotate historical commits |
git chronicle read |
Read annotations for a file (--anchor, --lines) |
git chronicle deps |
Find code that depends on a file/anchor |
git chronicle history |
Annotation timeline across commits |
git chronicle summary |
Condensed annotation overview for a file |
git chronicle show |
Interactive TUI explorer |
git chronicle flag |
Flag an annotation as potentially inaccurate |
git chronicle correct |
Apply a correction to an annotation field |
git chronicle context set |
Set pending context for the next commit |
git chronicle sync |
Manage notes sync (enable, status, pull) |
git chronicle export |
Export annotations as JSONL |
git chronicle import |
Import annotations from JSONL |
git chronicle doctor |
Run diagnostic checks |
git chronicle reconfigure |
Rerun LLM provider selection |
License
MIT