-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
sem edited this page Jul 4, 2025
·
1 revision
This guide will help you get up and running with Claude Hooks Manager quickly.
Git hooks are scripts that run automatically when certain Git events occur, such as:
- Before a commit (
pre-commit
) - After writing a commit message (
commit-msg
) - Before pushing (
pre-push
)
- Consistency: Ensure all team members use the same hooks
- Automation: Automate repetitive tasks
- Quality: Catch issues before they reach the repository
- AI-Enhanced: Leverage Claude AI for better development workflows
Navigate to your Git repository and initialize Claude Hooks Manager:
cd your-project
claude-hooks init
This creates a .claude-hooks
directory in your project with configuration files.
Let's install a pre-commit formatting hook:
claude-hooks install format-check
Make a change to a file and try to commit:
echo "const x=1" > test.js
git add test.js
git commit -m "Test commit"
The hook will run and check formatting before allowing the commit.
# Install a specific hook
claude-hooks install <hook-name>
# Install multiple hooks
claude-hooks install format-check lint-check
# Install all recommended hooks
claude-hooks install --defaults
# List all available hooks
claude-hooks list
# Show installed hooks status
claude-hooks status
# Remove a hook
claude-hooks remove <hook-name>
# Disable a hook temporarily
claude-hooks disable <hook-name>
# Enable a disabled hook
claude-hooks enable <hook-name>
# Run a specific hook
claude-hooks run <hook-name>
# Run all installed hooks
claude-hooks run --all
# Initialize Claude Hooks Manager
claude-hooks init
# Install recommended hooks for your project type
claude-hooks install --defaults --type node
# Verify installation
claude-hooks status
# Initialize without overwriting existing hooks
claude-hooks init --preserve-existing
# Gradually add hooks
claude-hooks install format-check
claude-hooks install lint-check
- Commit the
.claude-hooks
directory to your repository - Team members run:
claude-hooks sync
- This ensures everyone has the same hooks configured
- format-check: Ensures consistent code formatting
- lint-check: Catches potential issues and style violations
- type-check: TypeScript/Flow type checking
- test-check: Runs relevant tests for changed files
- test-suite: Runs full test suite (pre-push)
- commit-format: Enforces conventional commit format
- ai-commit-msg: Enhances commit messages with AI
- build-check: Ensures project builds successfully
- bundle-size: Checks bundle size limits
Claude Hooks Manager uses a .claude-hooks/config.json
file:
{
"hooks": {
"format-check": {
"enabled": true,
"config": {
"prettier": true,
"eslint": true
}
}
},
"global": {
"autoUpdate": true,
"colorOutput": true
}
}
Learn more in the Configuration Guide.
- Start Small: Begin with one or two hooks and add more gradually
- Use Defaults: The default hooks are well-tested and cover common needs
- Customize Carefully: Test custom hooks thoroughly before sharing
- Document Custom Hooks: Help your team understand any custom hooks
- Regular Updates: Keep Claude Hooks Manager updated for new features
# Check if hook is installed and enabled
claude-hooks status
# Reinstall the hook
claude-hooks remove <hook-name>
claude-hooks install <hook-name>
# Run hook with debug output
claude-hooks run <hook-name> --debug
# Check hook configuration
claude-hooks config <hook-name>
- Explore all available hooks in the Hooks Reference
- Learn to create your own in Creating Custom Hooks
- Deep dive into Configuration
- Check out API Reference for advanced usage