Nick Kanel
← All writeups

The default Claude Code settings I change, and why

Most of Claude Code’s defaults are fine, but a few of them cost tokens you don’t need to spend, or spend them at a moment you didn’t pick. These are the settings I change in ~/.claude/settings.json:

{
  "promptCacheTtl": "1h",
  "subagentPromptCacheTtl": "5m",
  "promptSuggestionEnabled": false,
  "awaySummaryEnabled": false,
  "idleCompaction": false,
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "refreshInterval": 10
  }
}

Most of this is about the prompt cache, so if you haven’t read them, my posts on what a session actually costs and subagents explain why the cache matters so much. The short version: every request re-sends the whole conversation, a warm cache makes that cheap, and an expired cache means paying to write the whole context again.

The prices below are Claude Opus 5.5’s list prices:1 $5 per million tokens for a 5-minute cache write, $8 for a 1-hour cache write, and $0.20 for a cache read.

promptCacheTtl: 1h

This sets how long the prompt cache of your main conversation lasts. With an API key, a cloud provider, or usage credits, Claude Code uses a 5-minute cache by default. On a Claude subscription within your plan’s usage, it already uses an hour.2 So this setting mostly matters if you pay per token.

The 1-hour cache costs more to write: $8 per million tokens instead of $5. It’s still worth it. When I went through several months of my own Claude Code use, the 1-hour cache came out ahead for my main sessions: it cut my total usage by 19% compared to the 5-minute cache. That’s because with a 5-minute cache I let it expire far more often than I’d expect. Five minutes goes quickly. Reading a long reply, reviewing a diff, trying out a change or just thinking about what to ask next can all take longer than that, and every time it does, the next turn writes the entire context again.

You can see why with a rough calculation. Say a session grows to 400k tokens. Each token gets written to the cache about once, so the 1-hour cache’s higher write price adds about 400k × $3 per million = $1.20 over the whole session. A single expiry at 400k tokens on the 5-minute cache costs 400k × $5 per million = $2.00, more than that whole premium. The Claude Code docs describe the same trade-off: the 1-hour cache pays off when you leave a session idle and come back to it, and costs more on short bursts of work that never pause for five minutes.3 My sessions aren’t short bursts.

It also helps with subagents. While a subagent works, the main conversation sends nothing, so a subagent that runs longer than five minutes lets the main cache expire.

There’s one case where this matters on a subscription too. Once you go over your plan’s limit and Claude Code draws on usage credits, it switches the main conversation to the 5-minute cache, and setting promptCacheTtl keeps the hour.2

You can also set it per session with the CLAUDE_CODE_PROMPT_CACHE_TTL environment variable. Both need Claude Code v2.1.242 or later.4

subagentPromptCacheTtl: 5m

This is the same setting for everything outside the main conversation: subagents, workflows, and Claude Code’s own background requests such as compaction and session titles.5

A subagent doesn’t wait for you. It runs from start to finish without stopping for input, and once it hands back its result it’s usually done for good. Even when Claude resumes one, it’s rarely after more than five minutes. Its cache almost never sits idle long enough for a 1-hour lifetime to make a difference, so the 1-hour write price would be 60% extra for nothing.

Five minutes is already the default for this bucket, on subscriptions and API keys alike,6 so today this setting mostly pins it in place. It also wins over ENABLE_PROMPT_CACHING_1H, an environment variable that asks for an hour on every request, main conversation and subagents alike.4 If you want the 1-hour cache for your own conversation, use promptCacheTtl instead of that variable.

The exception is a subagent that sits on one step for more than five minutes, such as a long test run or a build. Its next request after that rewrites its context. Subagent contexts are small, so I still come out ahead.

promptSuggestionEnabled and awaySummaryEnabled: false

Both of these are small features that send requests to the model on your behalf.

Prompt suggestions are the grayed-out guesses at your next message that show up in the input box after Claude responds. Claude Code generates each one with a background request to the same model your session is using, and that request counts toward your plan’s usage limits or your API costs.7 It reuses the prompt cache, so it’s mostly a cache read plus a few output tokens. But a cache read of a 400k-token context is still $0.08 on Opus 5.5, once for every response, for a suggestion that I have literally never once used.

