MCPcopy
hub / github.com/claude-code-best/claude-code / shouldSkipPersistence

Method shouldSkipPersistence

src/utils/sessionStorage.ts:982–992  ·  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

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

Callers 2

appendEntryMethod · 0.95

Calls 3

getNodeEnvFunction · 0.85
isEnvTruthyFunction · 0.70

Tested by

no test coverage detected