askill
hooks-manager

hooks-managerSafety 80Repository

Manage Claude Code lifecycle hooks for automation (secrets scan, auto-format, audit log, session context).

0 stars
1.2k downloads
Updated 2/14/2026

Package Files

Loading files...
SKILL.md

Hooks Manager

Manage Claude Code lifecycle hooks for automation.

When To Use

  • User says "setup hooks", "add hooks", "configure hooks"
  • User says "secrets scan", "auto-format", "audit log"
  • User wants automation on tool execution or session events

Available Hooks

HookTriggerUse Case
secrets-scanPreToolUse (Write/Edit)Block commits containing secrets
auto-formatPostToolUse (Write/Edit)Format code after writing
audit-logPostToolUse (*)Log all tool executions
session-contextSessionStartInject project context

Workflow

1. Check Current Hooks

# In Claude Code
/hooks

2. Install Hook Scripts

Copy to project:

mkdir -p .claude/hooks
cp ~/.claude/skills/oneshot/hooks/*.sh .claude/hooks/
chmod +x .claude/hooks/*.sh

3. Configure settings.json

Add to .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/secrets-scan.sh",
            "timeout": 10
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/auto-format.sh",
            "timeout": 30
          }
        ]
      },
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/audit-log.sh",
            "timeout": 5
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "matcher": "startup|resume",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-context.sh",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Hook Scripts Reference

secrets-scan.sh

Blocks writes containing potential secrets (API keys, tokens, passwords).

Exit codes:

  • 0: No secrets found
  • 2: Secrets detected (blocks the write)

auto-format.sh

Runs project formatter (prettier, black, gofmt) after file writes.

Supports: .js, .ts, .py, .go, .rs, .json, .yaml, .md

audit-log.sh

Appends tool executions to .claude/audit.log.

Format: TIMESTAMP | TOOL | FILE_PATH

session-context.sh

Injects project context on session start (reads LLM-OVERVIEW.md, TODO.md).

Minimal Setup (Secrets Only)

For just secrets scanning:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/secrets-scan.sh",
            "timeout": 10
          }
        ]
      }
    ]
  }
}

Inputs

  • User request for hook configuration
  • Existing .claude/settings.json (if any)

Outputs

  • Hook scripts in .claude/hooks/
  • Updated .claude/settings.json
  • Verification that hooks are registered (/hooks)

Keywords

hooks, automation, secrets scan, auto-format, audit log, pre-tool, post-tool, session start

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

78/100Analyzed 2/20/2026

Well-structured skill with clear description, When To Use triggers, detailed workflow, and comprehensive configuration examples. Technical content is accurate and includes hook reference table, JSON configs, and minimal setup option. Slight penalty for being in archive folder and appears personalized to user's setup, but the documentation quality is high and would be excellent if adapted for general use.

80
88
60
82
85

Metadata

Licenseunknown
Version-
Updated2/14/2026
PublisherKhamel83

Tags

apigithub-actionslintingllm