Skip to content

Expose CollabAgentSpawn{Begin,End} as hook events #15486

Closed as not planned
Closed as not planned

Description

@mr-lee

What variant of Codex are you using?

CLI

What feature would you like to see?

I'd like to hook into subagent (collaboration agent) lifecycle events via hooks.json, the same way I can hook into SessionStart, UserPromptSubmit, and Stop today.

Specifically, I'm requesting that CollabAgentSpawnBegin and CollabAgentSpawnEnd be exposed as configurable hook events in hooks.json.

The internal protocol already defines these events with rich data:

  • CollabAgentSpawnBeginEvent: call_id, sender_thread_id, prompt, model, reasoning_effort
  • CollabAgentSpawnEndEvent: call_id, sender_thread_id, new_thread_id, new_agent_nickname, new_agent_role, prompt, status

This data is exactly what's needed to track subagent delegation — which agents were spawned, their parent/child relationships, what they were asked to do, and whether they succeeded.

Use case: I'm hooking into agent lifecycles to understand subagent delegation patterns — which subagents get spawned, how they relate to parent sessions, and their outcomes. The existing hooks cover the main agent loop well, but subagent spawning/completion is invisible from the hook surface today.

This seems aligned with the lifecycle hooks work mentioned in #13498 (which scopes "subagent boundaries") and the broader hooks expansion tracked in #2109.

Additional information

The hook engine architecture already supports this cleanly — each hook event follows the same pattern (enum variant + schema + dispatcher entry + registry method). The data structures in the protocol are already perfectly shaped for hook exposure. The gap is purely in the hooks.json engine wiring.

Happy to discuss the use case in more detail if helpful.

Activity

  1. added
    agentIssues related to the core agent loop
    and removed
    CLIIssues related to the Codex CLI
    on Mar 23, 2026
  2. added
    hooksIssues related to event hooks
    and removed
    agentIssues related to the core agent loop
    on Apr 2, 2026
  3. etraut-openai commented on May 2, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received enough upvotes, so I'm closing it.

  4. oxysoft commented on May 8, 2026

    @oxysoft

    Indexed this hook ticket in the umbrella tracker: #21753

    Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthooksIssues related to event hooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions