ponytail/hooks
Shane McCarron b9fa564429
feat: inject ponytail ruleset into subagents via SubagentStart hook (#254)
* feat: inject ponytail ruleset into subagents via SubagentStart hook

SessionStart additionalContext is parent-thread only, so every Task-spawned
agent ran ponytail-unaware. Add a SubagentStart hook that injects the active
ruleset into each subagent, reusing getPonytailInstructions. Native Claude
needs the hookSpecificOutput JSON form (not raw stdout), so writeHookOutput
grows a SubagentStart branch; readMode exposes the live flag.

Workflow- and team-spawned coverage is undocumented upstream; verify in a
fresh session once installed.

Closes #252

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1dMag33yz1Kf1jS24Aira

* fix: address QA round 1 — make hook tests hermetic + cover Codex SubagentStart

QA round 1 (panel + deepseek-v4-pro) found two real test issues:
- The new subagent block (and the pre-existing claudeEnv block) used a no-op
  `delete env.PLUGIN_DATA`; run() spreads process.env, so a PLUGIN_DATA /
  COPILOT_PLUGIN_DATA leaked from the shell would steer writeHookOutput into the
  codex/copilot branch and silently mis-fire the native-Claude assertions.
  Fixed at the source: neutralize both vars once at the top, like CLAUDE_CONFIG_DIR.
- The Codex SubagentStart branch (claude-codex-hooks.json is shared by both plugin
  manifests) had zero coverage. Added a codex-path assertion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1dMag33yz1Kf1jS24Aira

* fix: use PowerShell-safe command form for SubagentStart hook

Match the post-#265 'node ...; exit 0' form used by the sibling hooks. The old 'command -v node ... || exit 0' form fails tests/hooks-windows.test.js (POSIX-guard and non-blocking asserts) once this branch merges onto current main.

---------

Co-authored-by: Shane McCarron <shane.mccarron@corvexconnect.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Emeriko <dietrich.gebert@gmail.com>
2026-06-24 04:19:14 +02:00
..
claude-codex-hooks.json feat: inject ponytail ruleset into subagents via SubagentStart hook (#254) 2026-06-24 04:19:14 +02:00
copilot-hooks.json Adding support for Copilot Marketplace plugin (#47) 2026-06-15 11:02:59 +02:00
ponytail-activate.js fix: don't embed shell-unsafe install paths in statusline setup nudge (#224) 2026-06-21 01:58:21 +02:00
ponytail-config.js fix: don't embed shell-unsafe install paths in statusline setup nudge (#224) 2026-06-21 01:58:21 +02:00
ponytail-instructions.js fix: comprehension-first guard + reuse rung (#245, #217) (#253) 2026-06-22 23:30:05 +02:00
ponytail-mode-tracker.js fix: only deactivate on a standalone "stop ponytail" / "normal mode" (#162) 2026-06-18 22:50:03 +02:00
ponytail-runtime.js feat: inject ponytail ruleset into subagents via SubagentStart hook (#254) 2026-06-24 04:19:14 +02:00
ponytail-statusline.ps1 fix: statusline reads flag from CLAUDE_CONFIG_DIR, not just ~/.claude (#34 follow-up) (#154) 2026-06-18 22:50:17 +02:00
ponytail-statusline.sh fix: statusline reads flag from CLAUDE_CONFIG_DIR, not just ~/.claude (#34 follow-up) (#154) 2026-06-18 22:50:17 +02:00
ponytail-subagent.js feat: inject ponytail ruleset into subagents via SubagentStart hook (#254) 2026-06-24 04:19:14 +02:00