* True when test env / cleanupPeriodDays=0 / --no-session-persistence / * CLAUDE_CODE_SKIP_PROMPT_HISTORY should suppress all transcript writes. * Shared guard for appendEntry and materializeSessionFile so both skip * consistently. The env var is set by tmuxSocket.ts so Tungsten-spawned
()
| 980 | * test sessions don't pollute the user's --resume list. |
| 981 | */ |
| 982 | private shouldSkipPersistence(): boolean { |
| 983 | const allowTestPersistence = isEnvTruthy( |
| 984 | process.env.TEST_ENABLE_SESSION_PERSISTENCE, |
| 985 | ) |
| 986 | return ( |
| 987 | (getNodeEnv() === 'test' && !allowTestPersistence) || |
| 988 | getSettings_DEPRECATED()?.cleanupPeriodDays === 0 || |
| 989 | isSessionPersistenceDisabled() || |
| 990 | isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY) |
| 991 | ) |
| 992 | } |
| 993 | |
| 994 | /** |
| 995 | * Create the session file, write cached startup metadata, and flush |
no test coverage detected