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

Data Formats

This document describes the JSON schemas used by whogitit.

AIAttribution (Git Notes)

The primary data structure stored in git notes:

{
  "schema_version": 2,
  "session": {
    "session_id": "7f3a4b2c-9d1e-8a7b-c3d4-e5f6a7b8c9d0",
    "model": {
      "id": "claude-opus-4-5-20251101",
      "provider": "anthropic"
    },
    "started_at": "2026-01-30T14:23:17Z",
    "cwd": "/path/to/project"
  },
  "prompts": [
    {
      "index": 0,
      "text": "Add user authentication with bcrypt...",
      "affected_files": ["src/auth.rs", "src/main.rs"],
      "timestamp": "2026-01-30T14:23:45Z"
    }
  ],
  "files": [
    {
      "path": "src/auth.rs",
      "lines": [
        {"line_number": 1, "source": "AI", "prompt_index": 0},
        {"line_number": 2, "source": "AI", "prompt_index": 0},
        {"line_number": 3, "source": "AIModified", "prompt_index": 0},
        {"line_number": 4, "source": "Human", "prompt_index": null},
        {"line_number": 5, "source": "Original", "prompt_index": null}
      ],
      "summary": {
        "ai_lines": 2,
        "ai_modified_lines": 1,
        "human_lines": 1,
        "original_lines": 1
      }
    }
  ]
}

Schema Fields

FieldTypeDescription
schema_versionnumberFormat version (currently 2)
sessionobjectAI session information
promptsarrayPrompts used in this commit
filesarrayPer-file attribution

Session Object

FieldTypeDescription
session_idstringUnique session identifier
model.idstringModel identifier
model.providerstringModel provider
started_atstringISO 8601 timestamp
cwdstringWorking directory

Prompt Object

FieldTypeDescription
indexnumberOrder within session
textstringPrompt text (may be redacted)
affected_filesarrayFiles changed by this prompt
timestampstringWhen prompt was given

LineAttribution Object

FieldTypeDescription
line_numbernumber1-indexed line number
sourcestringAI, AIModified, Human, Original, Unknown
prompt_indexnumber|nullIndex of generating prompt

PendingBuffer

Temporary storage during editing session:

{
  "schema_version": 2,
  "session": {
    "session_id": "7f3a4b2c-9d1e-8a7b-c3d4-e5f6a7b8c9d0",
    "model": {
      "id": "claude-opus-4-5-20251101",
      "provider": "anthropic"
    },
    "started_at": "2026-01-30T14:23:17Z",
    "cwd": "/path/to/project"
  },
  "files": {
    "src/auth.rs": {
      "original_content": "// Original file content\n...",
      "edits": [
        {
          "content": "// After first AI edit\n...",
          "prompt_index": 0,
          "timestamp": "2026-01-30T14:23:45Z",
          "tool": "Edit"
        },
        {
          "content": "// After second AI edit\n...",
          "prompt_index": 1,
          "timestamp": "2026-01-30T14:25:00Z",
          "tool": "Write"
        }
      ]
    }
  },
  "prompts": [
    {
      "index": 0,
      "text": "Add user authentication...",
      "affected_files": ["src/auth.rs"],
      "timestamp": "2026-01-30T14:23:45Z"
    }
  ]
}

FileEditHistory

FieldTypeDescription
original_contentstringFile content before AI session
editsarraySequence of AI edits

AIEdit

FieldTypeDescription
contentstringFile content after this edit
prompt_indexnumberWhich prompt triggered this
timestampstringWhen edit occurred
toolstringEdit or Write

Export Format

Output of whogitit export:

{
  "export_version": 1,
  "exported_at": "2026-01-30T15:00:00Z",
  "date_range": {
    "since": "2026-01-01",
    "until": "2026-01-31"
  },
  "commits": [
    {
      "commit_id": "abc123def456789...",
      "commit_short": "abc123d",
      "message": "Add user authentication",
      "author": "Greg King",
      "committed_at": "2026-01-30T14:30:00Z",
      "session_id": "7f3a4b2c-9d1e-8a7b-c3d4-e5f6a7b8c9d0",
      "model": "claude-opus-4-5-20251101",
      "ai_lines": 145,
      "ai_modified_lines": 12,
      "human_lines": 43,
      "original_lines": 50,
      "files": ["src/auth.rs", "src/main.rs"],
      "prompts": [
        {
          "index": 0,
          "text": "Add user authentication...",
          "affected_files": ["src/auth.rs"]
        }
      ]
    }
  ],
  "summary": {
    "total_commits": 10,
    "commits_with_ai": 7,
    "total_ai_lines": 523,
    "total_ai_modified_lines": 45,
    "total_human_lines": 128,
    "total_original_lines": 89,
    "total_prompts": 15
  }
}

