Summary
When a Task subagent (Explore, Plan, etc.) runs tools, those tools should be identifiable in the sesslog as coming from an agent rather than the main session.
Current Behavior
[[2026-02-01 18:56:21]] {Bash: ls -d src/*/ }
No indication whether this Bash command was run by the main session or by a subagent.
Desired Behavior
[[2026-02-01 18:56:21]] {Bash|Explore: ls -d src/*/ }
[[2026-02-01 18:56:31]] {Bash: rm test.txt } # Main session, no prefix
Format: {Tool|AgentType: content } when running inside a subagent.
Implementation Notes
- Need to investigate PostToolUse JSON structure to determine how agent context propagates
- Agent types include:
Explore, Plan, Bash, general-purpose, claude-code-guide
- Model info not needed (user can check transcript if needed)
- Should handle nested agents gracefully
Analysis
See 2026-02-01__19-10-22__session-logger-enhancements-analysis.md for detailed analysis.
Summary
When a Task subagent (Explore, Plan, etc.) runs tools, those tools should be identifiable in the sesslog as coming from an agent rather than the main session.
Current Behavior
No indication whether this Bash command was run by the main session or by a subagent.
Desired Behavior
Format:
{Tool|AgentType: content }when running inside a subagent.Implementation Notes
Explore,Plan,Bash,general-purpose,claude-code-guideAnalysis
See
2026-02-01__19-10-22__session-logger-enhancements-analysis.mdfor detailed analysis.