MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / isAutoCompactEnabled

Function isAutoCompactEnabled

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

Source from the content-addressed store, hash-verified

174}
175
176export function isAutoCompactEnabled(): boolean {
177 if (isEnvTruthy(process.env.DISABLE_COMPACT)) {
178 return false
179 }
180 // Allow disabling just auto-compact (keeps manual /compact working)
181 if (isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) {
182 return false
183 }
184 // Check if user has disabled auto-compact in their settings
185 const userConfig = getGlobalConfig()
186 return userConfig.autoCompactEnabled
187}
188
189export async function shouldAutoCompact(
190 messages: Message[],

Callers 7

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

Calls 2

getGlobalConfigFunction · 0.85
isEnvTruthyFunction · 0.50

Tested by

no test coverage detected