claude-code-hooks  by win4r

Automate Claude Code task completion with post-execution callbacks

Created 2 months ago
324 stars

Top 84.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project provides automated post-task execution hooks for Claude Code, enhancing integration capabilities. It targets Claude Code and Agent Teams users needing to capture task results, send notifications, and signal other AI systems upon completion, thereby streamlining AI orchestration pipelines.

How It Works

The system utilizes dispatch-claude-code.sh to initiate Claude Code tasks, potentially leveraging Agent Teams via claude_code_run.py. Upon task completion, a pre-configured "stop hook" automatically triggers the notify-agi.sh script. This script processes task metadata and output, generates a comprehensive latest.json result file, sends notifications to a specified chat group (e.g., Telegram), and creates a pending-wake.json file for potential AGI system consumption. A deduplication mechanism using a .hook-lock file prevents redundant hook executions within a 30-second window.

Quick Start & Requirements

  • Primary Run Command: Execute scripts/dispatch-claude-code.sh with appropriate arguments (e.g., -p "Your prompt" -n "Task Name" -g "Chat Group ID").
  • Prerequisites: Claude Code installation (including Agent Teams support), a compatible shell environment (Unix-like), Python 3.x for claude_code_run.py, and a configured chat service (e.g., Telegram) for notifications. The hook must be registered in ~/.claude/settings.json.
  • Dependencies: Shell utilities, Python interpreter.
  • Links: No official quick-start or documentation links are provided in the README.

Highlighted Details

  • Automates result capture into structured JSON files (latest.json).
  • Enables real-time notifications to specified chat groups via parameters like -g.
  • Facilitates inter-AI system communication through pending-wake.json output.
  • Explicitly supports Claude Code's Agent Teams functionality.
  • Includes a 30-second deduplication mechanism for hook triggers.

Maintenance & Community

No information regarding maintainers, community channels (Discord, Slack), roadmap, sponsorships, or partnerships is present in the provided README.

Licensing & Compatibility

The README does not specify a software license. This lack of information presents a potential adoption blocker, particularly for commercial use or integration into proprietary systems.

Limitations & Caveats

The solution is tightly coupled to the Claude Code execution environment and requires manual configuration of hooks within ~/.claude/settings.json. Reliance on external chat software for notifications introduces an external dependency. Path specifications (e.g., ~/.claude/hooks/, /home/ubuntu/clawd/data/) suggest a specific user environment setup that may require adaptation. The AGI integration via pending-wake.json is noted as an optional ("备选") feature.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
0
Star History
74 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.