claude-code-boost
Claude Code Boost - Hook utilities for Claude Code with intelligent auto-approval
The intelligent auto-approval system for Claude Code
Stop manually approving every safe development operation! Claude Code Boost intelligently auto-approves common development tasks while keeping you protected from dangerous commands.
Claude Code Boost acts as your intelligent assistant by leveraging Claude Code's PreToolUse hook, automatically approving safe operations like:
- π Reading files and exploring your codebase
- π¨ Building and testing your applications
- π Making localhost requests for development
- π¦ Installing packages and managing dependencies
- π³ Running Docker commands and managing containers
While always blocking truly dangerous operations like rm -rf /
or system wipes.
Prerequisites: Node.js 20+ and Claude Code installed
# Step 1: Install Claude Code Boost globally
npm install -g claude-code-boost
# Step 2: Run the install command to set up the hook
ccb install
The ccb install
command will interactively guide you through:
- Choose installation location: User settings (recommended), project settings, or project-local settings
- Choose authentication method: Claude CLI (recommended) or direct API key access
- Install the hook: Automatically configures Claude Code settings
- Verify setup: Ensures everything is working properly
Claude Code Boost uses a two-tier approval system:
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Claude Code β βββΆβ CCB Hook β βββΆβ Your Command β
β Tool Request β β Pre-approval β β Executes β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β π Fast Approval β
β (Read, LS, Glob...) β
β β
β π€ AI Analysis β
β (Bash, complex ops) β
βββββββββββββββββββββββββ
Fast Track: Instantly approves obviously safe operations (reading files, listing directories)
AI Analysis: For complex operations, uses Claude's intelligence to make context-aware decisions
Smart Caching: Caches approval decisions to avoid redundant AI calls for identical operations
Authentication: Works with either Claude CLI or direct Anthropic API access
# Interactive installation with prompts
ccb install --user
# Non-interactive with API key
ccb install --user --api-key sk-your-api-key-here
# Use project-level settings
ccb install --project-local
CCB uses a configuration file located at ~/.ccb/config.json
(or $CCB_CONFIG_DIR/config.json
):
{
"log": true, // Enable/disable approval logging
"cache": true, // Enable/disable approval caching (default: true)
"apiKey": "sk-..." // Anthropic API key (optional)
}
Configuration Options:
-
log
(boolean, default:true
): Controls whether approval decisions are logged to~/.ccb/approval.jsonl
-
cache
(boolean, default:true
): Controls intelligent caching of approval decisions to avoid redundant AI calls -
apiKey
(string, optional): Anthropic API key for direct API access (overridesANTHROPIC_API_KEY
environment variable)
Caching Behavior:
- β Enabled by default for optimal performance
- π Working directory scoped for safety across different projects
- π― Caches only definitive decisions (approve/block, not "unsure")
- π Instant responses for repeated operations
- π§Ή Easy management with
ccb debug clear-approval-cache
# Disable caching if needed
echo '{"log": true, "cache": false}' > ~/.ccb/config.json
# Clear approval cache
ccb debug clear-approval-cache
- File operations: Reading, writing, editing files
-
Development tools:
npm test
,npm build
,git commit
-
Localhost requests:
curl http://localhost:3000
-
Docker operations:
docker build
,docker run
-
Package management:
npm install
,yarn add
-
System destruction:
rm -rf /
,rm -rf /usr
-
Disk operations:
mkfs
, destructivefdisk
- Malicious activity: DoS attacks, credential theft
Test that CCB is working:
# This should show auto-approval in action
echo '{"session_id":"test","transcript_path":"/tmp/test","tool_name":"Read","tool_input":{"file_path":"/etc/hosts"}}' | ccb auto-approve-tools
# Expected: {"decision":"approve","reason":"Read is a safe read-only operation"}
# Test caching behavior
echo '{"session_id":"test","transcript_path":"/tmp/test","tool_name":"Bash","tool_input":{"command":"rm -rf /"}}' | ccb auto-approve-tools --use-claude-cli
# First call: {"decision":"block","reason":"..."}
# Second call: {"decision":"block","reason":"... (cached)"}
Debug Commands:
# Clear approval cache
ccb debug clear-approval-cache
# View current config
cat ~/.ccb/config.json
# View approval logs
tail -f ~/.ccb/approval.jsonl
# View cached decisions
cat ~/.ccb/approval_cache.json
Claude Code Boost's auto-approval tool is just the beginning. We're building a comprehensive hook ecosystem for Claude Code:
Coming Soon:
- π Analytics hooks - Track your Claude Code usage and productivity
- π Code quality hooks - Automatically run linters and formatters
- π§ͺ Testing hooks - Auto-run tests when code changes
- π Documentation hooks - Auto-generate docs for new functions
- π CI/CD hooks - Integrate with your deployment pipeline
Vision: Transform Claude Code into a fully integrated development environment with intelligent automation at every step.
- π Issues: Report bugs or request features
- π¬ Discussions: Join the community
- π Documentation: Detailed docs in CLAUDE.md
- π§ Development: See CLAUDE.md for development setup
MIT License - see LICENSE file for details.
Ready to boost your Claude Code productivity?
npm install -g claude-code-boost && ccb install
Made with β€οΈ for the Claude Code community