Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick Start

This guide will get you tracking AI-generated code in under 5 minutes.

1. Install whogitit

# Install whogitit (if not already done)
cargo install --path /path/to/whogitit

2. Run Global Setup (once)

whogitit setup

This configures Claude Code integration automatically.

3. Initialize Your Repository

cd your-project
whogitit init

4. Verify Setup

whogitit doctor

You should see all checks passing.

5. Write Some Code with Claude

Use Claude Code to make changes to your project. For example:

> Add a function that validates email addresses

Claude will edit or create files. whogitit automatically captures:

  • The file content before the edit
  • The file content after the edit
  • The prompt you used

6. Check Pending Attribution

Before committing, see what whogitit has captured:

whogitit status

Output:

Pending AI attribution:
  Session: 7f3a-4b2c-9d1e-8a7b
  Files: 2
  Edits: 3
  Lines: 45

Run 'git commit' to finalize attribution.

7. Commit Your Changes

Commit as normal:

git add .
git commit -m "Add email validation"

The post-commit hook automatically:

  1. Analyzes the pending changes
  2. Performs three-way diff analysis
  3. Attaches attribution data as a git note

8. View Attribution

See AI attribution for a file

whogitit blame src/validation.rs

Output:

 LINE   │ COMMIT  │ AUTHOR     │ SRC │ CODE
─────────────────────────────────────────────────────────────────────────────────────
    1   │ a1b2c3d │ Greg King  │  ●  │ use regex::Regex;
    2   │ a1b2c3d │ Greg King  │  ●  │
    3   │ a1b2c3d │ Greg King  │  ●  │ pub fn validate_email(email: &str) -> bool {
    4   │ a1b2c3d │ Greg King  │  ◐  │     let pattern = r"^[a-zA-Z0-9._%+-]+@";  // simplified
    5   │ a1b2c3d │ Greg King  │  ●  │     let re = Regex::new(pattern).unwrap();
    6   │ a1b2c3d │ Greg King  │  ●  │     re.is_match(email)
    7   │ a1b2c3d │ Greg King  │  ●  │ }
─────────────────────────────────────────────────────────────────────────────────────
Legend: ● AI (6) ◐ AI-modified (1)
AI involvement: 100% (7 of 7 lines)

See the commit summary

whogitit show HEAD

Output:

Commit: a1b2c3d
Session: 7f3a-4b2c-9d1e-8a7b
Model: claude-opus-4-5-20251101
Started: 2026-01-30T14:23:17Z

Prompts used:
  #0: "Add a function that validates email addresses..."

Files with AI changes:
  src/validation.rs (6 AI, 1 modified) - 7 total lines

Summary:
  6 AI-generated lines
  1 AI line modified by human

Find the prompt that generated a line

whogitit prompt src/validation.rs:3

Output:

╔════════════════════════════════════════════════════════════════════╗
║  PROMPT #0 in session 7f3a-4b2c-9d1e...                            ║
║  Model: claude-opus-4-5-20251101 | 2026-01-30T14:23:17Z            ║
╠════════════════════════════════════════════════════════════════════╣
║  Add a function that validates email addresses                      ║
╚════════════════════════════════════════════════════════════════════╝

Files affected by this prompt:
  - src/validation.rs

9. Push with Attribution

When you push, git notes are automatically included:

git push

The pre-push hook handles git push origin refs/notes/whogitit automatically.

What’s Next?