Claude Code Hook Manager banner
obsfx obsfx

Claude Code Hook Manager

Development community

Description

CLI tool to manage Claude Code hooks — creates, registers, and tracks prompt and script hooks without manually editing settings.json

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

cchm - Claude Code Hook Manager

A CLI tool that manages [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks). It creates hook files, registers them in `settings.json`, and tracks metadata — so you don't have to manually edit JSON config files.

https://github.com/user-attachments/assets/822ba7f8-086b-42c5-bf83-dc8f024a22a1

Installation

npm install -g cchm

Or run directly with npx:

npx cchm quickstart

How It Works

Claude Code hooks are configured in `~/.claude/settings.json` (global) or `.claude/settings.json` (project). Each hook points to a command that runs on a specific event.

cchm abstracts this away:

  1. You run cchm add prompt|script
  2. It creates the hook file under ~/.claude/hooks//.md|.sh
  3. It registers cchm run /.md|.sh as a command in settings.json
  4. It tracks hook metadata in .cchm.json for listing and management

When Claude Code triggers an event, it calls `cchm run `, which executes the hook file and handles output formatting automatically.

Hook Types

**Prompt hooks** (`.md`) — Markdown content injected as context into Claude. Write plain text; cchm handles JSON wrapping when the event requires it.

**Script hooks** (`.sh`) — Bash scripts executed on the event. They receive JSON on stdin and can produce output or perform side effects.

Event Compatibility

Not all events support both hook types. cchm enforces this automatically:

Category Events Prompt Script
Plaintext SessionStart, UserPromptSubmit