DifAI is a Visual Studio Code extension that helps you track and visualize AI-generated code in your projects. It automatically detects code snippets generated by various AI tools (like GitHub Copilot, Cursor, ChatGPT) and provides a timeline view of AI contributions and subsequent human edits.
Features
🔍 Automatic detection of AI-generated code
📊 Timeline visualization of AI contributions
🔄 Tracking of human edits to AI-generated code
💾 Persistent metadata storage
🤖 Support for multiple AI sources (Cursor, Copilot, etc.)
📝 Git-aware tracking and attribution
Installation
Open VS Code
Go to Extensions (Ctrl+Shift+X)
Search for "DifAI"
Click Install
Usage
Detecting AI Code
The extension automatically tracks AI-generated code as you use tools like Cursor or Copilot
Run the "Detect AI Generated Code" command to analyze existing files
AI-generated code will be highlighted with a subtle background color
Viewing Timeline
Open a file containing AI-generated code
Run the "Show AI Code Timeline" command
View the timeline of AI contributions and edits
Checking Logs
Run the "Show AI Detector Logs" command
View detailed logs in the Output panel
Features in Detail
AI Detection Methods
Direct integration with IDE events
Pattern-based detection
Statistical analysis
Git metadata analysis
Code structure analysis
Metadata Storage
Stores information in .aidetector.json
Tracks:
AI-generated lines
Timestamp of generation
Source of generation
Human edits
Editor information
Contributing
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)