Skip to content

Releases: GowayLee/cchooks

v0.1.3

03 Aug 15:23
Compare
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
Compare
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
Compare
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