/** * Claude Code auto-compact window: where a session summarizes itself. * * Until compaction runs, every turn resends the whole conversation. Most of it * is a cache read, which is cheaper but still counts toward plan usage. On * 1M-context models Claude Code's own default waits until about 967K tokens, * so late turns each carry close to a million. Compacting at 400K keeps them * small. Claude Code compacts at the smaller of the setting and the model's * window, so 400K changes nothing on 200K models. * * Claude Code reads `autoCompactWindow` (100000 to 1000000) from each settings * file, user < project < local, and `modelSettings..autoCompactWindow` * (where `/autocompact` saves). A file that sets the top-level key replaces the * per-model values of the files below it; CLAUDE_CODE_AUTO_COMPACT_WINDOW wins * over all of them. */ export declare const DEFAULT_AUTO_COMPACT_WINDOW = 400000; export declare const MIN_AUTO_COMPACT_WINDOW = 100000; export declare const MAX_AUTO_COMPACT_WINDOW = 1000000; /** `400k`, `400000`, `1M` → tokens; undefined when outside 100K..1M or unreadable. */ export declare function parseWindow(value: string): number | undefined; export interface SettingsLayer { name: 'user' | 'project' | 'local'; file: string; } /** Claude Code's settings files, lowest precedence first. */ export declare function settingsLayers(home: string, projectRoot: string): SettingsLayer[]; export interface EffectiveWindow { /** Tokens, or undefined when Claude Code picks its own window ("auto"). */ window?: number; /** Where it comes from: a layer name, the env var, or 'auto'. */ source: SettingsLayer['name'] | 'env' | 'auto'; /** Per-model values still in force (model → tokens or "auto"). */ byModel: Record; } /** What Claude Code would use, following its own merge of settings files. */ export declare function effectiveWindow(home: string, projectRoot: string, env?: NodeJS.ProcessEnv): EffectiveWindow; /** Codex's own cap, from ~/.codex/config.toml, if one is set. */ export declare function codexCompactLimit(home: string): number | undefined; /** * Turn the 400K default on in a new project's `.claude/settings.json`, unless * that file already says something about the window or cannot be read. * Returns the line to print, or undefined when nothing changed. */ export declare function applyProjectDefault(projectRoot: string): string | undefined; export interface AutocompactOptions { at?: string; project?: boolean; home?: string; cwd?: string; env?: NodeJS.ProcessEnv; } export declare function autocompactCommand(action?: string, opts?: AutocompactOptions): Promise; /** What `autocompact status` prints. */ export declare function autocompactStatus(home: string, projectRoot: string, env?: NodeJS.ProcessEnv): string[]; //# sourceMappingURL=autocompact.d.ts.map