Skip to content

CNuhlar/prompt-tracker-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

prompt-tracker

A Claude Code plugin that logs every prompt and the code diff it produces. Built for analyzing Claude Code's response accuracy.

What it does

Every time you send a prompt to Claude Code that results in code changes, this plugin records:

  • Your exact prompt text
  • The git diff of all code changes (committed + uncommitted + new files)
  • Timestamps (prompt submitted, Claude stopped)
  • Files changed list and count
  • Git HEAD before and after

Prompts that don't produce code changes are skipped.

Install

# Add as a marketplace source
/plugin marketplace add your-github-username/prompt-tracker-plugin

# Install the plugin
/plugin install prompt-tracker

Or test locally:

claude --plugin-dir /path/to/prompt-tracker-plugin

Usage

The plugin works automatically in the background. Just use Claude Code normally in any git repo.

View logs

Use the slash command:

/prompt-tracker:view-log              # today's entries
/prompt-tracker:view-log 2026-04-21   # specific date
/prompt-tracker:view-log --all        # all entries
/prompt-tracker:view-log --stats      # summary statistics
/prompt-tracker:view-log --json       # raw JSONL for scripting

Log format

Logs are stored as JSONL at ~/.prompt-tracker/logs/YYYY-MM-DD.jsonl (or in the plugin data directory if installed via marketplace).

Each line is a JSON object:

{
  "session_id": "abc123",
  "prompt": "add error handling to the upload function",
  "prompt_timestamp": "2026-04-21T14:30:00Z",
  "stop_timestamp": "2026-04-21T14:31:15Z",
  "cwd": "/home/user/my-project",
  "head_before": "a1b2c3d4",
  "head_after": "e5f6g7h8",
  "diff": "--- a/upload.js\n+++ b/upload.js\n...",
  "files_changed": ["upload.js"],
  "file_count": 1,
  "new_files": []
}

Requirements

  • jq (for JSON processing)
  • git (diffs are git-based)
  • Only works inside git repositories

How it works

Two hooks:

  1. UserPromptSubmit — fires when you send a prompt. Snapshots the git state (HEAD rev, baseline diff, untracked files).
  2. Stop — fires when Claude finishes. Computes the diff between the snapshot and current state, subtracts any pre-existing changes, and logs the entry.

License

MIT

About

Claude Code plugin that tracks prompts and the code diffs they produce. For accuracy analysis.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages