One-command dispatch of development tasks to Claude Code with automatic notification on completion. Zero polling, zero token waste.
Fire-and-forget your coding tasks β Claude Code builds it in the background β you get a rich Telegram notification when it's done.
πΊ YouTube: AISuperDomain β AI coding tutorials and demos
- π₯ Fire-and-forget β Dispatch a task and walk away. Get notified when done.
- π€ Agent Teams β Auto-split tasks into parallel Dev + Testing agents
- π± Telegram notifications β Rich completion reports with test results, file listings, duration
- π Three-layer callback β Telegram message β webhook wake β heartbeat fallback
- π― Auto-callback detection β Place a
dispatch-callback.jsonin your workspace, zero params needed - π‘οΈ Battle-tested β 100+ real-world tasks, all edge cases handled
dispatch.sh
β write task-meta.json
β launch Claude Code via claude_code_run.py (PTY wrapper)
β [Agent Teams: Lead splits work β Dev + Testing Agents run in parallel]
β Claude Code finishes β Stop Hook fires
β notify-hook.sh reads meta + output
β writes latest.json
β sends Telegram notification
β wakes AGI via webhook
β writes pending-wake.json (fallback)
git clone https://github.com/win4r/claude-code-dispatch.git
cd claude-code-dispatch
chmod +x scripts/*.sh scripts/*.pyCopy the hook script path to Claude Code settings:
# Edit ~/.claude/settings.json
# See docs/hook-setup.md for full config# Simple task
bash scripts/dispatch.sh \
-p "Build a Python CLI calculator with Click" \
-n "calc-cli" \
-w /path/to/project \
--permission-mode bypassPermissions
# With Telegram notification
bash scripts/dispatch.sh \
-p "Build a REST API with FastAPI" \
-n "my-api" \
-g "<your-telegram-group-id>" \
-w /path/to/project \
--permission-mode bypassPermissions
# Agent Teams (parallel dev + testing)
bash scripts/dispatch.sh \
-p "Build a weather CLI with API, caching, and colored output" \
-n "weather-cli" \
-g "<your-telegram-group-id>" \
--agent-teams \
--permission-mode bypassPermissions \
-w /path/to/project| Param | Short | Required | Description |
|---|---|---|---|
--prompt |
-p |
β | Task description |
--name |
-n |
Task name for tracking | |
--group |
-g |
Telegram group ID for notifications | |
--workdir |
-w |
Working directory (default: cwd) | |
--agent-teams |
Enable Agent Teams (parallel dev+test) | ||
--teammate-mode |
Display: auto / in-process / tmux |
||
--permission-mode |
bypassPermissions / plan / acceptEdits |
||
--allowed-tools |
Tool whitelist (e.g. "Read,Bash") |
||
--model |
Model override | ||
--callback-group |
Telegram group for callback | ||
--callback-dm |
Telegram user ID for DM callback | ||
--callback-account |
Telegram bot account name |
When --agent-teams is enabled, the dispatch script injects instructions for the Lead to:
- Split the task into parallel sub-agents
- Assign a dedicated Testing Agent that writes and runs tests
- Testing Agent runs in parallel with Dev Agent(s)
- All tests must pass before task is considered done
Each sub-agent is an independent Claude Code process sharing the same filesystem.
| Project | Agents | Tests | Duration |
|---|---|---|---|
| Weather CLI | 4 (api, formatter, testing, lead) | 42 passed | 5m34s |
| Calculator CLI | 3 (dev, testing, lead) | 18 passed | 3m12s |
| REST API | 4 (routes, db, testing, lead) | 31 passed | 7m45s |
Place a dispatch-callback.json in your workspace root:
For DM bots:
{
"type": "dm",
"dm": "<telegram-user-id>",
"account": "<bot-account-name>"
}For group agents:
{
"type": "group",
"group": "<telegram-group-id>"
}For webhook wake only:
{
"type": "wake"
}Then dispatch without callback params β it auto-detects.
All results stored in data/claude-code-results/:
| File | Content |
|---|---|
latest.json |
Full result (output, task name, group, timestamp) |
task-meta.json |
Task metadata (prompt, workdir, status, duration) |
task-output.txt |
Raw Claude Code stdout |
pending-wake.json |
Heartbeat fallback notification |
hook.log |
Hook execution log |
- Must use PTY wrapper β Direct
claude -phangs in non-TTY environments.claude_code_run.pyhandles this viascript(1). - Hook fires on ALL Claude Code runs β Not just dispatched ones. The hook validates meta file freshness (<2h) to avoid re-sending old notifications.
- Hook fires twice β Stop + SessionEnd. Built-in
.hook-lockdeduplicates (30s window). - tee pipe race condition β Hook sleeps 1s to wait for pipe flush before reading output.
- Always set
-wexplicitly β Missing workdir can drift into wrong cwd. - Codex is different β This tool is for Claude Code only. For OpenAI Codex CLI, see codex-cli-dispatch (coming soon).
This tool works standalone, but is designed to integrate with OpenClaw:
- Telegram notifications via
openclaw message send - AGI wake via
/hooks/wakewebhook - Multi-agent orchestration via OpenClaw's agent system
- YouTube: @AISuperDomain
- OpenClaw: openclaw.ai