* 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
()
| 1039 | * test sessions don't pollute the user's --resume list. |
| 1040 | */ |
| 1041 | private shouldSkipPersistence(): boolean { |
| 1042 | const allowTestPersistence = isEnvTruthy( |
| 1043 | process.env.TEST_ENABLE_SESSION_PERSISTENCE, |
| 1044 | ) |
| 1045 | return ( |
| 1046 | (getNodeEnv() === 'test' && !allowTestPersistence) || |
| 1047 | getSettings_DEPRECATED()?.cleanupPeriodDays === 0 || |
| 1048 | this.persistenceUnavailable || |
| 1049 | isSessionPersistenceDisabled() || |
| 1050 | isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY) |
| 1051 | ) |
| 1052 | } |
| 1053 | |
| 1054 | /** |
| 1055 | * Create the session file, write cached startup metadata, and flush |
no test coverage detected