Skip to content

Releases: GowayLee/cchooks

v0.1.5

12 Nov 04:35

Choose a tag to compare

πŸš€ New Features

Tool Input Modification for PreToolUse Hooks

Hooks can now modify tool parameters before execution. For example, transform file paths or sanitize inputs before tools run.

Notification Type Filtering

Notification hooks can now filter by type (permission prompts, auth success, etc.) for more targeted processing.

Enhanced Session Hooks

  • SessionEnd hooks now track working directory (cwd)
  • SessionStart supports new "compact" source for transcript compaction events
  • New plugin environment variables: CLAUDE_PROJECT_DIR, CLAUDE_CODE_REMOTE, CLAUDE_PLUGIN_ROOT

Full Changelog: v0.1.4...v0.1.5

v0.1.4

23 Aug 04:09

Choose a tag to compare

  • Add session_end hook
  • Support system_message field
  • Support additional_context field

Full Changelog: v0.1.3...v0.1.4

v0.1.3

03 Aug 15:23

Choose a tag to compare

  • feat: Add SessionStart Hook
  • docs: Update docs

Full Changelog: v0.1.2...v0.1.3

v0.1.2

27 Jul 11:33

Choose a tag to compare

  • feat: Support UserPromptSubmit Hook
  • feat: Add cwd field to hook contexts
  • feat: Support new HookSpecificOutput form of JSON output
  • feat: Add error handling utility functions

Full Changelog: v0.1.0...v0.1.2

πŸš€ Release v0.1.0 - The Beginning

17 Jul 06:21

Choose a tag to compare

cchooks is now available on PyPI! This is the initial release of our lightweight Python library for building Claude Code hooks with zero configuration.

✨ What's New

  • Complete hook support for all 6 Claude Code hook types:
    • PreToolUse - Block dangerous tools before execution
    • PostToolUse - React to tool results after execution
    • Notification - Handle Claude's notifications
    • Stop - Control when Claude stops working
    • SubagentStop - Control subagent behavior
    • PreCompact - Customize transcript compaction
  • Zero-config setup - create_context() handles all JSON parsing and validation
    • Type-safe API - Full type hints and IDE autocompletion support
    • Dual-mode operation - Simple exit codes OR advanced JSON control
  • All features follow Anthropic's official api reference

πŸƒβ€β™‚οΈ Quick Start

pip install cchooks
#!/usr/bin/env python3
from cchooks import create_context

c = create_context()
if c.tool_name == "Write" and ".env" in c.tool_input.get("file_path", ""):
    c.output.exit_block("Protected file!")
else:
    c.output.exit_success()

πŸ“¦ Installation

# With pip
pip install cchooks

# With uv
uv add cchooks

πŸ”§ Development Ready

  • Complete test suite with 90%+ coverage
  • Type checking with mypy
  • Linting with ruff
  • Comprehensive documentation
  • Real-world examples included

🎯 Perfect For

  • Security teams - Block dangerous commands and file operations
  • Developer experience - Auto-format, lint, and commit code
  • Automation - Integrate with CI/CD and development workflows
  • Monitoring - Log and audit Claude's actions

πŸ“š Resources


Install now: pip install cchooks or uv add cchooks
GitHub: https://github.com/GowayLee/cchooks
PyPI: https://pypi.org/project/cchooks