SubagentStop

SubagentStop is a hook for coding agents from sehoon787/my-claude. Its token cost is not measured, scanned A, original, MIT.

A stop-event hook that runs when a subagent finishes. It records the subagent's type, work phase, sequence number, and a short task description in briefing files, then runs another command from the hook configuration.

In plain words
What is it for?
Use it to log completed subagent work and update session state when research, implementation, review, testing, planning, or debugging agents stop.
Why use it?
It keeps a shared record of subagent activity so a multi-agent session can track what happened after each worker finishes.

Hook

Part of the my-claude plugin — 4 skills, 8 hooks, 3 MCP servers shipped together

One of 8 entries in hooks.json — they are configured in one file and arrive together.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add hooks/sehoon787/my-claude/subagent-stop
Clone the repo
git clone --depth 1 https://github.com/sehoon787/my-claude

Or install my-claude, the plugin that ships this one along with the rest of its 4 skills, 8 hooks, 3 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for SubagentStop

README.md
[![agentmods](https://agentmods.dev/badge/hooks/sehoon787/my-claude/subagent-stop.svg)](https://agentmods.dev/hooks/sehoon787/my-claude/subagent-stop)
Your own site
<a href="https://agentmods.dev/hooks/sehoon787/my-claude/subagent-stop"><img src="https://agentmods.dev/badge/hooks/sehoon787/my-claude/subagent-stop.svg" alt="Measured on agentmods" height="20"></a>
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade A, and why

SubagentStop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

hooks/hooks.json · 24 lines

What it actually says

{
  "SubagentStop": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"const fs=require('fs');const d='.briefing/agents';if(fs.existsSync('.briefing/INDEX.md')){fs.mkdirSync(d,{recursive:true});const j=JSON.parse(fs.readFileSync(0,'utf8'));var at=j.agent_type||'unknown';var pm={'explore':1,'Explore':1,'research':1,'deep-research':1,'executor':2,'implementer':2,'general-purpose':2,'Senior Developer':2,'code-reviewer':3,'security-reviewer':3,'tdd-guide':4,'planner':5,'Plan':5,'architect':5,'debugger':6};var ph=['','research','implement','review','test','plan','debug'][pm[at]||0]||'';var sf='.briefing/state.json';var st={};try{st=JSON.parse(fs.readFileSync(sf,'utf8'))}catch(e){}var sq=(parseInt(st.subagentSeq,10)||0)+1;st.subagentSeq=sq;fs.writeFileSync(sf,JSON.stringify(st,null,2));var th=(j.description||j.name||'').slice(0,120);var e={ts:new Date().toISOString(),agent_id:j.agent_id||'unknown',agent_type:at,phase:ph,seq:sq,task_hint:th};fs.appendFileSync(d+'/agent-log.jsonl',JSON.stringify(e)+'\\n')}\"",
          "timeout": 5000
        },
        {
          "type": "command",
          "command": "node -e \"console.log(JSON.stringify({hookSpecificOutput:{hookEventName:'SubagentStop',additionalContext:'VERIFICATION REQUIRED: Subagent finished. (1) Read changed files yourself, (2) Run tests/diagnostics to verify, (3) Only then mark task complete. Agent execution auto-logged to .briefing/agents/agent-log.jsonl.'}}))\"",
          "timeout": 5000
        },
        {
          "type": "command",
          "command": "echo '{}' | node \"$HOME/.claude/hooks/session-sync.js\" subagent",
          "timeout": 5000,
          "description": "BriefingVault v2: track subagent events"
        }
      ]
    }
  ]
}
Same file

What else hooks.json configures

This page is one entry in a file that holds 8. Installing the file brings all of them; each is measured and scanned on its own page.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 24 lines scan A 14bdc86c2594

Subscribe to this mod's changes

SubagentStop is a hook published in the GitHub repository sehoon787/my-claude (16 stars, last pushed yesterday), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.