/** * Context-window constants — single source of truth. * * Several Claude Code budgets scale with the model's context window: * - the skill listing is allotted ~2% of context (CC 2.1.32, changelog L2860); * - the "CLAUDE.md is too long" warning threshold scales with it (CC 2.1.169). * * We cannot observe the user's actual context window, so scanners anchor on a * conservative 200k window (the smallest common size — it fires earliest, the * safe default when the window is unknown) and disclose the relaxed 1M figure. * * Zero external dependencies. */ // Conservative anchor: the smallest common context window. Budgets anchored // here fire earliest, which is the safe default when the window is unknown. export const CONTEXT_WINDOW_ANCHOR = 200_000; // Large context window (Opus/Sonnet 1M tier). Used to disclose how a budget // relaxes on large-context models. export const LARGE_CONTEXT_WINDOW = 1_000_000; // How much larger the 1M window is than the 200k anchor (= 5). A budget that // scales linearly with the window relaxes by this factor at 1M. export const LARGE_CONTEXT_SCALE = LARGE_CONTEXT_WINDOW / CONTEXT_WINDOW_ANCHOR; // Dependency-free thousands separator (repo invariant: zero external deps). export const withCommas = (n) => String(n).replace(/\B(?=(\d{3})+(?!\d))/g, ',');