The problem: AI generates code that compiles and looks correct. But it silently drops edge case handling, hardcodes secrets, catches exceptions with bare except/pass, and uses mutable defaults. You deploy it. It breaks. Reddit is full of "I let Claude loose and it broke the entire site" stories.
The solution: One command scans any Python file for 8 categories of AI-code bugs. Critical → High → Medium → Low severity. Production-readiness score 0-100. Don't deploy AI code blind.
bash
pip install git+https://github.com/minirr890112-byte/code-inspector.git
code-inspector app.py # scan a file
cat app.py | code-inspector # scan from pipe
CheckSeverityExampleHardcoded secrets🔴 criticalapi_key = "sk-abc123"Unsafe eval/exec🔴 criticaleval(user_input)Infinite loops🔴 criticalappend-while-iteratingMutable defaults🟠 highdef fn(items=[])Shadowed builtins🟠 highlist = [1,2,3]Bare except/pass🔴 criticalexcept: passDeep nesting🟡 medium5+ nested loopsUnused imports⚪ lowAST-based detection
text
90-100: 🟢 PRODUCTION-READY
70-89: 🟡 NEEDS REVIEW
50-69: 🟠 HIGH RISK
0-49: 🔴 DO NOT DEPLOY
⭐ Star this repo if AI code has ever broken your production: github.com/minirr890112-byte/code-inspector