- Create a
.shfile inhooks/:#!/usr/bin/env bash set -euo pipefail # Read JSON context from stdin input=$(cat) # Your logic here exit 0 # allow # exit 2 # block
- Make it executable:
chmod +x hooks/your-hook.sh - Wire it into
.claude/settings.jsonunder the appropriate event (PreToolUse,PostToolUse, etc.):{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hook": "/path/to/hooks/your-hook.sh" } ] } } - Document it in
hooks/README.mdwith: purpose, trigger event, and block conditions.
- Create a directory in
skills/your-skill-name/. - Add a
SKILL.mdfile inside it. This is the instruction file Claude reads when the skill is invoked. - Optionally add helper scripts the skill references.
- Test by running
/your-skill-namein a Claude Code session. - Document the skill's purpose and usage in
skills/README.md.
Use the GitHub issue templates:
- Bug report: Include Claude Code version, OS, component, reproduction steps.
- Feature request: Describe the feature, which component it affects, and the use case.
Search existing issues before opening a new one.
- All bash scripts start with
set -euo pipefail. - Hooks read JSON from stdin via
input=$(cat)and parse withjq. - Exit codes for hooks:
0= allow,2= block. Any other exit code is treated as an error. - Use
jqfor JSON parsing, notgrep/sedon JSON. - Keep scripts focused: one hook, one responsibility.
- Quote all variables:
"$var", not$var.
- One logical change per PR.
- Test your hook/skill locally before submitting.
- Include a brief description of what changed and why.