Discovery (S172)
SubagentStop hook event fires on EVERY response turn, not just when Agent tool sub-agents complete. Claude Code internally creates an agent per turn with empty agent_type.
Payload differences:
- Real sub-agent: agent_type=general-purpose (or Explore, etc)
- Internal turn: agent_type empty
Current impact:
- subagent_stop_gate.py runs drone @git status every turn (~600ms wasted when no files modified)
- Piper speaks subagent stop gate every turn
- Checker itself works correctly — finds violations when files ARE modified
Potential optimization:
- Read agent_type from stdin — skip full git status + seedgo check when empty (internal turn)
- Or: only run when modified file count > 0 via a lighter check than drone subprocess
- Keep Piper speaking regardless so the trust layer stays visible
Not urgent — 600ms overhead is tolerable, checker is functional, no false positives.
Discovery (S172)
SubagentStop hook event fires on EVERY response turn, not just when Agent tool sub-agents complete. Claude Code internally creates an agent per turn with empty agent_type.
Payload differences:
Current impact:
Potential optimization:
Not urgent — 600ms overhead is tolerable, checker is functional, no false positives.