Annotations Output Format

Output of whogitit annotations --format github-checks:

{
  "annotations": [
    {
      "path": "src/main.rs",
      "start_line": 42,
      "end_line": 48,
      "annotation_level": "notice",
      "title": "AI Generated (7 lines)",
      "message": "Model: claude-opus-4-5-20251101 | Session: 2024-01-15\n\n**Breakdown:** 5 AI, 2 AI-modified, 0 human, 0 original\n\n**Prompt:** Add error handling...",
      "raw_details": "Add error handling with retry logic..."
    }
  ],
  "summary": {
    "files_analyzed": 5,
    "models": ["claude-opus-4-5-20251101", "claude-sonnet-4-20250514"],
    "session_range": "2024-01-15 to 2024-01-20"
  }
}

Annotation Object

FieldTypeDescription
pathstringFile path relative to repository root
start_linenumberStarting line number (1-indexed)
end_linenumberEnding line number (inclusive)
annotation_levelstringAlways notice for AI attribution
titlestringShort title (e.g., “AI Generated (7 lines)”)
messagestringDetailed message with model, breakdown, and prompt
raw_detailsstring|nullFull prompt text (optional)

Summary Object

FieldTypeDescription
files_analyzednumberNumber of files with AI attribution
modelsarrayAll AI models used across the commits
session_rangestring|nullDate range (e.g., “2024-01-15 to 2024-01-20”)

Annotation Title Formats

Source TypeTitle Format
AI“AI Generated (N lines)”
AIModified“AI Modified (N lines)”
AIRelated (grouped)“AI Related (N lines: X AI, Y AI-modified)”
File-level (new)“New file (N lines) generated by AI”
File-level (existing)“X% AI-generated (N of M lines)”

Audit Log Format

Each line in .whogitit/audit.jsonl is a JSON object, including prev_hash and event_hash fields for tamper‑evident chaining:

event_hash is computed over the event content including prev_hash, so any reordering or tampering breaks the chain. Malformed lines cause verification to fail.

{"timestamp":"2026-01-30T14:23:15Z","event":"Delete","details":{"commit":"abc123d","user":"greg","reason":"Retention policy"}}
{"timestamp":"2026-01-28T10:15:00Z","event":"Export","details":{"commit_count":45,"format":"json","user":"greg"}}
{"timestamp":"2026-01-25T09:00:00Z","event":"RetentionApply","details":{"commits":12,"user":"greg","reason":"Quarterly"}}
{"timestamp":"2026-01-20T16:30:00Z","event":"ConfigChange","details":{"user":"greg","field":"max_age_days"}}
{"timestamp":"2026-01-15T11:45:00Z","event":"Redaction","details":{"pattern_name":"API_KEY","redaction_count":3}}

Event Types

TypeDescriptionDetails Fields
DeleteAttribution deletedcommit, user, reason
ExportData exportedcommit_count, format, user
RetentionApplyRetention policy appliedcommits, user, reason
ConfigChangeConfiguration changeduser, field
RedactionSensitive data redactedpattern_name, redaction_count

Configuration Format

.whogitit.toml:

[privacy]
enabled = true
use_builtin_patterns = true
disabled_patterns = ["EMAIL"]
audit_log = true

[[privacy.custom_patterns]]
name = "INTERNAL_ID"
pattern = "INT-[A-Z0-9]{8}"
description = "Internal IDs"

[retention]
max_age_days = 365
auto_purge = false
retain_refs = ["refs/heads/main"]
min_commits = 100

See Configuration for full reference.

Hook Input Format

JSON passed to hooks via stdin:

{
  "tool_name": "Edit",
  "tool_input": {
    "file_path": "/path/to/file.rs",
    "old_string": "...",
    "new_string": "..."
  },
  "transcript_path": "/tmp/claude-transcript-xyz.jsonl"
}

For Write tool:

{
  "tool_name": "Write",
  "tool_input": {
    "file_path": "/path/to/file.rs",
    "content": "..."
  },
  "transcript_path": "/tmp/claude-transcript-xyz.jsonl"
}

Version History

VersionChanges
2Current version. Full content snapshots.
1Initial version. Diff-based storage. (deprecated)

See Also