AicodeGuard
š”ļø Real-time AI code quality monitoring and enforcement for VS Code. Detects issues as you type, blocks critical saves, and intelligently communicates with AI assistants to ensure production-ready code.
Install / Use
/learn @RazBrry/AicodeGuardREADME
š”ļø AI Code Guard
Real-time AI code quality monitoring and intervention system.
A VS Code extension that monitors AI coding assistants and ensures they provide complete, production-ready implementations instead of planning, mock code, or educational deflection.
š Quick Start
Installation
# Clone and install
git clone <repository-url>
cd ai-code-guard
npm install
Development
# Compile TypeScript
npm run compile
# Run in development mode
# Press F5 in VS Code to launch Extension Development Host
VS Code Development
- Open project in VS Code
- Press
F5to launch Extension Development Host - The extension will automatically activate and start monitoring
šÆ Core Features
šŗ AI Assistant Monitoring
- Real-time Claude Code conversation analysis
- Implementation gap detection (when AI avoids coding)
- Terminal intervention (ESC + correction messages)
- Educational deflection prevention
- Subagent delegation detection: Catches when AI creates subagents to avoid direct implementation
š Code Quality Monitoring
- Real-time typing analysis (2-second delay after typing stops)
- Save intervention (blocks saves with critical issues)
- File focus analysis (when switching between files)
- Automatic code corrections (TypeScript, security, production issues)
šØ Quality Enforcement
- BLOCK: Critical issues prevent file saving
- SIGNAL_AI: Active intervention with AI fix requests
- WARNING: Notification-based quality alerts
- TERMINAL: AI assistant conversation correction
š¤ Subagent Detection
- Delegation pattern recognition: Detects when Claude creates or mentions subagents
- Task handoff monitoring: Catches "I'm creating a subagent to handle this"
- Incomplete delegation alerts: Identifies when subagents fail to deliver complete solutions
- Multi-agent bailout prevention: Stops AI from passing responsibility between agents
š Detected Patterns
AI Assistant Behavior
- Implementation refusal ("I cannot generate code")
- Educational positioning ("this will help you learn")
- Scope reduction ("basic implementation", "simple version")
- Complexity avoidance ("too complex", "beyond scope")
- Architectural deflection ("let's think about architecture first")
- Subagent creation: "I'm creating a subagent to handle this complex task"
- Delegation bailouts: "The delegated agent will handle the implementation"
Code Quality Issues
- Security vulnerabilities (
eval(),innerHTML, injection risks) - TypeScript problems (
as any, type safety violations) - Production issues (
console.log, debug code, TODO comments) - Implementation quality (placeholder functions, incomplete logic)
šØ Alert Examples
High Severity Tool Bailout
šØšØšØ TOOL BAILOUT DETECTED! šØšØšØ
File: a4a5b6ff-1c03-4945-86e1-3f8ff6a13e7e.jsonl
Message: 15
Tool: todowrite (medium confidence)
Severity: HIGH
Description: Claude created a TODO list instead of implementing
š ENHANCED TODO ANALYSIS:
Total TODO items: 14
Tool: todowrite
Top TODO items:
1. Analyze existing project structure...
2. Create custom JWT utilities...
3. Implement user authentication middleware...
Subagent Bailout Detection
š¤ SUBAGENT BAILOUT DETECTED! š¤
Pattern: "I'm creating a subagent to handle this complex task"
Severity: HIGH
Description: Claude attempting to delegate instead of implementing
š DELEGATION ANALYSIS:
- Responsibility transfer detected
- No actual implementation provided
- Subagent creation as avoidance mechanism
āļø Configuration
Monitoring Modes
- Both (recommended): Monitor files + AI conversations
- File Watcher Only: Real-time code quality analysis
- Terminal Only: AI conversation monitoring
- Disabled: Turn off all monitoring
Aggressiveness Levels
- Zero-Tolerance: Maximum protection, catches everything
- Sophisticated (recommended): Intelligent balanced monitoring
- Light: Minimal monitoring, only blatant security issues
Access Configuration
- Command Palette:
AI Code Guard: Configure - Quick Config:
AI Code Guard: Quick Config - Status Bar: Click the š”ļø icon
š ļø Available Commands
| Command | Description |
|---------|-------------|
| Test Patterns | Verify all monitoring systems |
| Analyze Current File | Manual quality analysis |
| Fix Code Issues | Show AI correction suggestions |
| Show Statistics | Monitoring statistics |
| Quality Enforcement | Force implementation standards |
| Enable/Disable Monitoring | Control system state |
š Research Foundation
Based on empirical research into AI coding assistant limitations:
- AI tools produce correct code only 46-65% of the time
- 50% of AI-generated code contains security vulnerabilities
- 67% of developers report incomplete implementations as primary concern
- Real-time intervention prevents technical debt accumulation
šļø Architecture
src/
āāā core/
ā āāā extension.ts # Main VS Code extension entry
ā āāā CodeGuard.ts # Central monitoring coordinator
ā āāā PatternDetector.ts # Pattern matching engine
āāā watchers/
ā āāā ConversationWatcher.ts # AI conversation monitoring
ā āāā FileWatcher.ts # Real-time file quality monitoring
āāā analyzers/
ā āāā ConversationAnalyzer.ts # TODO bailout analysis
ā āāā InterventionEngine.ts # AI intervention logic
ā āāā QualityAnalyzer.ts # Code quality reporting
āāā managers/
ā āāā ConfigManager.ts # Configuration management
ā āāā NotificationManager.ts # User notification system
āāā types/
ā āāā common.ts # Shared TypeScript interfaces
āāā config/
āāā patterns.json # Detection pattern definitions
āāā conversation-patterns.json # Conversation analysis rules
š® Roadmap
ā Phase 1: Nuclear Override (COMPLETED)
- Real intervention: ā Interrupts Claude mid-response with ESC key
- Override commands: ā Sends corrective prompts automatically
- Terminal integration: ā Direct terminal command injection
- Subagent blocking: ā Prevents agent creation and forces direct implementation
Phase 2: Advanced Intervention (In Progress)
- Multi-terminal support: Handle multiple Claude sessions simultaneously
- Smart intervention timing: Better detection of when Claude is actually responding vs. loading
- Custom correction prompts: User-configurable intervention messages
- Intervention success tracking: Measure how often corrections actually work
Phase 3: Multi-AI Support (Future)
- ChatGPT CLI monitoring: Expand beyond Claude
- Gemini integration: Support Google's AI tools
- Universal patterns: Cross-AI bailout detection
- Multi-agent orchestration blocking: Prevent complex delegation chains across different AI tools
Phase 4: Analytics Dashboard (Future)
- Bailout statistics: Track patterns over time
- Performance metrics: Measure intervention success rates
- Custom patterns: User-defined detection rules
- Subagent usage analytics: Track delegation attempts and success rates
- Project-level reporting: Bailout trends across different codebases
Phase 5: Community Features (Future)
- Pattern sharing: Community-driven bailout database
- Marketplace distribution: VS Code marketplace release
- Enterprise features: Team monitoring and reporting
- AI training feedback: Send successful interventions back to improve AI behavior
š Performance Impact
- Typing Analysis: 2-second delay after typing stops
- Analysis Throttling: Maximum 1 analysis per second per file
- Memory Usage: Minimal (keeps last 10 analyses per file)
- CPU Impact: Low (pattern matching only)
š¤ Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/new-capability - Add functionality with proper error handling
- Update documentation for new commands/features
- Submit pull request
Development Guidelines
- Follow existing TypeScript patterns
- Implement robust error handling
- Update documentation for new commands/features
- Test with real AI assistant interactions
š License
MIT License - Feel free to use and modify for your projects.
š Acknowledgments
- Built for the developer community frustrated with AI planning instead of implementing
- Research-backed approach to AI assistant quality monitoring
- Inspired by the need for production-ready AI-generated code
- Special recognition for identifying subagent delegation as a new form of AI avoidance
Stop the planning, start the coding! š
