transcript-capture-detached-background-process-pattern
Session-close hooks must complete in under 1 second to avoid blocking Claude Code. The transcript capture hook spawns conversation-flush.py as a detached background process (nohup + subprocess.Popen with DEVNULL stdout/stderr) and exits immediately. The flush script then runs independently for 30-60 seconds extracting insights via the Agent SDK. This pattern applies to any hook that needs to do LLM work at session close.
Related
- conversation-flush-jsonl-transcript-pipeline
- clawteam-openclaw-multi-agent-swarm-evaluation
- 2026-04-04-oracle-001-self-architecture-analysis
- enterprise-capability-expansion-5-pillars-from-digital-employee-analysis
- jsonl-transcript-path-and-structure-for-flush
- precompact-hook-as-transcript-capture-safety-net
- transcript-capture-dedup-window-120s
- deferred-queue-writer-is-utility-not-hook
- harness-engineering-research-fully-covered-no-gaps