Add n8n workflow for Claude Code SubagentStop → Discord webhook notifications #4
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
infra-audit
monitoring
operations
proxmox
script
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/claude-home#4
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Long-running Claude Code subagents (like the
retrosheet-card-updateandlive-series-card-updatepipelines) can take 10+ minutes. It would be helpful to get a Discord notification when they complete.Approach
Use Claude Code's native HTTP hook on the
SubagentStopevent, pointed at an n8n webhook endpoint. n8n transforms the payload into Discord's expected{"content": "..."}format and forwards it.Why n8n instead of direct HTTP hook?
Claude Code HTTP hooks always send the raw event JSON as the POST body — you can't customize it. Discord webhooks require
{"content": "message"}. n8n acts as the transformer layer.Why not a command hook?
A command hook with curl would also work and is simpler, but the n8n approach:
Implementation
1. Claude Code hook config (
.claude/settings.json)2. n8n workflow
/claude-agent-donesubagent_name(and optionallyresult/session_id) from incoming JSON"🏁 Claude agent **{name}** has finished."3. Discord webhook
Future extension
PR #5 implements this: #5
Changes:
.claude/settings.json—SubagentStopHTTP hook →http://localhost:5678/webhook/claude-agent-done(async)productivity/n8n/workflows/claude-agent-done.json— importable n8n workflow (webhook → extract name → Discord POST)productivity/n8n/workflows/claude-agent-notifications.md— setup guide with payload reference and test curl commandAfter merging, you'll need to:
claude-agent-done.jsoninto n8n and activate itDISCORD_CLAUDE_ALERTS_WEBHOOKwith the Discord URL.claude/settings.jsontohttp://10.10.0.210:5678/webhook/claude-agent-done(n8n isn't on localhost)