* 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
()
| 958 | * test sessions don't pollute the user's --resume list. |
| 959 | */ |
| 960 | private shouldSkipPersistence(): boolean { |
| 961 | const allowTestPersistence = isEnvTruthy( |
| 962 | process.env.TEST_ENABLE_SESSION_PERSISTENCE, |
| 963 | ) |
| 964 | return ( |
| 965 | (getNodeEnv() === 'test' && !allowTestPersistence) || |
| 966 | getSettings_DEPRECATED()?.cleanupPeriodDays === 0 || |
| 967 | isSessionPersistenceDisabled() || |
| 968 | isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY) |
| 969 | ) |
| 970 | } |
| 971 | |
| 972 | /** |
| 973 | * Create the session file, write cached startup metadata, and flush |
no test coverage detected