MCPcopy
hub / github.com/codeaashu/claude-code / isAutoCompactEnabled

Function isAutoCompactEnabled

src/services/compact/autoCompact.ts:147–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145}
146
147export function isAutoCompactEnabled(): boolean {
148 if (isEnvTruthy(process.env.DISABLE_COMPACT)) {
149 return false
150 }
151 // Allow disabling just auto-compact (keeps manual /compact working)
152 if (isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) {
153 return false
154 }
155 // Check if user has disabled auto-compact in their settings
156 const userConfig = getGlobalConfig()
157 return userConfig.autoCompactEnabled
158}
159
160export async function shouldAutoCompact(
161 messages: Message[],

Callers 7

queryLoopFunction · 0.85
TokenWarningFunction · 0.85
analyzeContextUsageFunction · 0.85
shouldAutoCompactFunction · 0.85
initSessionMemoryFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85
getGlobalConfigFunction · 0.85

Tested by

no test coverage detected