Skip to content
SkilledDragonEngineering Intelligence
MinilabKeylessOctober 21, 2026

CacheCanario finds which Claude Code settings file turned idle compaction off

CacheCanario resolves Claude Code's compaction settings across every level, diffs them against an org policy and files one issue per drift. 19 of 19 fixture machines matched; 0 of 10 planted secrets leaked.

By David Discua

Measured in the lab

19/19
fixture scenarios matched
29 in 15 scenarios
drifts found
0/10
secret canaries leaked
155 ms
median check time
First scan2 create2
Same scan again2 noop0
Drift moves level2 update2
Machine fixed2 close4
  • 19 of 19 fixture machines resolved to the expected effective values
  • 7 precedence levels covered, from managed down to defaults
  • re-running the same scan made 0 HTTP writes
  • 10 planted secret canaries, 0 found in 16 output surfaces
  • dry run by default; issues are written only with --apply

From reports/cachecanario.json · run on October 21, 2026. Bun 1.4.3; 19 fixture scenarios against examples/policy.yml (6 rules); issue lifecycle against a local GitHub REST mock

How it is wired

readexpect--applySettings filesmanaged to userPolicy file6 rulesCacheCanarioresolve + diffGitHub issuesone per drift

01/04A machine has Claude Code settings at several levels.

Claude Code's idle compaction summarizes a long conversation you walked away from, shortly before its one-hour prompt cache expires, so your next message does not reprocess the whole thing. It is on by default, and one line in any of five settings files, or an exported DISABLE_AUTO_COMPACT=1, turns it off without telling anyone. CacheCanario reads every settings level, computes the effective value of each compaction setting, names the file that decided it, and files one GitHub issue per drift from an org policy. On 19 fixture machines it resolved every value we expected. The catch is that the precedence rules come from Claude Code's docs, not from the Claude Code binary.

The catch

We encoded precedence and compaction behavior from the Claude Code documentation fetched on October 21, 2026: idleCompaction (default true, needs v2.1.290 or later), CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS (default 200000, raised to 100000 if set lower), and the DISABLE_* switches. If a result surprises you, run /status or claude doctor on that machine.

CacheCanario also sees settings only. Idle compaction needs an interactive terminal session, the one-hour cache TTL and feature-flag fetching, so a machine where idleCompactionActive is true can still never idle-compact. Windows registry policies, WSL inheritance, policy helpers and the per-user macOS managed preferences path are not implemented. The server-managed cache format is undocumented, and CacheCanario assumes a settings object at the top level. Issue writes were tested only against a local GitHub REST mock, never github.com. The optional Gemini summary's live path was not run in this lab, so only its template fallback was observed.

What we ran (keyless)

git clone https://github.com/SkilledDragonCorp/cachecanario.git
cd cachecanario
bun install --frozen-lockfile
bun run cachecanario check --policy examples/policy.yml --fixture fixtures/scenarios/managed-first-wins
bun run report

From reports/cachecanario.json, run on October 21, 2026:

MeasureValue
Fixture scenarios matching expected values and drifts19 / 19
Precedence levels coveredcli, default, local, managed, process-env, project, user
Rules in examples/policy.yml6
Rule evaluations / drifts116 / 29 (in 15 scenarios)
Issue lifecycle on the GitHub mock2 create, 2 noop, 2 update, 2 close
HTTP writes per lifecycle step2 / 0 / 2 / 4
Secret canaries planted / found10 / 0
Median check time per scenario155 ms

A few rows show why the "which file" answer matters. In managed-first-wins, the idleCompaction key stayed at its default, and a DISABLE_AUTO_COMPACT value from the managed tier's env block turned idle compaction off anyway. In env-settings-over-shell, the shell exported a threshold of 150000 and the user settings env block set 300000. The settings value won and tripped the idle-threshold-ceiling rule. In old-version, the user set idleCompaction: false on Claude Code 2.1.280, which ignores the key, so idle compaction stayed on and the version rule flagged it. The canary test planted 10 secrets across env blocks, helper keys, the server-managed cache and the launch environment, then searched stdout, stderr, the --out file and every request body sent to the mock. It found none.

How it is wired

CacheCanario walks managed settings (server-managed cache, macOS plist, managed-settings.json and its drop-ins), then --settings, project local, shared project and user files, plus the launch environment. It merges them in documented order and keeps the level and file behind each value. Each file is projected onto the watched keys as soon as it is parsed, so the rest of the document never reaches output. One issue maps to one rule, machine and project, found again through a hidden fingerprint, so re-running the same scan writes nothing.

Minilab (open source)

CacheCanario reads the settings files of anthropics/claude-code (153,201 stars, TypeScript, no license listed by GitHub, as of October 24, 2026). Re-run bun run report and check that scenariosMatchingExpectations stays at 19 in reports/cachecanario.json. Point scan at your own project to see which file sets each value.

Run it yourself

SkilledDragonCorp/cachecanario

Clone, install and run the report with no API keys. The numbers above are what that run writes.

bun install --frozen-lockfile && bun run cachecanario check --policy examples/policy.yml --fixture fixtures/scenarios/managed-first-wins

SkilledDragon is not affiliated with Anthropic, GitHub or Google. Claude and Claude Code are trademarks of Anthropic. Numbers are from our own keyless lab run; re-run the report before relying on them. Marks belong to their owners.

All labs