* Kind override from env. Set by the spawner (`claude --bg`, daemon * supervisor) so the child can register without the parent having to * write the file for it — cleanup-on-exit wiring then works for free. * Gated so the env-var string is DCE'd from external builds.
()
| 29 | * Gated so the env-var string is DCE'd from external builds. |
| 30 | */ |
| 31 | function envSessionKind(): SessionKind | undefined { |
| 32 | if (feature('BG_SESSIONS')) { |
| 33 | const k = process.env.CLAUDE_CODE_SESSION_KIND |
| 34 | if (k === 'bg' || k === 'daemon' || k === 'daemon-worker') return k |
| 35 | } |
| 36 | return undefined |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * True when this REPL is running inside a `claude --bg` tmux session. |
no test coverage detected