Don't save tokens. Protect context.
토큰을 아끼려다 컨텍스트를 잃으면, 더 비싸진다.
Don't save tokens. Protect context.
Trimming tokens to save context costs you more.
출력/입력 가격 배율은 모든 현행 모델에서 동일하게 5배. 실측 32일 출력/입력 볼륨 비율: 6.64배 실측. 비용의 86.9%는 출력이 만든다. Output/input price ratio is exactly 5x across all current models. Measured 32-day output/input volume ratio: 6.64x real data. 86.9% of cost comes from output.
비용이 어디서 나오는지 알면 — 어디를 눌러야 할지가 보인다. Know where cost comes from — you know where to push.
| 구성 요소Component | 토큰Tokens | 성격Type |
|---|---|---|
| tool_choice 오버헤드overhead | 497–589 | 고정fixed |
| bash 도구 정의tool def | 245 | 고정fixed |
| text_editor 도구 정의tool def | 700 | 고정fixed |
| 나머지 도구 ~17개~17 other tools | ~6,800 | 고정fixed |
| CLAUDE.md | 가변variable | 상시always |
| MCP 서버 스키마server schemas | 가변variable | 조건부conditional |
| 스킬 디스크립션Skill descriptions | 0 (요청 전before call) | on-demandon-demand |
첫 턴 캐시 쓰기 1.25x → 이후 0.1x 캐시 읽기. 도구를 줄이지 말고, 무엇을 추가로 얹나를 조심하라. 점진적 공개 원칙. First turn: cache write 1.25x → all subsequent: 0.1x. Don't remove tools — be careful about what you add on top. Progressive disclosure principle.
| 유형Type | 배율Multiplier | Opus 4.8 단가Opus 4.8 price | 손익분기Break-even |
|---|---|---|---|
| 표준 입력Standard input | 1.0x | $5.00 / MTok | — |
| 5분 캐시 쓰기5-min cache write | 1.25x | $6.25 | 1회 히트1 hit |
| 1시간 캐시 쓰기1-hr cache write | 2.0x | $10.00 | 2회 히트2 hits |
| 캐시 읽기 (히트)Cache read (hit) | 0.1x | $0.50 | 90% 절감90% saved |
[실측: 실험E] ccusage 32일 분석. 출처: ccusage v20.0.6 · 2026-06-01. 최소 캐시 길이: Opus 4.x 4,096 토큰, Sonnet 4.6 1,024 토큰. [real data: Exp-E] ccusage 32-day analysis. Source: ccusage v20.0.6 · 2026-06-01. Min cacheable: Opus 4.x 4,096 tokens, Sonnet 4.6 1,024 tokens.
cat bigfile.logDumping full logs — cat bigfile.loghead / grep / tail로 제한Limit big outputs with head / grep / tail[출처: Anthropic Cookbook] clearing은 캐시 프리픽스 무효화 → 재쓰기 1.25x. 누적 비용 공식: 결과 토큰 × 남은 턴 수. 손익분기 필수 계산. [Source: Anthropic Cookbook] Clearing invalidates cache prefix → rewrite 1.25x. Accumulation formula: result tokens × remaining turns. Always calculate break-even.
| 비교Comparison | 입력Input | 출력Output | 배율Ratio |
|---|---|---|---|
| 단가 (전 모델)Price (all models) | 1x | 5x | 5x |
| 실측 볼륨 비율Measured volume ratio | 1x | 6.64x | 6.64x |
| 실측 비용 기여Measured cost share | 14% | 86% | — |
| 캐시 적용 여부Cache applicable | 가능 (0.1x)Yes (0.1x) | 불가No | — |
| Edit vs Write (500줄 파일 3줄 수정)(3-line fix in 500-line file) | — | — | ~15x |
출력 다이어트는 입력 다이어트의 13배 효과. 입력 최적화 하한선: 0.1x (캐시 히트). 출력 최적화 하한선: 0 (생성 안 함). Output diet is 13x more effective than input diet. Input optimization floor: 0.1x (cache hit). Output floor: 0 (don't generate).
자동 컴팩션 트리거 ~95%. 즉 950k 도달 전 자발적 정리 필요. 중요 수치는 반드시 파일로 저장. Auto-compaction at ~95%. Self-clear before 950k. Always save key numbers to files.
| 작업 유형Task type | 추천 모델Recommended | Opus 대비 절감Savings vs Opus |
|---|---|---|
| 복잡한 추론 · 심층 분석 · 1M+ 입력Complex reasoning · deep analysis · 1M+ input | Opus 4.8 | — |
| 코드 생성 · 리팩터링 · 일반 작업Code gen · refactoring · general tasks | Sonnet 4.6 | 입력 40% · 출력 40%input 40% · output 40% |
| 분류 · 포맷 변환 · 단순 필터링Classification · format convert · simple filter | Haiku 4.5 | 입력 80% · 출력 80%input 80% · output 80% |
Opus 74.8% → 50%로 라우팅하면 43% 절감 가능. Opus 손익분기: Sonnet 대비 1.67배 이상 품질 향상 필요. Opus 4.7+ 신규 토크나이저 → 동일 텍스트 최대 ~35% 토큰 증가. Routing Opus 74.8% → 50% saves 43%. Opus break-even: 1.67x quality gain over Sonnet needed. Opus 4.7+ new tokenizer → same text up to ~35% more tokens.
마라톤 세션 = 어텐션 효율 50%. 후반부 작업은 사실상 2배 비싸다. Marathon session = 50% attention efficiency. Later tasks are effectively 2x more expensive.
세션 중 모델 전환 · MCP 변경 → 캐시 무효화. 반드시 세션 경계에서 설정 변경. Model switch or MCP change mid-session → cache invalidation. Always change settings at session boundaries.
캐시를 깨지 않는 세션 아키텍처. 32일 실측 $758 절감. 세션 중 설정 변경 금지.Session architecture that preserves cache. $758 saved in 32 days. No mid-session config changes.
메인 컨텍스트 오염 방지. 결과×남은턴 > 10K일 때 위임. 총 토큰 절감 도구가 아님.Prevents main context pollution. Delegate when result×remaining_turns > 10K. Not a total-token saver.
결정론적 작업(lint·통계·포맷)을 PostToolUse 훅으로. 모델 호출 없음 = 토큰 0.Deterministic tasks (lint·stats·format) via PostToolUse hooks. No model call = 0 tokens.
점진적 공개: CLAUDE.md (상시) → 스킬 (on-demand) → 파일 직접 읽기 (필요시). 손익분기: 결과 × 남은 턴 > 5,000~10,000 토큰이면 위임이 이득. Progressive disclosure: CLAUDE.md (always) → skills (on-demand) → direct file reads (when needed). Break-even: result × remaining turns > 5,000–10,000 tokens → delegate.
Opus 74.8% 점유. 50%로 낮추면 43% 절감.Opus at 74.8%. Lower to 50% → 43% savings.
100턴+ → 어텐션 효율 50% → 후반 작업 2x 비쌈.100+ turns → 50% attention → later tasks 2x cost.
5,000 토큰 × 20턴 = 100K 어텐션 부담.5,000 tokens × 20 turns = 100K attention burden.
Edit=200 tok vs Write=3,000 tok. 500줄 파일 3줄 수정 = 15배 낭비.Edit=200 tok vs Write=3,000 tok. 3-line fix in 500-line file = 15x waste.
5k 토큰 = 매 턴 어텐션 1/5. 규칙 1,000개 ≈ 규칙 0개.5k tokens = 1/5 attention per turn. 1,000 rules ≈ 0 rules.
[실측: 실험E] $1,415/월 기준 — 5개 안티패턴 제거 시 $373~$1,015/월 절감 가능 (26~72%). 출처: ccusage 32일 분석. [real data: Exp-E] $1,415/month baseline — removing 5 anti-patterns saves $373–$1,015/month (26–72%). Source: ccusage 32-day analysis.
| 상황Situation | 1순위 도구Top lever | 절감 규모Impact | 근거Source |
|---|---|---|---|
| 파일 일부 수정Partial file edit | Edit (diff만)(diff only) | ~15x 출력 절감output saved | 출력 5x 단가output 5x price |
| 컨텍스트 과부하Context overload | tool result clearing | 피크 -48%peak -48% | Anthropic Cookbook |
| 세션 전환 (연속)Session continue | /compact (lossylossy) | -50% | 실측measured |
| 세션 전환 (새 작업)New task | /clear | 완전 초기화full reset | — |
| 대형 탐색 격리Large exploration | 서브에이전트 위임Subagent delegation | 메인 -92%main -92% | 실측measured |
| 단순 분류 · 포맷Simple classify / format | Haiku 4.5 | Opus 대비vs -80% | 가격 구조pricing |
Rule No.2 — Don't save tokens. Protect context. · Claude Code 102 · 2026-06 · 모든 수치 출처: reference/, experiments/ Rule No.2 — Don't save tokens. Protect context. · Claude Code 102 · 2026-06 · All figures: reference/, experiments/