Przejdź do treści
Biblioteka skilli
AI i agenci · Budowanie i kod

hook-creator

/hook-creator

Tworzy i konfiguruje hooki Claude Code: automatyczne formatowanie, logowanie, powiadomienia, ochronę plików i akcje przed i po użyciu narzędzi, na przykład PreToolUse i PostToolUse.

Repozytorium
cc-system ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.06.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.06.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Tworzy i konfiguruje hooki Claude Code: automatyczne formatowanie, logowanie, powiadomienia, ochronę plików i akcje przed i po użyciu narzędzi, na przykład PreToolUse i PostToolUse.

Oryginalny opis (EN)

Create and configure Claude Code hooks for customizing agent behavior. Use when the user wants to (1) create a new hook, (2) configure automatic formatting, logging, or notifications, (3) add file protection or custom permissions, (4) set up pre/post tool execution actions, or (5) asks about hook events like PreToolUse, PostToolUse, Notification, etc.

Jak działa

  1. Hook Creation Workflow
  2. Hook Configuration Structure
  3. Common Patterns
  4. Quick Examples
  5. Resources
Sekcje z nagłówków SKILL.md, w oryginale · 85 linii, 313 słów
Podgląd SKILL.md
---
name: hook-creator
description: Create and configure Claude Code hooks for customizing agent behavior. Use when the user wants to (1) create a new hook, (2) configure automatic formatting, logging, or notifications, (3) add file protection or custom permissions, (4) set up pre/post tool execution actions, or (5) asks about hook events like PreToolUse, PostToolUse, Notification, etc.
---

# Hook Creator

Create Claude Code hooks that execute shell commands at specific lifecycle events.

## Hook Creation Workflow

1. **Identify the use case** - Determine what the hook should accomplish
2. **Select the appropriate event** - Choose from available hook events (see references/hook-events.md)
3. **Design the hook command** - Write shell command that processes JSON input from stdin
4. **Configure the matcher** - Set tool/event filter (use `*` for all, or specific tool names like `Bash`, `Edit|Write`)
5. **Choose storage location** - User settings (`~/.claude/settings.json`) or project (`.claude/settings.json`)
6. **Test the hook** - Verify behavior with a simple test case

## Hook Configuration Structure

```json
{
  "hooks": {
    "<EventName>": [
      {
        "matcher": "<ToolPattern>",
        "hooks": [
          {
            "type": "command",
            "command": "<shell-command>"
          }
        ]
      }
    ]
  }
}
```

## Common Patterns

### Reading Input Data

Hooks receive JSON via stdin. Use `jq` to extract fields:

```bash
# Extract tool input field
jq -r '.tool_input.file_path'

# Extract with fallback
jq -r '.tool_input.description // "No description"'

# Conditional processing
jq -r 'if .tool_input.file_path then .tool_input.file_path else empty end'
```

### Exit Codes for PreToolUse

- `0` - Allow the tool to proceed
- `2` - Block the tool and provide feedback to Claude

### Matcher Patterns

- `*` - Match all tools
- `Bash` - Match only Bash tool
- `Edit|Write` - Match Edit or Write tools
- `Read` - Match Read tool

## Quick Examples

**Log all bash commands:**
```bash
jq -r '"\(.tool_input.command)"' >> ~/.claude/bash-log.txt
```

**Auto-format TypeScript after edit:**
```bash
jq -r '.tool_input.file_path' | { read f; [[ "$f" == *.ts ]] && npx prettier --write "$f"; }
```

**Block edits to .env files:**
```bash
python3 -c "import json,sys; p=json.load(sys.stdin).get('tool_input',{}).get('file_path',''); sys.exit(2 if '.env' in p else 0)"
```

## Resources

- **Hook Events Reference**: See `references/hook-events.md` for detailed event documentation with input/output schemas
- **Example Configurations**: See `references/examples.md` for complete, tested hook configurations
Pliki w paczce (3)
  • SKILL.md 3 KB
  • references/examples.md 6 KB
  • references/hook-events.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie hook-creator.

Migawka bazy z 28.10.2026 · wersja paczki 58bc9f49a871 (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95meta-hook-development
    Pomaga tworzyć hooki Claude Code typu PreToolUse, PostToolUse i Stop oraz sprawdzać ich poprawność.
  • 95hook-development
    Tworzy i waliduje hooki zdarzeń w Claude Code: PreToolUse, PostToolUse, Stop, SessionStart i inne, także blokowanie niebezpiecznych poleceń.
  • 100plugin-hooks
    Opisuje hooki Claude Code, czyli skrypty uruchamiane przed i po wywołaniach narzędzi, zdarzeniach sesji i zmianach plików: PreToolUse, PostToolUse, SessionStart, Stop, Notification, FileChanged i WorktreeCreate.
  • 95hook-development
    Prowadzi przez tworzenie hooków Claude Code (PreToolUse, PostToolUse, Stop, SessionStart i inne), w tym walidację użycia narzędzi, hooki oparte na promptach i blokowanie niebezpiecznych poleceń.
  • 100hook-template
    Generuje skrypt hooka z szablonu przy dodawaniu nowego hooka PreToolUse, PostToolUse, Stop lub Notification oraz konfiguracji w settings.json.
  • 100skill-018
    Pomaga tworzyć i konfigurować hooki Claude Code: zdarzenia PreToolUse, PostToolUse, Stop i SessionStart oraz walidację poleceń.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.