NewsCrawler.org

Splitting Claude Code sessions cut main-session token use per test ticket by 15%

Claude Codeの1回のリクエストを半分にしたら、テスト1件でどれだけ節約できたのか
Image: zenn.dev

QA engineer Motegi at Deep Groove writes that after handing Claude Code the design, execution and fix checks of tests, he began hitting the weekly usage limit. Logs from late October to November, on a Team plan, showed that in one session of 960 requests, 53% of consumption was context reloading[1], because each request rereads all earlier exchanges.

To reduce this, he split sessions when the context passed 150,000 tokens, with a warning from a hook[2]. Median input tokens per request per ticket fell from 490,000 to 260,000, about 39% less for the whole week. However, 22 of the 40 splits happened in the middle of a task, so he raised the threshold to 300,000. After that, no new session was restarted within 15 minutes, compared with 7 such cases at 150,000.

Median main-session consumption per ticket fell from 29.6M to 25.1M, a 15% reduction. M here means millions of weighted tokens; the author chose the weights from the ratios of Claude API prices. Test execution by subagents[3] was about 10% of total use, and the main session was close to 70%. On 19 November the limit was hit again after 4 days and 17 hours, and the author attributes the freed budget to new skills that run subagents; their effect is still being measured.

Repository Claude Code github.com

Agentic coding tool that runs in the terminal, reads your codebase and handles routine coding tasks and git workflows via natural language.

Stars: 150,000Forks: 25,000Updated:

Read the original zenn.dev

Sources

  • Zenn JA

    Claude Codeの1回のリクエストを半分にしたら、テスト1件でどれだけ節約できたのか

    10 likes1 bookmark0 comments

Published: First seen: Читать по-русски

Open as a page