Claude Autopilot

repository·main·Indexed 42 days ago

https://github.com/benbasha/claude-autopilot

A VS Code and Cursor extension for automated Claude Code task management. Version 0.1.6 features queue processing, auto-resume functionality for usage limit pauses, and sleep prevention to enable autonomous execution of large batches of tasks.

Tokens
23.3K
Snippets
90
Records
113
Agent score
53%

What's inside Claude Autopilot

  1. How Claude Autopilot handles usage limits and queues

    main
    Claude Autopilot uses an Auto-Resume mechanism. When the underlying Claude Code process hits usage limits, the extension detects this state and automatically schedules the queue to resume once the limits reset. This allows for long-running, multi-day batch processing without manual intervention. Each VS Code workspace maintains its own independent queue and history.
  2. Understand the Claude Autopilot project structure

    main

    The project is organized into several functional directories within src/:

    • src/core/: Core state management and configuration
    • src/claude/: Claude CLI integration
    • src/queue/: Message queue processing
    • src/services/: External service integrations
    • src/ui/: User interface (webview)
    • src/utils/: Shared utilities
    • src/webview/: HTML/CSS/JS for webview

    Key Files

    • src/extension.ts: Main extension entry point
    • src/claude_pty_wrapper.py: Python PTY wrapper
    • package.json: Extension manifest and dependencies
    • CLAUDE.md: Instructions for Claude Code assistance
  3. Set up a development environment for Claude Autopilot

    main

    To develop for Claude Autopilot, ensure you meet the prerequisites and follow these steps to build and run the extension in a development host.

    Prerequisites

    • Node.js 16+ and npm
    • VS Code or Cursor IDE
    • TypeScript knowledge
    • Claude Code CLI installed
    • Python 3.8+ (required for the PTY wrapper)

    Development Setup

    1. Fork the repository on GitHub.
    2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/Claude-Autopilot.git
    cd Claude-Autopilot
    1. Install dependencies:
    npm install
    1. Build the extension:
    npm run compile
    1. Launch the Extension Development Host by pressing F5 in VS Code.
    git clone https://github.com/YOUR_USERNAME/Claude-Autopilot.git
    cd Claude-Autopilot
    npm install
    npm run compile
  4. Contribute code via the Pull Request process

    main

    Claude Autopilot uses a specific branching strategy and workflow for code contributions.

    Branch Strategy

    • main: Stable releases
    • develop: Integration branch for new features
    • feature/feature-name: Individual feature branches
    • fix/issue-number: Bug fix branches

    Pull Request Workflow

    1. Create a branch from develop:
    git checkout develop
    git pull origin develop
    git checkout -b feature/your-feature-name
    1. Implement changes following the project's coding standards.
    2. Test your changes:
    npm run compile
    npm run test # if tests exist
    1. Commit with descriptive messages. It is recommended to use a multi-line commit format that includes a summary and a list of changes, as well as references to issue numbers (e.g., Fixes #123).
    2. Push and create a PR:
    git push origin feature/your-feature-name
    1. Complete the PR template, including descriptions, testing details, and screenshots for UI changes.
    git checkout develop
    git pull origin develop
    git checkout -b feature/your-feature-name
    npm run compile
    npm run test
    git commit -m "Add auto-retry mechanism...\n\n- Implement exponential backoff...\n\nFixes #123"
    git push origin feature/your-feature-name
  5. Build and package the Claude Autopilot extension

    main

    Before deploying, you must install dependencies, compile the TypeScript source code, and package the extension into a .vsix file. Use vsce (Visual Studio Code Extension Manager) to create the package and verify its contents.

    Build Workflow:

    1. Install dependencies: npm install
    2. Compile TypeScript: npm run compile
    3. Package for marketplace: vsce package
    4. Verify package contents: vsce ls --tree
    # Install dependencies
    npm install
    
    # Compile TypeScript
    npm run compile
    
    # Package for marketplace
    vsce package
    
    # Verify package contents
    vsce ls --tree
  6. Install Claude Autopilot

    main

    Claude Autopilot is a VS Code and Cursor extension. You can install it using one of the following methods:

    1. VS Code Marketplace: Search for "Claude Autopilot" in the Extensions view.
    2. Command Palette: Open the Command Palette (Cmd/Ctrl+Shift+P) and run Extensions: Install Extensions.
    3. VSIX File: Install manually via the CLI:
      code --install-extension claude-autopilot-0.1.6.vsix
    code --install-extension claude-autopilot-0.1.6.vsix
  7. Build Claude Autopilot from source

    main

    To develop on Claude Autopilot, follow these steps:

    1. Clone the repository:
      git clone https://github.com/benbasha/Claude-Autopilot.git
      cd Claude-Autopilot
    2. Install dependencies:
      npm install
    3. Compile TypeScript:
      npm run compile
    4. Run in watch mode:
      npm run watch
    5. Package for distribution:
      vsce package
    git clone https://github.com/benbasha/Claude-Autopilot.git
    cd Claude-Autopilot
    npm install
    npm run compile
    npm run watch
    vsce package
  8. Deploy the extension to the VS Code Marketplace

    main

    To publish the extension to the marketplace, follow these steps:

    1. Install the VS Code Extension Manager:
      npm install -g @vscode/vsce
    2. Prepare Azure DevOps: Create an account at Azure DevOps and generate a Personal Access Token (PAT).
    3. Create/Identify Publisher: Use vsce create-publisher benbasha if you haven't created the publisher yet.
    4. Login: Run vsce login benbasha and provide your PAT when prompted.
    5. Publish:
      • To publish the current version: vsce publish
      • To publish with a version bump:
        • Patch (e.g., 2.0.1): vsce publish patch
        • Minor (e.g., 2.1.0): vsce publish minor
        • Major (e.g., 3.0.0): vsce publish major

    Alternative: Manual Upload If you prefer not to use the CLI, you can manually upload the generated .vsix file to the Visual Studio Marketplace management portal.

    # Install vsce
    npm install -g @vscode/vsce
    
    # Login
    vsce login benbasha
    
    # Publish with version bump
    vsce publish patch
  9. Basic Usage: Automating Claude Code tasks

    main

    To start automating tasks with Claude Autopilot, follow these steps:

    1. Start the session: Open the Command Palette (Cmd/Ctrl+Shift+P) and select Claude: Start Claude Autopilot.
    2. Queue tasks: Use Claude: Add Message to Queue to add one or many messages (tasks) to the processing queue.
    3. Execute: Click "Start Processing" in the Claude Autopilot interface.

    The extension will handle the queue automatically, including resuming work if Claude usage limits are reached.

    1. Cmd/Ctrl+Shift+P -> Claude: Start Claude Autopilot
    2. Claude: Add Message to Queue
    3. Click 'Start Processing'
  10. Configure Claude Autopilot settings

    main

    Settings can be accessed via File → Preferences → Settings → Extensions → Claude Autopilot.

    Queue Management

    • claudeAutopilot.queue.autoMaintenance: (boolean) Enables automatic queue maintenance.

    Session Management

    • claudeAutopilot.session.autoStart: (boolean) Whether the session starts automatically.
    • claudeAutopilot.session.skipPermissions: (boolean) If true, skips permission prompts (uses --dangerously-skip-permissions).
    • claudeAutopilot.session.healthCheckInterval: (number) Interval in milliseconds for checking process health.

    Sleep Prevention

    • claudeAutopilot.sleepPrevention.enabled: (boolean) Keeps the computer awake during processing.
    • claudeAutopilot.sleepPrevention.method: (string) The method used for sleep prevention (e.g., auto).

    History & Logging

    • claudeAutopilot.history.maxRuns: (number) Maximum number of previous runs to keep in history.
    • claudeAutopilot.history.autoSave: (boolean) Automatically saves history.
    • claudeAutopilot.history.showInUI: (boolean) Whether to show history in the UI.

    Web Interface

    • claudeAutopilot.webInterface.useExternalServer: (boolean) Use an external server for the web interface.
    • claudeAutopilot.webInterface.password: (string) Password for the web interface.

    Development

    • claudeAutopilot.developmentMode: (boolean) Enables debug logging, diagnostics, and advanced queue operations.
    {
        "claudeAutopilot.queue.autoMaintenance": true,
        "claudeAutopilot.session.autoStart": false,
        "claudeAutopilot.session.skipPermissions": true,
        "claudeAutopilot.session.healthCheckInterval": 30000,
        "claudeAutopilot.sleepPrevention.enabled": true,
        "claudeAutopilot.sleepPrevention.method": "auto",
        "claudeAutopilot.history.maxRuns": 20,
        "claudeAutopilot.history.autoSave": true,
        "claudeAutopilot.history.showInUI": false,
        "claudeAutopilot.webInterface.useExternalServer": false,
        "claudeAutopilot.webInterface.password": "",
        "claudeAutopilot.developmentMode": true
    }
  11. File Explorer ignore patterns and safety constraints

    main

    The FileExplorer service implements several safety and filtering mechanisms to protect the workspace and optimize performance:

    Path Traversal Protection

    All requested paths are validated using validateAndResolvePath. If a requested path attempts to resolve outside the current VS Code workspace root, the request is rejected.

    Ignored Patterns

    When building directory trees, the following patterns are automatically skipped to reduce noise and improve performance:

    • .git, .vscode, node_modules
    • .DS_Store, Thumbs.db
    • .gitignore, .vscodeignore
    • out, dist, build, .cache
    • __pycache__, *.pyc
    • .env, .env.local
    • .next, coverage

    File Size Limit

    To prevent memory issues or slow responses, file content retrieval is limited to a maximum size defined by MAX_FILE_SIZE (1MB).