Skip to main content
Repr uses git post-commit hooks to automatically queue commits for story generation. Hooks run silently after each commit—no interruptions, no network calls, just quiet tracking.

How It Works

When you install a hook:
  1. Hook installed - repr creates .git/hooks/post-commit in your repo
  2. You commit - Git triggers the hook after each commit
  3. Commit queued - Hook adds commit SHA to ~/.repr/queue
  4. You generate - Run repr generate to turn queued commits into stories
Privacy guarantee: Hooks never make network calls. They just write commit SHAs to a local file.

Usage

Actions

install - Set up automatic tracking

Install the hook script in .git/hooks/post-commit. Options:
  • --all - Install in all tracked repositories
  • --repo <path> - Install in a specific repository
Examples:
Output:

remove - Uninstall hooks

Remove the hook script from repositories. Options:
  • --all - Remove from all tracked repositories
  • --repo <path> - Remove from a specific repository
Examples:
Output:

status - Check hook health

Check which repositories have hooks installed and view queue statistics. Options:
  • --json - Output as JSON for scripting
Examples:
Output:
JSON output:

queue - Internal command

Queue a specific commit (called by the git hook automatically). Usage:
This is an internal command used by the git post-commit hook. You shouldn’t need to call it manually.

What Gets Queued?

The hook captures:
  • Commit SHA (full 40-character hash)
  • Repository path
  • Timestamp
Not captured:
  • Commit diffs
  • File contents
  • Commit messages
Diffs are only read when you run repr generate, not during hook execution.

Hook Script

The installed hook is a simple bash script:
Key features:
  • Runs in background (&) - doesn’t slow down commits
  • Silent (2>/dev/null) - never interrupts your workflow
  • Always exits 0 - never blocks commits even if repr fails
  • No network calls - purely local file write

Workflow Examples

Daily Developer Flow

Selective Hook Usage

Maybe you want hooks on work projects but not personal ones:

Pausing Auto-Tracking

If you want to pause hook-based tracking without removing hooks:

Troubleshooting

Hook not running after commits

Check if it’s installed:
If not installed:

Hook conflicts with existing post-commit

If you already have a post-commit hook, repr’s installer will warn you. You can: Option 1: Merge manually
Option 2: Use hook managers like Husky or Lefthook

Queue not clearing after generate

The queue should auto-clear. If it doesn’t:
If problems persist, run repr doctor for diagnostics.

Hook making commits slow

Hooks run in the background and shouldn’t add noticeable latency. If commits feel slow:
  1. Check disk I/O - the hook writes a small file
  2. Check if ~/.repr/queue is huge (>10k entries) - this shouldn’t happen
  3. Run repr doctor to check for issues

Security & Privacy

What hooks can’t do:
  • ✗ Make network requests
  • ✗ Read file contents
  • ✗ Access environment variables
  • ✗ Modify your repository
  • ✗ Send data anywhere
What hooks do:
  • ✓ Read commit SHA from git
  • ✓ Write SHA to ~/.repr/queue (local file)
  • ✓ Exit immediately
You can inspect the hook script anytime:
  • repr generate - Process queued commits into stories
  • repr repos pause/resume - Control auto-tracking per repo
  • repr doctor - Diagnose hook issues