Skip to main content

seed_auto_compact_window

Function seed_auto_compact_window 

Source
pub fn seed_auto_compact_window(
    provider: &ProviderConfig,
    config_dir: &str,
    compact_at: u64,
) -> Result<bool>
Expand description

Seeds Claude Code’s autoCompactWindow into a config dir’s settings.json from SETTING_COMPACT_AT (compact_at), so agents compact at that size instead of near a full 1M window.

Writes it when absent, or when the present value is AgentMux’s own (the one recorded in [SEEDED_SIDECAR], or 633,000 with no sidecar); any other value is a person’s choice and is left alone. compact_at 0 removes AgentMux’s own value. Claude only; never rewrites a settings.json it can’t parse as a JSON object. Returns Ok(true) only when it wrote.