feat: add SubagentStop → Discord notification via n8n (#4) #5
No reviewers
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#5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/claude-home-4"
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
Implements the SubagentStop → Discord notification pipeline described in #4.
.claude/settings.json— addsSubagentStopHTTP hook pointing athttp://localhost:5678/webhook/claude-agent-done(async)productivity/n8n/workflows/claude-agent-done.json— importable n8n workflow: webhook trigger → JS code node (extract agent name) → HTTP Request to Discordproductivity/n8n/workflows/claude-agent-notifications.md— full setup guide: Discord webhook creation, n8n variable config, test curl, payload reference, future extension notesproductivity/n8n/CONTEXT.md— added workflow entry under Active Workflowsproductivity/n8n/workflows/README.md— added workflow entry under Available WorkflowsKey design decisions
DISCORD_CLAUDE_ALERTS_WEBHOOK(not in any config file)subagent_namefield, falling back to first 8 chars ofsession_idasync: trueso it never blocks the agent's exitSetup steps after merge
claude-agent-done.jsoninto n8n and activate itDISCORD_CLAUDE_ALERTS_WEBHOOKwith the Discord URL.claude/settings.jsonif n8n is not on localhost (e.g.http://10.10.0.210:5678/webhook/claude-agent-done)Test
AI Code Review
Files Reviewed
.claude/settings.json(modified)productivity/n8n/workflows/claude-agent-done.json(added)productivity/n8n/workflows/claude-agent-notifications.md(added)productivity/n8n/CONTEXT.md(modified)productivity/n8n/workflows/README.md(modified)Findings
Correctness
connectionswiring matching node names exactly.subagent_nameandsession_idfallback cases, including the edge case where both are missing (returns'a subagent').responseMode: "immediatelyReturnWith200"pairs correctly with theasync: truehook — Claude Code won't wait for the response.settings.jsonJSON structure is valid; newhookskey is at the correct level alongside existing keys.Security
DISCORD_CLAUDE_ALERTS_WEBHOOK— correct approach.Style & Conventions
Suggestions
settings.jsonURL mismatch: The committed hook URL ishttp://localhost:5678/webhook/claude-agent-done, but per CONTEXT.md, n8n lives at10.10.0.210:5678. This won't fire on the actual system until manually updated after merge. The PR body documents this (step 4), but committing the real IP directly would eliminate that manual step since it's already public inCONTEXT.mdandREADME.md.JSON.stringify({ content: $json.content })as the JSON body expression. A plain object expression={{ { "content": $json.content } }}is more idiomatic in n8n. Both produce the same result, but the simpler form is less likely to confuse future editors.Verdict: APPROVED
Clean, minimal implementation. Secret handling is correct (n8n variable, nothing in config files), the async hook design is sound, the workflow logic handles all documented edge cases, and the documentation is thorough. The
localhostURL is the only real gotcha but it's acknowledged in the PR — safe to merge.Automated review by Claude PR Reviewer
I am confused about what problem this solves. What is the point?
2e08f6a4b8to0726d0337b