agentleFS
shanraisshanshanraisshan/claude-code-hooks/CLAUDE.md

claude-code-hooks

CLAUDE.md552 starsChanged 6 months agoMITView on GitHub

Sound notification system for all 30 Claude Code hooks. Plays sound effects when hook events fire. The hook count (currently 30) MUST match across ALL of these locations: - .claude/settings.json hook entries - install/settings-mac.json, settings-linux.json, settings-windows.json - hooks.py HOOK_SOUND_MAP keys + docstring count - hooks-config.json toggle count - HOOKS-README.md heading + numbered list - README.md badge + changelog table - presentation/index.html (slides 2, 3, TOC, totalSlides) - claude-code-test-agent.md frontmatter + body - demo/.claude/settings.json hook entries - demo/.claude/hooks/scripts/demo-hooks.py HOOK_SOUND_MAP + docstring…

The file

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When adding a hook, use /workflows:workflow-add-hook — it updates all 14 files.

    line 46
  2. Very specific:

    Only 6 of 30 hooks fire in agent sessions: PreToolUse, PostToolUse, PermissionRequest, PostToolUseFailure, Stop, SubagentStop.

    line 50
  3. Distinctive:

    When committing changes, create separate commits per file.

    line 74
  4. Distinctive:

    Commit 1: git add README.md → commit with README-specific message

    line 77
  5. Very specific:

    Commit 2: git add .claude/hooks/scripts/hooks.py → commit with hooks-script-specific message

    line 78
  6. Very specific:

    Commit 3: git add changelog/changelog.md → commit with changelog-specific message

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claude Code Hooks

Sound notification system for all 30 Claude Code hooks. Plays sound effects when hook events fire.

Project Structure

.claude/
  settings.json
  hooks/
    scripts/hooks.py
    config/hooks-config.json
    sounds/<hookname>/
    HOOKS-README.md
  agents/
    workflows/workflow-changelog-agent.md
    claude-code-test-agent.md
  commands/workflows/
    workflow-changelog.md
    workflow-add-hook.md
install/
  settings-mac.json
  settings-linux.json
  settings-windows.json
presentation/index.html
changelog/
  changelog.md
  verification-checklist.md

Critical: Hook Count Consistency

The hook count (currently 30) MUST match across ALL of these locations:

  • .claude/settings.json hook entries
  • install/settings-mac.json, settings-linux.json, settings-windows.json
  • hooks.py HOOK_SOUND_MAP keys + docstring count
  • hooks-config.json toggle count
  • HOOKS-README.md heading + numbered list
  • README.md badge + changelog table
  • presentation/index.html (slides 2, 3, TOC, totalSlides)
  • claude-code-test-agent.md frontmatter + body
  • demo/.claude/settings.json hook entries
  • demo/.claude/hooks/scripts/demo-hooks.py HOOK_SOUND_MAP + docstring
  • demo/hooks-lifecycle.html flowchart SVG + prompt cards + branding count

When adding a hook, use /workflows:workflow-add-hook — it updates all 14 files.

Agent Hooks

Only 6 of 30 hooks fire in agent sessions: PreToolUse, PostToolUse, PermissionRequest, PostToolUseFailure, Stop, SubagentStop. These are mapped in AGENT_HOOK_SOUND_MAP in hooks.py.

Workflows

  • /workflows:workflow-changelog [N] — Check last N versions for drift. Launches 2 agents in parallel, runs verification checklist, appends to changelog.md
  • /workflows:workflow-add-hook <HookName> — Add a new hook across all files (sounds, config, settings, scripts, docs, presentation)
  • /commit — Auto-generate commit message with timestamp and change count

Conventions

  • Hook names are PascalCase everywhere (e.g. PreToolUse, InstructionsLoaded)
  • Sound folder names are lowercase (e.g. pretooluse, instructionsloaded)
  • Settings files: timeout 5000 for all hooks except Setup (30000)
  • once: true only on: PreCompact, SessionStart, SessionEnd
  • async: true on all hooks
  • Changelog entries use PKT timezone: TZ=Asia/Karachi date
  • Version badge format: v2.X.X | Mon DD, YYYY HH:MM AM/PM PKT

Memory

Persistent memory file: ~/.claude/projects/-Users-shayanraees-Documents-Github-claude-code-hooks/memory/MEMORY.md

Git Commit Rules

When committing changes, create separate commits per file. Do NOT bundle multiple file changes into a single commit. Each file gets its own commit with a descriptive message specific to that file's changes.

For example, if README.md, .claude/hooks/scripts/hooks.py, and changelog/changelog.md all changed:

  • Commit 1: git add README.md → commit with README-specific message
  • Commit 2: git add .claude/hooks/scripts/hooks.py → commit with hooks-script-specific message
  • Commit 3: git add changelog/changelog.md → commit with changelog-specific message

This makes the git history cleaner and easier to review, revert, or cherry-pick individual changes.

Schema Note

.claude/settings.json is validated against Claude Code's bundled JSON schema. The schema's propertyNames enum may contain hidden/undocumented hooks not yet in the changelog. The workflow-changelog agent checks for these. As of v2.1.162, the schema has 30 hooks (all 30 implemented in repo).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.