Habilidades claude-hooks

claude-hooks

Seguro

Configure Claude Code hooks for automation

Também disponível em: Joseph OBrien

Claude Code hooks enable automated validation, logging, and notifications during AI tool execution. This skill provides templates and best practices for configuring PreToolUse, PostToolUse, Notification, and Stop hooks.

Suporta: Claude Code(CC)
📊 70 Adequado
1

Baixar o ZIP da skill

2

Upload no Claude

Vá em Configurações → Capacidades → Skills → Upload skill

3

Ative e comece a usar

Testar

A utilizar "claude-hooks". How do I create a hook that logs every file that Claude writes?

Resultado esperado:

  • Add this to your ~/.claude/settings.json under the 'hooks' key:
  • • Use PostToolUse event to capture writes after they complete
  • • Matcher pattern 'Write' targets only file write operations
  • • Command uses $CLAUDE_FILE_PATH environment variable
  • • Appends each file path to ~/.claude/file_log.txt

Auditoria de Segurança

Seguro
v3 • 1/10/2026

This skill contains only markdown documentation files with hook configuration templates. No executable code, scripts, network calls, or file system access. Pure reference content for Claude Code hook configuration.

2
Arquivos analisados
146
Linhas analisadas
0
achados
3
Total de auditorias
Nenhum problema de segurança encontrado
Auditado por: claude Ver Histórico de Auditoria →

Pontuação de qualidade

41
Arquitetura
100
Manutenibilidade
81
Conteúdo
31
Comunidade
100
Segurança
87
Conformidade com especificações

O Que Você Pode Construir

Audit tool execution

Log all Claude Code tool calls for compliance auditing and security review

Enforce coding standards

Validate code changes before execution to enforce team conventions

Custom notifications

Send alerts to external systems when specific tools complete or fail

Tente Estes Prompts

Create validation hook
Show me how to create a PreToolUse hook that validates Bash commands before they run
Set up logging
Create a PostToolUse hook that logs all file write operations to a file
Notification integration
Configure a Notification hook that sends alerts to Slack when Claude completes tasks
Matcher patterns
Explain the different matcher patterns I can use to target specific tools like Bash(git:*) or MCP tools

Melhores Práticas

  • Keep hooks fast (under 1 second) to avoid blocking Claude Code execution
  • Use specific matcher patterns instead of wildcards to target only needed tools
  • Handle errors gracefully with proper shell error handling to prevent cascade failures

Evitar

  • Using verbose logging in hooks that adds excessive output to the conversation context
  • Creating hooks that block indefinitely without timeout handling
  • Configuring hooks for all tools (*) when only specific tools need automation

Perguntas Frequentes

Which Claude versions support hooks?
Hooks require Claude Code version 0.9.0 or later. Check your installation with 'claude --version'.
What is the maximum hook execution time?
Hooks should complete in under 1 second. Long-running hooks will block Claude Code tool execution.
How do hooks integrate with MCP tools?
Use matcher pattern 'mcp__*' to target all MCP tools, or specific MCP tool names for individual tools.
Are hooks secure?
Hooks run as your user with your permissions. Only install hooks from trusted sources and review commands before use.
Why is my hook not triggering?
Check that your settings.json has correct JSON syntax, the event name matches (PreToolUse, PostToolUse), and matcher patterns are valid.
How do hooks differ from custom instructions?
Hooks execute shell commands automatically on events, while custom instructions affect Claude's behavior through prompt context.

Detalhes do Desenvolvedor

Licença

UNLICENSED

Referência

main

Estrutura de arquivos