aide-cli
Version:
AIDE - The companion control system for Claude Code with intelligent task management
635 lines (478 loc) ⢠18.8 kB
Markdown
# šÆ AIDE - Adaptive Intelligent Development Enhancer
**Unlock the Full Potential of Claude Code with Advanced Project Memory & Planning**
AIDE is a specialized tool designed to **supercharge your Claude Code experience**. We don't compete with Claude Code - we amplify it by adding persistent memory, intelligent planning, and adaptive project management that Claude Code currently lacks.
Transform Claude Code into an adaptive AI assistant that learns from your patterns, handles interruptions intelligently, and maintains persistent context across sessions.
## ā” Quick Start
```bash
# Step 1: Install AIDE globally
npm install -g aide-cli@latest
# Step 2: Run the installation command
aide install
```
**ā ļø IMPORTANT: Do NOT use npx** - It has known issues with hanging and incomplete installations. Always use the two-step npm installation process above.
That's it! AIDE installs with **daemon mode enabled by default** for seamless command execution. Open Claude Code and start working - AIDE will activate automatically.
## š What is AIDE?
AIDE is the **companion control system** for Claude Code that manages every aspect of your development workflow:
### šÆ Central Task Control
- **Controls ALL Actions**: Every file edit, command, and code generation goes through AIDE
- **Automatic Task Management**: Creates, tracks, and completes tasks automatically
- **Intelligent Feedback Loop**: Learns from every action to improve future suggestions
- **Context Preservation**: Maintains complete project state across sessions
### š¤ How AIDE Works as Claude's Companion
- **Pre-processes** every action before execution
- **Tracks** all tasks and subtasks automatically
- **Provides** real-time context to Claude
- **Manages** interruptions and priority changes
- **Learns** from your patterns to optimize workflow
### š Perfect Companion to Claude Code
- ā
**Works WITH Claude Code** - not against it
- ā
**Enhances** Claude's capabilities with persistent memory
- ā
**Adds** intelligent project planning to any Claude session
- ā
**Preserves** context between Claude Code sessions
- ā
**Complements** Claude's natural language understanding
### š Key Features
**Task Control System**:
- **š Automatic Task Creation**: Detects when tasks are needed from user input
- **š Task Hierarchy**: Manages tasks, subtasks, and dependencies
- **š Pre-Task Processing**: Analyzes every action before execution
- **š Progress Tracking**: Real-time progress with completion rates
**Intelligence Features**:
- **š§ Persistent Memory**: Remembers all decisions and patterns
- **š Smart Adaptation**: 4 strategies for handling interruptions
- **šÆ Pattern Learning**: Improves suggestions based on your habits
- **šø Context Snapshots**: Branch and resume work anytime
- **š® Confidence Scoring**: Shows certainty for each decision
**Advanced Capabilities**:
- **š¤ ML Analysis**: Complexity prediction and optimization
- **ā” Performance Insights**: Project performance analysis
- **ā±ļø Time Estimation**: Predictive timeline generation
- **š„ Collaboration**: Team features and sharing
## š AIDE vs Regular Claude Code
| Feature | Regular Claude Code | AIDE Enhanced |
|---------|-------------------|------------------|
| Memory | Session only | Persistent across sessions |
| Interruptions | Basic response | 4 intelligent strategies |
| Progress | Estimates | Real calculation |
| Adaptation | Manual | Automatic detection |
| Context | Lost on restart | Preserved via snapshots |
| Learning | None | Learns user patterns |
## š How It Works
### Automatic Activation
AIDE activates automatically when you start working:
```
You: "Create a React dashboard with analytics"
Claude: [AIDE initializes] ā [Sets objective] ā [Tracks progress]
```
### Intelligent Interruption Handling
AIDE detects when you change direction:
```
You: "Actually, add authentication first"
Claude: š AIDE: Detected requirement change
Current progress: 30% on dashboard
Strategy: MERGE - integrate auth while building dashboard
```
### Smart Strategies
1. **MERGE** - Integrate changes without losing progress
2. **BRANCH** - Save state, handle urgent task, resume later
3. **REPLAN** - Create new plan incorporating changes
4. **DEFER** - Complete current task first, then address request
## šÆ How AIDE Controls Claude Code
### Task Control Flow
1. **User Request** ā AIDE analyzes and creates task
2. **Claude Action** ā AIDE pre-processes and tracks
3. **Execution** ā AIDE monitors and provides feedback
4. **Completion** ā AIDE updates progress and learns
### Example Workflow
```bash
User: "Create a REST API for user management"
Claude (internally):
1. aide-task add "Create REST API for user management" high
2. aide-task start <task_id>
3. aide-pre-task file create "app.py" # Before creating file
4. aide-pre-task code "FastAPI user routes" python # Before writing code
5. aide-task complete <task_id> "Basic API structure created"
```
### Continuous Feedback
- AIDE tracks EVERY action Claude takes
- Builds a complete history of decisions
- Learns patterns to improve future suggestions
- Provides context for better decision making
## ā” Critical Auto-Execution Rules
**IMPORTANT**: After installation, Claude Code will automatically follow these mandatory rules:
### š¤ Automatic AIDE Behavior
Claude Code will **automatically execute** these commands without asking permission:
1. **š Auto-Detection**: Always checks `ls -la .aide/` before starting any work
2. **š Auto-Initialize**: If `.aide/` missing, immediately runs `aide-init`
3. **šÆ Auto-Track**: When you give an objective, immediately runs `aide-track "your objective"`
4. **š Auto-Status**: Shows intelligent progress with `aide-status`
5. **š Auto-Adapt**: When you change direction, immediately runs `aide-adapt "your change"`
### šØ Critical: These Are NOT Suggestions
- ā Claude Code will **NOT ask permission** to run AIDE commands
- ā Claude Code will **NOT suggest** running them manually
- ā Claude Code will **NOT use wrapper scripts**
- ā
Claude Code will **AUTOMATICALLY EXECUTE** daemon commands
- ā
Commands run instantly: `aide-init`, `aide-track`, `aide-status`, `aide-adapt`
### š Example Auto-Execution
```
You: "Help me build a FastAPI application"
Claude Code: [runs ls -la .aide/] ā [runs aide-init] ā [runs aide-track "build FastAPI application"]
Claude Code: [runs aide-status] Shows progress and begins work
You: "Actually, add authentication first"
Claude Code: [runs aide-adapt "add authentication first"] ā Shows strategy and adapts
```
This behavior is **built into CLAUDE.md** and ensures AIDE works seamlessly without interruption.
## š Commands
```bash
# After npm installation, run this to configure Claude Code
aide install
# Install without daemon (direct Python execution)
aide install --no-daemon
# Explicitly enable daemon mode
aide install --daemon
# Verify installation
aide verify
# Show current project status
aide status
# Uninstall (keeps backups)
aide uninstall
# Force reinstall
aide install --force
# Use specific Python version
aide install --python python3.11
# Daemon control commands (when daemon mode is enabled)
aide-daemon start # Start AIDE daemon
aide-daemon stop # Stop AIDE daemon
aide-daemon status # Check daemon status
# Task management commands (NEW in v2.1.0)
aide-task # Show current task status
aide-task add "<description>" [priority] # Add new task
aide-task start <task_id> # Start working on task
aide-task complete <task_id> # Mark task as complete
aide-task status # Show all tasks
# Pre-task processing (used internally by Claude)
aide-pre-task file <operation> <path> # Before file operations
aide-pre-task command <cmd> <args> # Before command execution
aide-pre-task code "<desc>" <language> # Before code generation
```
## š§ Installation Options
### Default Installation (Recommended)
```bash
aide install # Enables daemon mode by default
```
### Automatic Detection
AIDE automatically finds and configures:
- Python 3.7+ installation
- Claude Code directory
- Platform-specific settings
- Daemon mode enabled for seamless execution
### Manual Configuration
```bash
# Specify Python command
aide install --python python3.11
# Specify Claude directory
aide install --claude-dir ~/.claude
# Force reinstall over existing
aide install --force
# Disable daemon mode (maximum security)
aide install --no-daemon
```
## š¤ Daemon Mode vs Direct Mode
AIDE offers two execution modes to fit different user preferences and security requirements.
### š Daemon Mode (Default & Recommended)
**Benefits:**
- ā
**Seamless execution** - No permission prompts for each command
- ā
**Faster response** - Commands execute instantly through background daemon
- ā
**Automatic startup** - Daemon starts automatically when needed
- ā
**Secure** - Local-only daemon (localhost:47742) with token authentication
- ā
**Fallback protection** - Falls back to direct execution if daemon fails
**How it works:**
```bash
# Install with daemon mode (default)
aide install
# Claude can now run commands seamlessly:
You: "Create a React dashboard"
Claude: [runs aide-init] ā [runs aide-track "React dashboard"] ā starts work
# No permission prompts! š
```
**Daemon Management:**
```bash
aide-daemon start # Start daemon manually
aide-daemon stop # Stop daemon
aide-daemon status # Check if running
```
### š Direct Mode (Maximum Security)
**Benefits:**
- ā
**Full control** - You approve every Python script execution
- ā
**Maximum security** - No background processes
- ā
**Transparent** - See exactly what commands run
- ā
**Simple** - Direct Python script execution
**How it works:**
```bash
# Install without daemon
aide install --no-daemon
# Claude runs commands directly (with your approval):
You: "Create a React dashboard"
Claude: [requests to run python3 aide_init.py]
You: [approve] ā
Claude: [requests to run python3 aide_track.py "React dashboard"]
You: [approve] ā
```
### šļø Choosing Your Mode
**Choose Daemon Mode if:**
- You trust AIDE and want seamless operation
- You work on multiple projects frequently
- You prefer minimal interruptions
- You're comfortable with local background services
**Choose Direct Mode if:**
- You prefer maximum control over script execution
- You work in high-security environments
- You want to inspect every command before execution
- You prefer explicit approval for automation
### š Switching Between Modes
You can change modes anytime by reinstalling:
```bash
# Switch to daemon mode (or reinstall default)
aide install --force
# Switch to direct mode
aide install --no-daemon --force
```
## š® Usage Examples
### Starting a New Project
```
You: "Build a FastAPI for user management"
Claude: [AIDE auto-initializes]
šÆ Objective: FastAPI user management system
š Progress: 0% (Analysis phase)
š Starting implementation...
```
### Handling Interruptions
```
You: "Wait, I need Docker support too"
Claude: š AIDE Adaptation Analysis
š Request: Docker support addition
š Type: clarification (priority: medium)
š Current: 40% on API endpoints
šÆ Strategy: MERGE
š” Plan: Add Dockerfile while continuing API development
```
### Checking Progress
```
You: "How are we doing?"
Claude: šÆ AIDE Status Report
š Objective: FastAPI user management + Docker
š Progress: 75% (6/8 tasks completed)
š Adaptations: 2 handled successfully
š§ Pattern: User prefers comprehensive solutions
š” Next: Testing and documentation
```
## šÆ Benefits in Action
### Memory Across Sessions
```
Day 1: Work on API, implement auth
Day 2: Claude remembers auth decisions, builds on previous work
Day 3: Continues with same patterns and context
```
### Pattern Learning
```
After 3 projects, AIDE learns:
- You prefer TypeScript over JavaScript
- You always add Docker later in projects
- You like comprehensive error handling
```
### Smart Snapshots
```
You: "Emergency bug fix needed"
Claude: š AIDE: Creating snapshot "dashboard-work"
šÆ Switching to bug fix mode
š¾ Can resume dashboard work exactly where left off
```
## š Privacy & Security
**IMPORTANT: AIDE runs completely offline and respects your privacy.**
### What AIDE Does NOT Send:
- ā Your source code
- ā Project files or content
- ā Personal information
- ā Claude conversations
- ā Any sensitive data
**AIDE operates entirely on your local machine.** No external connections or data transmission.
## š ļø Requirements
- **Node.js** 14+ (for installation)
- **Python** 3.7+ (any variant: python3, python, py)
- **Claude Code** (official Anthropic CLI)
## š§ Troubleshooting
### Installation Issues
```bash
# Check system compatibility
aide verify
# Force clean install
aide uninstall
aide install --force
# Use specific Python
aide install --python /usr/local/bin/python3.11
```
### Common Problems
**š« DO NOT USE NPX**
```bash
# WRONG - This causes hanging and installation issues
npx aide-cli install # ā DO NOT USE
# CORRECT - Always use the two-step process
npm install -g aide-cli@latest # ā
Step 1
aide install # ā
Step 2
```
**Python not found?**
```bash
# Install Python 3.7+, then:
aide install --python python3
```
**Permission errors?**
```bash
# On macOS/Linux:
sudo aide install
# Or install to user directory:
aide install --claude-dir ~/my-claude
```
**Claude Code not working?**
- Ensure Claude Code is properly installed
- Check `~/.claude/CLAUDE.md` exists after installation
- Try opening a new Claude Code session
### Daemon Mode Issues
**Daemon not starting?**
```bash
# Check if daemon is running
aide-daemon status
# Start daemon manually
aide-daemon start
# Check daemon logs
cat ~/.claude/.aide-daemon/daemon.log
```
**Commands hanging or slow?**
```bash
# Restart daemon
aide-daemon stop
aide-daemon start
# Or switch to direct mode temporarily
aide install --no-daemon --force
```
**Port 47742 already in use?**
```bash
# Check what's using the port
lsof -i :47742
# Stop AIDE daemon
aide-daemon stop
# Kill any conflicting process if needed
```
**Authentication token issues?**
```bash
# Reset daemon authentication
aide-daemon stop
rm ~/.claude/.aide-daemon/daemon-token
aide-daemon start
```
## šļø Architecture
### Core Components
```
AIDE Package
āāā š Python Detector (finds best Python)
āāā š§ Cross-platform Installer
āāā š Dynamic Wrapper Scripts
āāā š§ Persistent Memory System
āāā š Adaptation Engine
āāā š¤ Local Daemon (optional)
āāā ā
Installation Verifier
```
### Execution Modes
**Daemon Mode Architecture:**
```
Claude Code ā aide-init ā Local Daemon (port 47742) ā Python Scripts ā Response
ā
Auto-startup if needed
ā
Token authentication
ā
Secure execution
```
**Direct Mode Architecture:**
```
Claude Code ā python3 script.py ā User Approval ā Python Scripts ā Response
ā
Manual approval each time
ā
Maximum transparency
```
## š System Files Created
### Common Files (Both Modes)
```
~/.claude/
āāā CLAUDE.md # Enhanced with AIDE integration
āāā aide_init.py # Initialization script
āāā aide_track.py # Objective tracking
āāā aide_status.py # Status display
āāā aide_adapt.py # Interruption handling
āāā aide-wrapper.sh # Unix wrapper (or .bat for Windows)
āāā backups/ # CLAUDE.md backups
āāā CLAUDE-2024-01-15.md
```
### Additional Files (Daemon Mode Only)
```
~/.claude/
āāā .aide-daemon/ # Daemon configuration
ā āāā daemon-token # Secure authentication token
ā āāā daemon.pid # Process ID file
ā āāā daemon.log # Daemon activity log
āāā aide-daemon # Daemon control script
```
### Project Files (Auto-created)
```
your-project/
āāā .aide/
āāā plan.json # Objectives and task graph
āāā context.json # Session and project context
āāā memory.log # Decision history
āāā snapshots/ # State snapshots for branching
āāā snapshot_123.json
```
## š Upgrade & Updates
```bash
# Update to latest version
npm update -g aide-cli
# Reinstall with new features
aide install --force
# Check version
aide --version
```
## š” Tips & Best Practices
### General Usage
1. **Be specific with objectives** - "Build user auth" vs "Create complete FastAPI authentication system with JWT, password reset, and role management"
2. **Let AIDE handle interruptions** - Don't restart from scratch, let AIDE adapt your current work
3. **Check status regularly** - Use `aide status` to see progress and suggestions
4. **Trust the strategies** - AIDE's suggestions are based on context analysis and historical patterns
5. **Review memory logs** - Check `.aide/memory.log` to understand decision patterns
### Daemon Mode Tips
6. **Use daemon mode for frequent work** - If you work with Claude Code regularly, daemon mode eliminates friction
7. **Monitor daemon health** - Occasionally run `aide-daemon status` to ensure smooth operation
8. **Restart daemon if issues** - If commands feel slow, restart with `aide-daemon stop && aide-daemon start`
### Direct Mode Tips
9. **Approve selectively** - In direct mode, you can skip non-critical commands if needed
10. **Review commands before approval** - Take advantage of the transparency to understand AIDE's actions
## š¤ Contributing & Support
AIDE is open source! Contributions welcome:
- š Report bugs via GitHub Issues
- š” Suggest features and improvements
- š§ Submit pull requests
- š Improve documentation
- š§ **Contact & Support**: acevedo.eduardo@outlook.com
## š License
MIT License - see LICENSE file for details.
## š Acknowledgments
- Built for the [Claude Code](https://docs.anthropic.com/claude-code) ecosystem
- Inspired by adaptive planning systems and cognitive architectures
- Created by the community, for the community
---
**Ready to supercharge your Claude Code experience?**
```bash
# Install AIDE globally
npm install -g aide-cli@latest
# Run installation
aide install
```
*Transform interruptions from frustrations into intelligent adaptations.*