Claude Code Integration
partio has first-class support for Claude Code, Anthropic’s AI coding assistant. When you use Claude Code in a partio-enabled repository, sessions are automatically captured alongside your commits.Detection
partio detects Claude Code by checking for a running Claude Code process. When the pre-commit hook fires, it:- Checks if a Claude Code process is active on the system
- Locates the latest session file in the repository
What gets captured
For each commit made while Claude Code is active, partio captures:| File | Contents |
|---|---|
full.jsonl | The complete JSONL transcript of the Claude Code session |
context.md | A summary of the session context |
prompt.txt | The initial prompt that started the session |
metadata.json | Session metadata (agent, token count, duration) |
Session metadata
JSONL format
Thefull.jsonl file contains the raw Claude Code session transcript. Each line is a JSON object representing one turn in the conversation. This is the same format used by Claude Code’s internal session logging.
Attribution
partio calculates what percentage of the commit diff was produced by the AI agent. This is added as a Git trailer:100% attribution if an agent was active.
Commit trailers
After each checkpoint, your commit message is amended with:Troubleshooting
Checkpoints not being created
- Run
partio doctorto check installation health - Verify Claude Code is running when you commit — partio only captures when it detects an active process
- Check log output with
partio --log-level debug status - Verify hooks are installed — look for
# Installed by partioin.git/hooks/post-commit
Session file not found
Claude Code stores session files in your home directory. If partio can’t find the session:- Ensure Claude Code has been used in the current repository at least once
- Check that the session file hasn’t been cleaned up before the commit
Attribution shows 100% unexpectedly
If attribution calculation fails, partio defaults to 100% when an agent is active. This can happen if:- The commit has no parent (initial commit)
- The diff cannot be computed
Hooks conflict with existing hooks
partio backs up existing hooks as<hook-name>.partio-backup and chains to them after its own logic. If you’re experiencing conflicts:
- Check
.git/hooks/for backup files - Run
partio disablethenpartio enableto reinstall - Verify the hook scripts contain the
# Installed by partiomarker