Session recap is the one-line summary Claude Code shows when you come back to the terminal. It’s generated in the background once at least three minutes have passed since the last turn and the terminal isn’t focused.8 That’s another request, and Claude Code’s docs list it as one of the things that use tokens while you’re idle.9

Neither costs much on its own. But neither does anything I need, and on API billing both cost real money, so I turn them off.

idleCompaction: false

Idle compaction compacts a long conversation you’ve stepped away from. It runs when the conversation is on the 1-hour cache, its context is above 200k tokens, and about an hour has passed since the last request.10 The idea is to summarize the conversation just before the cache expires, while reading it is still cheap, so that your next message sends the short summary instead of rewriting the whole context.

That makes sense if you’re definitely coming back to continue the same work, but I’d rather decide that myself:

  • Compaction loses detail. I compact at a natural break, when I know what’s safe to drop. Idle compaction picks the moment for me, which can be in the middle of a task.
  • It can be pure waste. If I’m done with a session and leave it open by accident, idle compaction still runs. That’s a large request to summarize a conversation nobody will look at again.
  • I’d often choose something else. When I come back to a session whose cache has expired, I can /clear and start fresh, /compact it myself, or decide the rewrite is worth it. Idle compaction makes that choice before I’m back.

This one goes together with promptCacheTtl above. Idle compaction only runs on the 1-hour cache, so if you pay per token, setting promptCacheTtl to 1h is what makes your sessions eligible for it in the first place. Turning off autoCompactEnabled turns idle compaction off too, but that also stops compaction when the context fills up, which you probably want to keep.10

statusLine

The last one is my status line, which I wrote about in A Claude Code status line for watching context and cache. It keeps the numbers that decide what a session costs on screen: the context size in tokens, a countdown until the prompt cache expires, the session cost, and plan usage on a subscription. It’s what makes the settings above pay off, because you can see when the cache is about to go cold and when a session has grown big enough to clear.

It runs locally and doesn’t use any tokens.11 To install it:

git clone https://github.com/SnowySailor/claude.git
cd claude
./install.sh

References

Footnotes

  1. Claude API docs, Pricing. Prices as of November 2026. ↩

  2. Claude Code docs, How Claude Code uses prompt caching: “Unless you choose a TTL yourself, Claude Code requests the one-hour TTL only on a Claude subscription within your plan’s included usage.” And: “Once you go over your plan’s usage limit and Claude Code draws on usage credits, you are billed for that usage, so Claude Code drops the main conversation to the five-minute TTL, which charges a lower rate for cache writes. To keep the one-hour TTL there, choose the TTL yourself.” ↩ ↩2

  3. Claude Code docs, How Claude Code uses prompt caching: “The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused.” ↩

  4. Claude Code docs, How Claude Code uses prompt caching: “Both settings and both environment variables require Claude Code v2.1.242 or later.” The bucket’s setting comes before “ENABLE_PROMPT_CACHING_1H=1, which requests one hour for both buckets” in the order Claude Code checks them. ↩ ↩2

  5. Claude Code docs, Settings reference: “This key applies to subagents, workflows, and Claude Code’s own background and helper requests, such as compaction and session titles.” ↩

  6. Claude Code docs, How Claude Code uses prompt caching: “Subagents fall outside the main-conversation TTL bucket, so they get five minutes even on a subscription until you choose a longer one.” ↩

  7. Claude Code docs, Interactive mode: “Claude Code generates each of these next-prompt suggestions with a short background request to the same model your session is using. The request counts toward your plan’s usage limits or your API costs.” ↩

  8. Claude Code docs, Interactive mode: “The recap generates in the background once at least three minutes have passed since the last completed turn and the terminal is unfocused, so it’s ready when you switch back.” ↩

  9. Claude Code docs, Manage costs effectively: “Session recap and idle compaction can use tokens while you’re idle.” ↩

  10. Claude Code docs, Settings reference: “Idle compaction compacts a long conversation that you’ve stepped away from.” It’s on by default when the conversation is on the one-hour cache, its context has reached 200,000 tokens, and “about an hour has passed since the last request”. The autoCompactEnabled entry adds: “If you turn auto-compact off, idle compaction turns off too.” ↩ ↩2

  11. Claude Code docs, Customize your status line: “The status line runs locally and does not consume API tokens.” ↩

More writeups