MCPcopy
hub / github.com/liuup/claude-code-analysis / shouldSkipPersistence

Method shouldSkipPersistence

src/utils/sessionStorage.ts:960–970  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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

Callers 2

appendEntryMethod · 0.95

Calls 3

isEnvTruthyFunction · 0.85
getNodeEnvFunction · 0.85

Tested by

no test coverage detected