How Default Settings and Bad Habits Are Draining Your Claude Code Budget A developer's analysis of Claude Code's configuration files, environment variables, and API network traffic found that several default features silently inflate token costs, including background session-recap summaries, prompt suggestions, and the hybrid opusplan model setting that invalidates the prompt cache when switching between Opus and Sonnet. The writeup recommends disabling features such as awaySummaryEnabled and promptSuggestionEnabled via settings.json, noting that model switches mid-conversation can cost 20x to 80x more to rewrite tokens to the cache. Many developers use Claude Code and look for ways to reduce token consumption by using skills and external tools. But what if I told you that Claude Code includes several features enabled by default that silently impact your costs - through additional background API calls, bloating your context window, and breaking the prompt cache? Beyond settings, our workflow habits have a significant impact. The way we run commands, fix mistakes, ask side questions, and manage long sessions can dramatically affect context size and the number of API calls made. This article focuses on costs during ongoing work with Claude Code. For this purpose, I analyzed configuration files, environment variables, and actual API network traffic to understand what is really being sent to the model under the hood. The goal isn't to argue that you should turn off every single feature, but rather to raise awareness of their hidden costs, allowing you to choose whether the benefit of each feature justifies its price. This article is a follow-up to my previous article https://dev.to/fogel/how-to-reduce-claude-codes-initial-context-and-avoid-prompt-cache-breaks-12fg , where I explained how you can save up to 49% on a session's initial context. When we are in the middle of a session and no interaction occurs for at least 3 minutes, Claude Code generates a short summary of the conversation. The short summary is not added to the context. Yes. Generating the summary triggers an additional background API request that reuses the session's prompt cache. This action can run multiple times throughout a single session. I recommend disabling it. If you ever need a summary, you can easily trigger it manually using the /recap command. You can disable this via the /config https://code.claude.com/docs/en/interactive-mode session-recap menu or by setting awaySummaryEnabled: false https://code.claude.com/docs/en/settings-reference awaysummaryenabled in your settings.json file. After receiving a response from Claude, it usually provides a prompt suggestion as a follow-up, which you can accept by pressing Tab and then Enter . Not added, as long as you don't use the suggested prompt. The prompt suggestion typically occurs after every single response Claude gives us. It runs as an additional background API request that reuses the session's prompt cache. This action can run many times during a session. I rarely use Claude's suggestions, so the cost of this feature isn't worth it for me. You can disable this via the /config https://code.claude.com/docs/en/interactive-mode prompt-suggestions menu, or by setting promptSuggestionEnabled: false in settings.json , or by using the environment variable CLAUDE CODE ENABLE PROMPT SUGGESTION: false . opusplan model setting This represents an automatic hybrid approach. When the opusplan https://code.claude.com/docs/en/prompt-caching changing-permission-mode model is set, the transition between Opus and Sonnet models happens dynamically when entering or exiting plan mode. Switching models mid-conversation invalidates the prompt cache, resulting in paying 20x to 80x more to rewrite tokens to the cache. Auto memory allows Claude to accumulate knowledge and insights between sessions automatically without requiring us to write anything manually. Yes. You can read a detailed breakdown of its impact on the context in my previous article - How to Reduce Claude Code's Initial Context and Avoid Prompt Cache Breaks https://dev.to/fogel/how-to-reduce-claude-codes-initial-context-and-avoid-prompt-cache-breaks-12fg . Yes. During the conversation with Claude, the auto memory file MEMORY.md is updated, which consumes tokens. I find it unnecessary. It can cause conflicts between the memory and other information in the context, and it takes up valuable context space. You can disable https://code.claude.com/docs/en/memory enable-or-disable-auto-memory this via /memory , or by adding "autoMemoryEnabled": false to your settings.json , or by setting CLAUDE CODE DISABLE AUTO MEMORY=1 . Claude Code features several permission modes https://code.claude.com/docs/en/permission-modes available-modes : Note that default is not the actual default behavior. It is simply the name of the manual mode. The actual default permission mode is auto mode. Auto mode allows a classifier model to decide on its own whether to approve an action or not. This classifier model uses Claude Sonnet 5 https://code.claude.com/docs/en/permission-modes when-auto-mode-falls-back as seen under "Cost and latency" in the link . plan mode uses auto mode when available. Yes. Every permission decision automatically sends an API call to the classifier model, consuming additional tokens. Use acceptEdits mode combined with pre-approving specific commands. For example: JSON { "permissions": { "defaultMode": "acceptEdits", "allow": "Bash npm run build ", "Bash npm test: ", "Bash git diff: ", "Bash git status " } } You can completely prevent the use of auto mode by setting disableAutoMode: "disable" in settings.json . This will force the use of default manual mode as the default. Additionally, you can prevent auto mode usage during plan mode by toggling "Use auto mode during plan" in /config or set "useAutoModeDuringPlan": false in settings.json . prefix You can run shell commands directly in Claude Code https://code.claude.com/docs/en/interactive-mode shell-mode-with-prefix by prefixing the command with . npm test In practice, the shell command executes immediately on your machine, and behind the scenes, Claude Code sends both the command and its subsequent output as a prompt. Claude then responds to this prompt. We could have simply prompted npm test and let Claude Code run it via the shell tool, but that would result in two API calls instead of one and inflate the context even further. Yes, both the shell command and its output are added to the context. Yes, the shell command and its output are sent as a prompt, consuming tokens as usual. Claude will independently decide how to respond to this output unless we guided it beforehand. I prefer to review the shell output myself to decide what to do with it before Claude receives it. Therefore, I configure Claude so the shell command and its output are not sent as a prompt, but only added to the context. Once it is in the context, I can write a specific prompt telling Claude exactly what to do with that output. Additionally, this gives us the option to change our minds - if we regret running the command, we can use /rewind to remove the shell command and its output from the context before any API call is made. You can configure it so the output is added to the context without triggering a new API call by setting respondToBashCommands: false in settings.json . The LSP https://code.claude.com/docs/en/tools-reference lsp-tool-behavior is a tool designed for two main purposes: There is a Claude Code plugin that connects to the LSP, allowing Claude to receive this data and fix code issues without needing an extra build step to identify them. Furthermore, it allows for much more precise code navigation compared to standard grep-based searches. Yes, it is added as a tool named "LSP" along with its schema. When used, the tool call tool use and the LSP's response tool result are added to the context like any other tool. Using LSP actually saves tokens for the following reasons: grep command and analyzing the output, which would otherwise fill the context with a large number of irrelevant results. I believe it is crucial to use this plugin because it saves extra token-consuming API calls and performs actions faster than standard commands Claude would otherwise use, such as grep . Check out this Reddit post https://www.reddit.com/r/ClaudeCode/comments/1rh5pcm/enable lsp in claude code code navigation goes/ comparing code navigation using Claude Code with and without LSP. The performance difference is clear. The LSP binary and the Claude Code plugin depend on the programming language used in your project. You can find the list of LSP binaries and Claude Code plugins here https://code.claude.com/docs/en/discover-plugins code-intelligence . You must install the LSP binary on your machine before installing the Claude plugin. /context A command that outputs the number of tokens in the context, divided by categories system prompt, system tools, messages, etc. . The text printed to the screen adds ~2,100 tokens to the context. Every time you run the command, another 2,100 tokens are added in addition to the previous ones . The /context command is not billed for tokens https://platform.claude.com/docs/en/build-with-claude/token-counting pricing-and-rate-limits because it makes API calls for token counting, not for model inference. However, because it injects 2,100 tokens into your context, you will pay for those tokens on every single subsequent prompt you send Add the token count of the context window to your terminal's statusline so you are always aware of your context window during a session. Additionally, use this command only at the beginning of a conversation to understand how much space different components skills, MCPs, etc. consume, in order to perform context engineering. Subagents are specialized AI assistants that handle specific types of tasks. If the main agent were to perform tasks like reading massive log files, it would fill your main conversation's context with irrelevant information. Instead, the main agent can delegate verbose tasks to a subagent https://code.claude.com/docs/en/costs delegate-verbose-operations-to-subagents , which does the heavy work and returns only the relevant conclusions to the main agent. A subagent has its own context without the parent's conversation history and does not use the parent's cache https://code.claude.com/docs/en/sub-agents how-forks-differ-from-other-subagents . You can create a custom subagent and configure its initial context, including parameters such as: model to use, effort level, skills to preload, persistent memory scope, and whether to load the CLAUDE.md file. When using built-in subagents Explore, Plan, General-purpose in Claude Code, you can specify which model to use on a per-invocation basis https://code.claude.com/docs/en/sub-agents choose-a-model . Example: Spawn an Explore subagent on Haiku to find X Use subagents wisely, or you will end up with unnecessary token consumption. /btw command The /btw command https://code.claude.com/docs/en/interactive-mode side-questions-with-/btw is designed for asking a side question about your current session including the full conversation history without adding the question and the answer to your main conversation's context, and without using tools. Because it uses the existing context, it successfully reads from the cache. However, note that the cache write will be for 5 minutes, unlike the 1 hour used in the main conversation. If Claude provides an incorrect answer due to a poor prompt or a misunderstanding, don't argue with it in subsequent messages. Explaining "No, that's not what I meant, please undo that and try X" compounds unnecessary context that you will pay for on every subsequent turn. Instead, run /rewind https://code.claude.com/docs/en/prompt-caching rewinding-the-conversation to roll back the conversation to the turn before the mistake occurred. Fix your initial prompt and regenerate. Your context window stays lean, clean, and focused. When you see Claude starting to generate an answer and realize it's heading in the wrong direction, you can stop it immediately by pressing the ESC key. Yes, your prompt and Claude’s partial response are added to the context. Since this is irrelevant data, you can rewind https://code.claude.com/docs/en/costs work-efficiently-on-complex-tasks the context to a previous state using the /rewind command. The act of stopping the generation does not consume tokens. You only pay for what Claude generated up to that point. Stopping it early actually saves you from paying for the remaining output tokens Claude would have wasted on completing a wrong answer. Output tokens are significantly more expensive than input tokens often 5x the price . To maximize the benefits of prompt caching on Claude subscriptions, avoid leaving an active session idle for more than an hour https://code.claude.com/docs/en/prompt-caching cache-lifetime without completing the task. If the 1-hour cache expires https://code.claude.com/docs/en/costs why-usage-climbs-in-a-long-session , your next prompt will force a full cache rewrite of your entire context. Depending on the model, a cache write is 20x to 80x more expensive than a cache read under 1-hour cache TTL https://code.claude.com/docs/en/prompt-caching which-ttl-each-request-gets . Always try to complete your task with Claude without leaving the session idle for over an hour. Treat your sessions like focused sprints. Aim to finish your current interaction with Claude before taking a long break. Stepping away for more than an hour expires the cache, forcing a full cache rewrite for the entire context. When we want to start a fresh session, we use the /clear command. While this initiates a new session, it ironically adds the /clear command itself into the new context, along with text explaining that this is a user command. This adds ~130 tokens. No. The command itself is executed locally and does not trigger an API call or consume tokens. If you want a truly empty context, you have two options: /rewind command and revert to the message that says "/clear". This gives you a completely empty context. Efficient and cost-effective development with Claude Code isn't just about smart prompting. It requires a deep understanding of what happens behind the scenes to make informed use of tokens and properly manage context. As we've seen, reducing costs comes down to two key areas: ESC , rolling back mistakes with Ultimately, the goal isn't to turn off every feature or limit your developer experience, but to manage your environment wisely - ensuring that every token you pay for brings real value to your codebase. Here is a summary of the settings discussed in this article: { "promptSuggestionEnabled": false, "awaySummaryEnabled": false, "autoMemoryEnabled": false, "respondToBashCommands": false, "disableAutoMode": "disable", "useAutoModeDuringPlan": false, "permissions": { "defaultMode": "acceptEdits", "allow": "Bash git status ", "Bash git diff: ", "Bash npm test: ", "Bash npm run build " } }