AI Code Tracker
Automatically tracks GitHub Copilot usage per file and injects AI-assisted metadata into your git commits — zero manual effort.
Features
- Automatic Copilot Detection — detects GitHub Copilot inline completions, chat insertions, and agent-mode edits
- Per-File Tracking — tracks AI vs manual edits and lines per file with language detection
- AI Model Detection — identifies the active model (GPT-4o, Claude, etc.) via VS Code's Language Model API
- Git Hook Integration — bundled
prepare-commit-msg hook auto-appends standardized AI trailers to every commit
- Per-Staging Snapshots — each commit reflects only the delta since
git add, not the entire session
- Pre-Push Validation — optional
pre-push hook warns when commits are missing AI-Assisted trailers
- Status Bar — live indicator showing Copilot status and AI-assisted file count
Commit Trailers
Every commit automatically gets trailers like:
feat: add user dashboard
AI-Assisted: partial
AI-Tool: copilot+copilot-chat
AI-Model: claude-opus-4.6
AI-Language: typescript, css
AI-Percentage: 65
AI-Lines-Percentage: 72
AI-Edits: 12
AI-Manual-Edits: 7
AI-Lines: 48
Manual-Lines: 19
Getting Started
Install from Marketplace
- Search for AI Code Tracker in the VS Code Extensions panel
- Click Install
- Reload VS Code
Install from .vsix
code --install-extension ai-code-tracker-0.1.0.vsix
Install Git Hooks
On first activation in a git repository, the extension prompts to install hooks. You can also install manually:
- Open Command Palette (
Ctrl+Shift+P)
- Run AI Tracker: Install Git Hooks
This copies the bundled hooks to .githooks/ and sets git config core.hooksPath .githooks.
Commands
| Command |
Description |
AI Tracker: Show Session Status |
Show current AI/manual edit counts |
AI Tracker: Reset Session |
Reset all tracking data |
AI Tracker: Snapshot Staged Files |
Manually snapshot staged file data |
AI Tracker: Show Model Info |
Show detected AI model details |
AI Tracker: Install Git Hooks |
Install prepare-commit-msg and pre-push hooks |
AI Tracker: Uninstall Git Hooks |
Remove hooks and restore default git hook path |
Settings
| Setting |
Default |
Description |
aiCodeTracker.enabled |
true |
Enable/disable AI usage tracking |
aiCodeTracker.trackerFileName |
.ai-tracker.json |
Name of the tracker file in repo root |
aiCodeTracker.selectedModel |
"" |
Override detected model name (leave empty for auto) |
aiCodeTracker.autoInstallHooks |
true |
Prompt to install hooks on activation |
How It Works
- Extension monitors
onDidChangeTextDocument events and correlates with Copilot activity
- Writes
.ai-tracker.json to the workspace root (debounced every 2s)
- When you
git add files, the extension snapshots their current AI/manual counts
- The
prepare-commit-msg hook reads the tracker and appends trailers to the commit message
- The tracker resets after each commit so counts don't accumulate
Pipeline Integration
The repo includes pipeline scripts for CI/CD integration:
parse-signals.js — extract and aggregate AI trailers from git log (JSON, CSV, summary formats)
post-pr-comment.js — post AI usage summary as an Azure DevOps PR comment
Building from Source
cd run/aicodetracker/automation/vscode-extension
npm install
npm run package # produces ai-code-tracker-0.1.0.vsix
Publishing
# Create a Personal Access Token at https://dev.azure.com
# Or use the VS Code Marketplace publisher at https://marketplace.visualstudio.com/manage
vsce login FTEngPlatform
npm run publish
Note: Update the publisher field in package.json to match your VS Code Marketplace publisher ID before publishing.
License
MIT