LLMにこのREADMEを作らせたので、全然間違っていることを言っている可能性があります。
A collection of opinionated hooks and best‑practice rules for Claude Code.
The initial release ships with stop_hook.py, a plug‑and‑play Stop‑Event hook that:
- Echoes Claude’s last assistant message back to it
- Appends 「これであってる?」 to prompt clarification
- Fires a macOS notification with the echoed text
- Unblocks the Stop event once, using
stop_hook_activeto avoid infinite loops
- Demo
- Requirements
- Quick Start
- Configuration
- How It Works
- Customising the Hook
- Project Roadmap
- Contributing
- License
$ claude --debug
> …Claude answers…
# Notification ✨ pops up (macOS)
> assistant: <previous answer>
これであってる?| Component | Version |
|---|---|
| Python | 3.8 + |
| Claude Code | v0.33 + |
| OS | macOS (for notifications) Linux/Windows run fine—notification call is skipped |
git clone https://github.com/1ulce/.claude.git
cd .claude/hooks
chmod +x stop_hook.py- Open Claude Code → Settings → Hooks
- Add the snippet below to
settings.json(or use the UI):
- Start a session – the hook fires automatically whenever Claude reaches a Stop Event.
| Flag / Section | Purpose |
|---|---|
stop_hook_active check |
Prevents infinite trigger loops |
osascript call |
Sends a notification (macOS only) |
assistant_last parsing |
Extracts latest assistant reply |
Feel free to fork & tweak for your workflow.
-
Claude signals a
Stopdecision. -
The hook reads the conversation transcript (JSONL).
-
The latest assistant chunk is extracted & echoed.
-
A macOS notification is displayed via AppleScript.
-
The hook prints
{"decision":"block","reason":"<echoed>\n\nこれであってる?"}which Claude treats as the next user turn.
-
On the subsequent Stop,
stop_hook_activeis alreadytrue; the script exits silently, letting the conversation end normally.
- Disable notifications – set
NOTIFY=falseenv var or comment out thesend_notificationcall. - Change the suffix – edit
SUFFIX = "\n\nこれであってる?". - Different platforms – swap the
osascriptblock fornotify-send(Linux) orPowerShell(Windows).
- 🔧 Pre‑prompt rules & context validators
- 🪝 Additional hook templates (MessageRewriter, Guardrails, Metrics)
- 🧩 Schema‑driven plugin loader
- ✅ GitHub Actions CI (flake8, mypy, unit tests)
Contributions welcome—see below!
- Fork the repo & create your branch:
git checkout -b feature/my-awesome-hook - Commit with conventional commits style.
- Run
pre-commit run --all-files(config coming soon). - Open a PR; describe what & why clearly.
- Be nice ❤️ – we review fast!
Released under the MIT License – see LICENSE for details.
- ChatGPT & Claude community for inspiration
- Original discussion: [link to chat or issue]
{ "hooks": { "Stop": [ { "matcher": "", // run on every Stop "hooks": [ { "type": "command", "command": "/absolute/path/to/hooks/stop_hook.py" } ] } ] } }