source dump of claude code
at main 18 lines 693 B view raw
1import { createStore } from '../../state/store.js' 2 3/** 4 * Tracks whether the "context left until autocompact" warning should be suppressed. 5 * We suppress immediately after successful compaction since we don't have accurate 6 * token counts until the next API response. 7 */ 8export const compactWarningStore = createStore<boolean>(false) 9 10/** Suppress the compact warning. Call after successful compaction. */ 11export function suppressCompactWarning(): void { 12 compactWarningStore.setState(() => true) 13} 14 15/** Clear the compact warning suppression. Called at start of new compact attempt. */ 16export function clearCompactWarningSuppression(): void { 17 compactWarningStore.setState(() => false) 18}