TuBrief
Subscribed Channels
Videos
Community

Isolation Rules to Save 80% of Session Tokens When Fixing Legacy Code with Claude Code

TuBrief Editorial
September 12, 2026
0
Computing/Software

Written with AI assistance from the source video. The video is the authority.

English한국어Español中文العربيةDeutschFrançaisPortuguêsहिन्दीРусскийBahasa Indonesia日本語

Related Video

Give Me 50 Minutes, I'll Give You 1000+ Hours Of Claude Code Knowledge (2026 Guide)51:29

Give Me 50 Minutes, I'll Give You 1000+ Hours Of Claude Code Knowledge (2026 Guide)

Chase AI

More from the community

사내 시스템에 llm api 붙일 때 마주하는 현실적인 한계와 대응법

September 13, 2026

레거시 백엔드에 GPT-6 Astra 붙일 때 예산 승인과 보안 통과를 먼저 끝내는 법이 있습니다

September 13, 2026

에이전트끼리 대화하다 6천만 원 청구서가 나오는 이유

September 13, 2026

사내 RAG 벡터 검색에 Okta 권한 필터를 직접 거는 방법

September 13, 2026

브라우저 에이전트에게 내 구글 계정을 통째로 넘기면 안 되는 이유

September 12, 2026

Apple Won the AI Race

September 12, 2026

Comments (0)

Log in to leave a comment

No posts yet

© 2026 . All rights reserved.

TuBrief
Subscribed Channels
Videos
Community
Log in

Isolation Rules to Save 80% of Session Tokens When Fixing Legacy Code with Claude Code

When a solo developer with under a year of experience attaches Claude Code to a massive legacy codebase, the token budget depletes in under an hour. With no senior developer in the office to ask, and armed only with basic CLI commands, opening the terminal leads to nothing but a continuous stream of credit card charge alerts.

Claude Code does not persist conversation state on the server. The system prompt, the CLAUDE.md project configuration file, accumulated conversation history, and tool call results are bundled into a single payload every turn and sent back to the Anthropic API. In the first 1 or 2 turns right after session start, it stays around 15,000 tokens, but the moment the agent starts exploring and reads build outputs or tens of thousands of lines of logs, the payload balloons up to 80,000 tokens. Beyond 6 to 10 turns, 120,000 to 200,000 tokens fly back and forth every turn. It is a structure where costs compound with every turn.

The cause becomes clearer when looking at Anthropic's official prompt caching pricing. If the same prefix context is maintained, you only pay 10% of the cost compared to base input tokens. On the other hand, if the agent irregularly reads tens of thousands of lines of code, breaking the cache prefix, a cache creation cost 1.25 times higher with a 5-minute TTL is newly applied. This is why just a few searches run up fees that are difficult for a solo developer to handle.

.claudeignore Does Not Work

Many developers create a .claudeignore file in the root directory and feel relieved. To cut straight to the conclusion, such a configuration file does not exist in the official Claude Code CLI engine. The approach of writing "Do not read the logs folder" in CLAUDE.md is simply ignored if the model decides it is necessary.

To physically cut off the agent's file access at the engine level, you must use the permissions.deny setting in the .claude/settings.json file.

First, bundle build outputs and security files together in .claude/settings.json at the project root.