[FEATURE] Write to subagent transcript during Task
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I want to be able to subagent behavior using hooks during their Task session based on their previous tool calls, especially Edit calls. Unfortunately, the JSONL subagent transcripts are not created until the subagent Task session completes.
Proposed Solution
Transcribe the subagent messages and tool calls immediately.
Alternative Solutions
I am currently logging every subagent tool call to attempt to parse but this is very tedious.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
- I have several subagents whose
[subagent name].mdfiles instruct them to use specific skills (e.g., database-engineer can use database-schemas and database-functions skills). I want to be able to enforce this. - I would then write a hook to check which subagent made a call to
EditorSkilland then return a decision on whether the tool use is allowed.
Additional Context
This would also enable the agent_id and agent_transcript_path parameters, which were added to SubagentStop in 2.0.42, to be used in additional hook events such as Edit and Skill. Adding agent_id to Skill would be especially helpful as it would enable limiting skills to select agents.
A better solution would be to just add subagent_type and agent_id to all tools, avoiding the need to parse transcripts.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