sift-autopsy
v1.0.1
Published
Autopsy AI-generated code changes. Detect hallucinated APIs, risky code, and unnecessary complexity.
Maintainers
Readme
Sift 🔍
The "Autopsy" Suite for AI-Generated Code
Sift is a powerful, interactive code critic designed to bridge the gap between AI code generation and human understanding. It uses a Deterministic + AI approach to catch hallucinations, risky patterns, and unnecessary complexity in your git diffs.
🚀 Quick Start
1. Installation
npm install -g sift-autopsy2. Authenticate
Get a free API key from Groq and connect it:
sift auth gsk_your_key_here3. Initialize your Project (Recommended)
This creates a sift.config.json file where you can customize Sift's behavior:
sift initCheck out the full Configuration Guide for advanced settings.
4. Launch the Cockpit
Start the interactive TUI to browse findings and watch changes live:
sift tui✨ Key Features
🛠️ Interactive TUI Cockpit
Browse your code findings in a rich terminal interface. Navigate with arrow keys, preview snippets, and trigger AI autopsies on demand.
💓 Live Watch Mode
The "Heartbeat" of Sift. Turn on Watch Mode (W) to have Sift monitor your codebase live. As you save files, the TUI refreshes instantly with new findings.
🕵️ Deterministic Critics
Sift doesn't just guess. It uses a suite of local critics to find objective issues:
- Hallucination Critic: Detects non-existent APIs often "invented" by LLMs.
- Risk Critic: Flags dangerous patterns (e.g., raw
eval, hardcoded secrets). - Complexity Critic: Identifies code that is harder to read than it needs to be.
🧠 AI Autopsy (ELI5)
When you need a deeper explanation, Sift calls upon its "Wise Mentor" AI to provide:
- Teachable Analogies: Explaining complex bugs like you're 10.
- Rewrite Suggestions: Better ways to structure your logic.
- Deep Context: Why the code was flagged in the first place.
🎹 Keyboard Shortcuts (TUI)
| Key | Action |
|-----|--------|
| S | Open Settings Menu |
| W | Toggle Live Watch Mode |
| L | Manually trigger AI Autopsy |
| ↑ / ↓ | Navigate Findings |
| Q | Exit Sift |
📖 Under the Hood
Want to know how Sift actually works? Check out our Architecture Deep Dive (ELI10).
❓ Troubleshooting
"Command Not Found" (sift is not recognized)
If you've installed Sift globally but your terminal can't find it, your NPM global bin folder might not be in your system's PATH.
Windows Fix (PowerShell):
$npmPath = "C:\Users\yugan\AppData\Roaming\npm"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";" + $npmPath, "User")Note: You must restart your terminal after running this.
🛡️ Privacy & Security
- Local First: Analysis starts on your machine.
- Minimal Data: Only the relevant code snippets are sent to the AI for enrichment.
- Secure Auth: Your keys are stored locally in
~/.siftcfg.
📄 License
MIT © Yugank Das
