# Quick Task Summary: Subagent guard for session-resume

## What Changed

Added a guard at the top of `session-resume` that skips all resume output for non-interactive sessions.

## Research Findings

- **SessionStart hooks do NOT fire for Agent-tool subagents** — they get `SubagentStart` instead
- **Psyche `claude -p --agent` sessions DO trigger SessionStart** and would receive unwanted resume XML
- **Hooks always receive JSON on stdin** with `agent_type` (if launched via `--agent`) and `source` fields
- **TTY detection is useless** — all hooks get piped stdin regardless of session type

## Guard Logic

Three checks, any of which skips resume output:

1. **`agent_type` in stdin JSON** — catches psyche wrappers (`claude --agent owl-psyche`) and any agent-mode sessions
2. **`source: "compact"` in stdin JSON** — prevents wasteful re-emission during context compaction
3. **`CLAUDE_CODE_TEAM_NAME` env var** — catches agent team members
4. **`OWL_SKIP_RESUME` env var** — explicit opt-out for scripted/automated sessions

## Files Modified

| File | Change |
|------|--------|
| `src/owl/resume.rs` | Added `HookInput` struct, `should_skip_resume()`, guard at top of `run()` |
