Tracybot is a tool that traces AI-generated code back to the prompts that created it. It enables tracking for AI-assisted development by recording snapshots of your codebase at each AI interaction.
- AI Traceability - Map AI-generated lines of code back to their originating prompt
- Non-Invasive Storage - Hidden Git commits and refs keep your history clean
- Seamless Integration - Works with OpenCode CLI and Visual Studio Code
- Audit Trail - Review AI interactions to verify, debug, or understand code origins
- Team Sync - Push traces to remote for team collaboration
- OpenCode CLI — Install the opencode-plugin to automatically record snapshots during AI interactions. Requires OpenCode CLI to be installed - https://opencode.ai
- VS Code — Install the vscode-extension to view AI blame information. Available on the VS Code Marketplace.
This is the entry point to Tracybot. The extension can open AI Blame, prompt to initialize Tracybot in the current repository, and offer to install the OpenCode plugin.
You can install the extension directly within VS Code:
- Open VS Code and go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+X). - Search for
Tracybot. - Click Install.
Alternatively, visit the Tracybot VS Code Marketplace page and follow the instructions on the marketplace page.
When the extension activates, it adds an AI Blame status bar item on the right side of VS Code.
If Tracybot has not been initialized in the open repository yet, the extension offers to run initialization for you.
If you prefer to initialize from the terminal instead, run:
python /path/to/tracybot/init.py /path/to/your-target-repositoryRequirements:
- A Git repository
- Python 3 available as
python3orpython - An
originremote is optional; it is only needed for syncing Tracy refs and notes with a remote
If the VS Code extension is installed, it will prompt you to install the OpenCode plugin when it is missing.
You can install it either:
- Globally at
~/.config/opencode/plugin/tracybot-oc.js - Per project at
.opencode/plugin/tracybot-oc.js
After OpenCode makes changes in an initialized repository, Tracybot records snapshots automatically. Click AI Blame in VS Code to inspect the prompt history behind the current file.
Tracybot consists of three components that work together:
- opencode-plugin - Plugin for opencode CLI that records snapshots during AI interactions
- vscode-extension - VS Code extension to view AI blame information
- tracybot-tracking - Git hooks and scripts for state tracking using hidden commits and synced git notes
More information, including the requirements that resulted in these architectural decisions, are on the wiki.
No AI blame information showing
- Ensure the repository was initialized with
init.py - Verify VS Code extension is installed
- Check that OpenCode has already produced tracked changes in this repository
Snapshots not being created
- Check that the OpenCode plugin is installed and loaded
- Verify Tracybot was initialized successfully in the repository
- Verify Git hooks are installed under
.git/hooks/ - Check for errors in the OpenCode output
Push sync not working
- Ensure an
originremote is configured - Check that the
pre-pushhook is installed - Verify Git notes are being pushed
python ./init.py /path/to/target-repositoryIf you run init.py from inside a Git repository, you can omit the explicit path.
cd vscode-extension
npm install
npm run compileOpen vscode-extension in VS Code and press F5 to launch the extension host.
cd opencode-plugin
bun install
bun run deploybun run deploy builds the plugin and installs it into the global OpenCode plugin directory.
If you are testing packaging or release artifacts manually:
- Download
vscode-extension.vsixfrom the latest release and install it withcode --install-extension vscode-extension.vsixor VS Code'sInstall from VSIX...action. - Download
tracybot-oc.jsfrom the same release and place it in either~/.config/opencode/plugin/or<repo>/.opencode/plugin/.
