-
Notifications
You must be signed in to change notification settings - Fork 1
FAQ
Common questions about Claude Hooks Manager.
Claude Hooks Manager is a tool that simplifies the installation and management of Git hooks, specifically optimized for AI-assisted development with Claude. It provides pre-configured hooks for common development tasks and allows you to create custom hooks.
Key differences:
- AI-Optimized: Includes hooks specifically designed for AI-assisted development
- Zero Configuration: Works out of the box with sensible defaults
- Language Agnostic: Supports multiple languages and frameworks
- Interactive: Provides interactive prompts and AI-enhanced features
- Modular: Easy to enable/disable individual hooks
Yes, Claude Hooks Manager is open source and free to use under the MIT license.
- Node.js 14 or higher
- Git 2.9 or higher
- npm, yarn, pnpm, or bun package manager
Yes! Claude Hooks Manager can:
- Preserve existing hooks during installation
- Chain with existing hooks
- Import hooks from other managers
claude-hooks init --preserve-existing
Both options are supported:
- Global: Recommended for ease of use across projects
- Local: Better for project-specific configurations
# Global update
npm update -g claude-hooks-manager
# Local update
npm update claude-hooks-manager
# Check for updates
claude-hooks update --check
Several methods:
# Skip all hooks for one commit
git commit --no-verify -m "Emergency fix"
# Disable specific hook temporarily
claude-hooks disable format-check
# Set environment variable
CLAUDE_HOOKS_SKIP=true git commit -m "Skip hooks"
Yes, you can run any hook manually:
# Run specific hook
claude-hooks run format-check
# Run all hooks
claude-hooks run --all
# Test run without side effects
claude-hooks run lint-check --dry-run
- Commit the
.claude-hooks
directory to your repository - Team members run:
claude-hooks sync
Yes, using branch-specific configuration:
{
"branchConfigs": {
"main": {
"hooks": {
"test-suite": { "enabled": true }
}
},
"develop": {
"hooks": {
"test-check": { "enabled": true }
}
}
}
}
-
Project config:
.claude-hooks/config.json
-
Global config:
~/.claude-hooks/config.json
-
Cache:
~/.claude-hooks/cache/
{
"globals": {
"monorepo": true,
"workspaces": ["packages/*", "apps/*"]
},
"workspaceOverrides": {
"packages/ui": {
"hooks": {
"visual-test": { "enabled": true }
}
}
}
}
Yes, environment variables are expanded:
{
"hooks": {
"deploy-check": {
"config": {
"apiKey": "${DEPLOY_API_KEY}",
"environment": "${NODE_ENV:-development}"
}
}
}
}
Common issues:
- Missing formatter: Install prettier/eslint
-
Configuration conflict: Check
.prettierrc
and.eslintrc
- File not staged: Only staged files are checked
Debug:
claude-hooks run format-check --debug
Customize the configuration:
{
"hooks": {
"commit-format": {
"config": {
"types": ["feat", "fix", "docs", "style", "refactor", "test", "chore", "wip"],
"requireScope": false,
"maxLength": 100
}
}
}
}
Yes, use file filters:
{
"hooks": {
"lint-check": {
"config": {
"include": ["src/**/*.js"],
"exclude": ["**/*.test.js", "**/*.spec.js"]
}
}
}
}
Common causes and solutions:
- Large repository: Enable changed-only mode
- Sequential execution: Enable parallel mode
- No caching: Enable cache
- Too many files: Add exclusion patterns
{
"hooks": {
"test-check": {
"config": {
"changedOnly": true,
"parallel": true,
"cache": true,
"bail": true
}
}
}
}
By default, hooks skip in CI to avoid duplication. Override:
{
"globals": {
"skipCI": false
}
}
- Run with debug flag:
claude-hooks run failing-hook --debug
- Check logs:
claude-hooks logs failing-hook
- Run diagnostic:
claude-hooks doctor
This error occurs when:
- Hook is not installed:
claude-hooks install hook-name
- Hook name is misspelled:
claude-hooks list
- Custom hook not registered:
claude-hooks register hook-name
- Check existing issues on GitHub
- Run
claude-hooks info --system
- Create issue with:
- System information
- Steps to reproduce
- Error messages
- Configuration
Yes! Hooks can be written in any language:
{
"name": "python-hook",
"executable": "check.py",
"interpreter": "python3"
}
- Create npm package with hooks
- Publish to registry
- Teams install:
npm install -g @company/claude-hooks-preset
claude-hooks use @company/claude-hooks-preset
Yes, but use caution:
{
"hooks": {
"format-check": {
"config": {
"autoFix": true,
"stageFixed": true
}
}
}
}
Most IDEs respect Git hooks automatically. For specific integrations:
- VS Code: Install Claude Hooks extension
- WebStorm: Configure Git hooks in settings
- Vim: Use fugitive.vim or similar
- Official hooks are reviewed and tested
- Custom hooks run with your permissions
- Always review hooks before installation
- Use
--dry-run
to test safely
Hooks run with your user permissions, so:
- Review custom hooks carefully
- Don't commit sensitive data in hook configs
- Use environment variables for secrets
# List all hooks and their sources
claude-hooks audit
# Verify hook integrity
claude-hooks verify
# Show hook permissions
claude-hooks permissions
- Fork the repository
- Create feature branch
- Make changes with tests
- Submit pull request
See Contributing Guide for details.
Yes! We welcome hook contributions:
- Ensure hook is well-tested
- Add documentation
- Submit PR to the community hooks repository
Active contributors may be invited to become maintainers. Contribute regularly and engage with the community.