[{"data":1,"prerenderedAt":1192},["ShallowReactive",2],{"blog-post-claude-code-auto-compact-settings":3,"related-posts-claude-code-auto-compact-settings":1164,"decoder-links-claude-code-auto-compact-settings":1191},{"id":4,"title":5,"author":6,"body":11,"category":1140,"date":1141,"description":1142,"extension":1143,"featured":1144,"hideToc":1144,"image":1145,"imageAlt":1146,"imageHeight":1147,"imageWidth":1148,"itemList":1149,"lang":1149,"meta":1150,"navigation":1151,"noindex":1144,"path":1152,"readingTime":1153,"redirected":1144,"relatedSlugs":1149,"seo":1154,"seoTitle":1155,"stem":1156,"subtitle":1149,"tags":1157,"updatedDate":1141,"__hash__":1163},"blog/blog/claude-code-auto-compact-settings.md","Claude Code Auto Compact: What the Threshold Is, the Two Settings That Change It, and the Cost",{"name":7,"role":8,"avatar":9,"bio":10},"Shabnam Katoch","Growth Head","/img/avatars/shabnam-profile.jpeg","Shabnam leads growth at BetterClaw and has spent the past three years building organic distribution for AI-native products. She writes about no-code agent builders, content strategy, and what it actually takes to grow without an ads budget.",{"type":12,"value":13,"toc":1120},"minimark",[14,18,30,86,89,95,102,105,110,113,150,157,196,199,292,295,299,302,305,340,343,346,355,359,362,365,426,431,437,445,452,455,458,547,552,555,561,564,568,574,588,599,604,607,614,620,634,640,644,652,655,662,667,673,677,680,761,767,770,777,781,784,909,915,919,929,936,939,950,970,977,981,995,1001,1011,1018,1022,1025,1032,1047,1051,1056,1059,1063,1066,1070,1083,1087,1102,1106,1109,1113,1116],[15,16,17],"p",{},"On 1M-context models the default waits until about 967K tokens. Here is what that costs per request, the two settings that move it, and the value we would pick.",[15,19,20,21,25,26,29],{},"Claude Code auto compact summarizes your conversation when the context nears its auto-compact window. On 1M-context models such as Opus 5.5 that happens at about 967K tokens, so every request before it re-sends a huge context. Two settings move the point: ",[22,23,24],"code",{},"autoCompactWindow"," sets the window in tokens, and ",[22,27,28],{},"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE"," sets a lower percentage of it.",[31,32,34],"callout",{"type":33},"quick-fix",[35,36,37,45,55,69,78],"ul",{},[38,39,40,44],"li",{},[41,42,43],"strong",{},"Default trigger on 1M-context models:"," about 967K tokens.",[38,46,47,50,51,54],{},[41,48,49],{},"Fastest change:"," run ",[22,52,53],{},"/autocompact 400k"," in a session (saved for the current model).",[38,56,57,60,61,64,65,68],{},[41,58,59],{},"Every model:"," add ",[22,62,63],{},"\"autoCompactWindow\": 400000"," to ",[22,66,67],{},"~/.claude/settings.json",".",[38,70,71,74,75,77],{},[41,72,73],{},"As a share of the window:"," ",[22,76,28],{},", 1 to 100, lower only.",[38,79,80,74,83,68],{},[41,81,82],{},"Compact by hand:",[22,84,85],{},"/compact focus on \u003Cwhat to keep>",[15,87,88],{},"Picture this: you're three hours into a refactor on Opus 5.5. The context meter says 610K, and every small question (\"does it compile now?\") sends all 610K back to the model.",[15,90,91],{},[92,93,94],"em",{},"Wait. Why does each message cost more than it did this morning?",[15,96,97,98,101],{},"Because nothing has compacted yet. On a 1M-context model, ",[41,99,100],{},"Claude Code auto compact waits until about 967K tokens",", and until then each request carries the whole conversation.",[15,103,104],{},"We checked every key below against Claude Code's docs and changelog on 10 November 2026 (latest version 2.1.322).",[106,107,109],"h2",{"id":108},"claude-code-auto-compact-settings-the-quick-answer","Claude Code auto compact settings: the quick answer",[15,111,112],{},"You need one line. This sets the window for every model in your user settings:",[114,115,120],"pre",{"className":116,"code":117,"language":118,"meta":119,"style":119},"language-json shiki shiki-themes github-light","{\n  \"autoCompactWindow\": 400000\n}\n","json","",[22,121,122,131,144],{"__ignoreMap":119},[123,124,127],"span",{"class":125,"line":126},"line",1,[123,128,130],{"class":129},"sgsFI","{\n",[123,132,134,138,141],{"class":125,"line":133},2,[123,135,137],{"class":136},"sYu0t","  \"autoCompactWindow\"",[123,139,140],{"class":129},": ",[123,142,143],{"class":136},"400000\n",[123,145,147],{"class":125,"line":146},3,[123,148,149],{"class":129},"}\n",[15,151,152,153,156],{},"The other route is a percentage, set as an environment variable. You can put it in the same file under ",[22,154,155],{},"env",":",[114,158,160],{"className":116,"code":159,"language":118,"meta":119,"style":119},"{\n  \"env\": {\n    \"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE\": \"50\"\n  }\n}\n",[22,161,162,166,174,185,191],{"__ignoreMap":119},[123,163,164],{"class":125,"line":126},[123,165,130],{"class":129},[123,167,168,171],{"class":125,"line":133},[123,169,170],{"class":136},"  \"env\"",[123,172,173],{"class":129},": {\n",[123,175,176,179,181],{"class":125,"line":146},[123,177,178],{"class":136},"    \"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE\"",[123,180,140],{"class":129},[123,182,184],{"class":183},"sYBdl","\"50\"\n",[123,186,188],{"class":125,"line":187},4,[123,189,190],{"class":129},"  }\n",[123,192,194],{"class":125,"line":193},5,[123,195,149],{"class":129},[15,197,198],{},"Those are the two settings. There are five ways to apply the window, and they don't all win the same way:",[200,201,202,218],"table",{},[203,204,205],"thead",{},[206,207,208,212,215],"tr",{},[209,210,211],"th",{},"Where you set it",[209,213,214],{},"What it changes",[209,216,217],{},"Version",[219,220,221,238,250,263,279],"tbody",{},[206,222,223,228,235],{},[224,225,226],"td",{},[22,227,53],{},[224,229,230,231,234],{},"Current model, saved under ",[22,232,233],{},"modelSettings"," in user settings",[224,236,237],{},"v2.1.221+, per model from v2.1.288",[206,239,240,244,247],{},[224,241,242],{},[22,243,63],{},[224,245,246],{},"Every model, from any settings file",[224,248,249],{},"Current versions",[206,251,252,257,260],{},[224,253,254],{},[22,255,256],{},"claude --autocompact 400k",[224,258,259],{},"One launch, saved settings untouched",[224,261,262],{},"v2.1.221+",[206,264,265,270,273],{},[224,266,267],{},[22,268,269],{},"CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000",[224,271,272],{},"Beats the command, the flag and the key",[224,274,275,278],{},[22,276,277],{},"400k"," suffix needs v2.1.304+",[206,280,281,286,289],{},[224,282,283],{},[22,284,285],{},"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50",[224,287,288],{},"A lower percentage of the window",[224,290,291],{},"No version stated",[15,293,294],{},"Claude Code caps any window at the model's real context window.",[106,296,298],{"id":297},"what-auto-compact-does-and-when-it-fires","What auto compact does, and when it fires",[15,300,301],{},"Compaction replaces your message history with a summary, so the next request carries a small fraction of the old context.",[15,303,304],{},"The auto-compact window is how full the context can get before that happens. If you set nothing, the model configuration page lists these defaults:",[35,306,307,313,319,328,334],{},[38,308,309,312],{},[41,310,311],{},"Native 1M-context models"," (the Fable models, Sonnet 5 and later, Haiku 5.5, Opus 4.7 and later): about 967K tokens.",[38,314,315,318],{},[41,316,317],{},"Sonnet 4.6 and Opus 4.6"," without extended context: the 200K boundary.",[38,320,321,327],{},[41,322,323,324,156],{},"Any native 1M model with ",[22,325,326],{},"CLAUDE_CODE_DISABLE_1M_CONTEXT=1"," the 200K boundary.",[38,329,330,333],{},[41,331,332],{},"A model ID Claude Code doesn't recognize",", such as a gateway alias: the window it assumes, 200K.",[38,335,336,339],{},[41,337,338],{},"Cloud sessions:"," as the conversation approaches the model's limit.",[15,341,342],{},"That 967K figure wasn't picked for cost. The v2.1.247 changelog moved Sonnet 5's default window to its full 1M context, \"so sessions on the 1M window now auto-compact at about 967K tokens instead of about 934K.\" It's tuned to stay clear of the wall, not to keep your bill small.",[15,344,345],{},"The summary keeps your requests and key code snippets, but Anthropic's docs warn that detailed instructions from early in the conversation may be lost. After compacting, Claude Code reloads your project-root CLAUDE.md and auto memory from disk, re-reads up to five recently modified files, and re-attaches each invoked skill, capped at 5,000 tokens per skill and 25,000 in total.",[15,347,348,349,354],{},"That's why a session can feel dumber right after a summary. Before you blame the model, run through our checklist in ",[350,351,353],"a",{"href":352},"/blog/is-opus-5-5-nerfed","is Opus 5.5 nerfed",": a badly timed compaction is one of the look-alike causes.",[106,356,358],{"id":357},"why-the-default-is-expensive-on-1m-context-models","Why the default is expensive on 1M-context models",[15,360,361],{},"Claude Code \"sends your full conversation with every request,\" per its cost docs. Caching makes that cheap, but cheap times 600,000 adds up.",[15,363,364],{},"Here's what one request costs on Opus 5.5 at Anthropic's listed rates: $4 per million input tokens, $20 per million output, $0.20 per million for cache hits and $5 per million for 5-minute cache writes. Anthropic bills the full 1M window at standard rates, so there's no long-context surcharge to add.",[200,366,367,380],{},[203,368,369],{},[206,370,371,374,377],{},[209,372,373],{},"Context in the request",[209,375,376],{},"Warm cache (read at $0.20/M)",[209,378,379],{},"Cold cache (re-written at $5/M)",[219,381,382,393,404,415],{},[206,383,384,387,390],{},[224,385,386],{},"100K",[224,388,389],{},"$0.02",[224,391,392],{},"$0.50",[206,394,395,398,401],{},[224,396,397],{},"200K",[224,399,400],{},"$0.04",[224,402,403],{},"$1.00",[206,405,406,409,412],{},[224,407,408],{},"400K",[224,410,411],{},"$0.08",[224,413,414],{},"$2.00",[206,416,417,420,423],{},[224,418,419],{},"967K",[224,421,422],{},"$0.19",[224,424,425],{},"$4.84",[15,427,428],{},[92,429,430],{},"Calculated from Anthropic's list prices on 10 November 2026, input side only, before new tokens and output.",[15,432,433,434],{},"The cold column is the one that hurts. With an API key, Claude Code gives the main conversation a 5-minute cache by default; a Claude subscription gets one hour. ",[41,435,436],{},"Step away for six minutes at 900K on an API key, and your next one-line message costs dollars, not cents.",[15,438,439,440,444],{},"On a Pro, Max or Ultra plan you don't see dollars, but the same tokens come out of your usage limits. The cost docs say a one-line question in a session open all day \"still draws usage for the whole conversation.\" If that's how your week keeps running out, our guide to the ",[350,441,443],{"href":442},"/blog/claude-rate-limit-reached","Claude rate limit reached error"," shows how to tell which limit you hit.",[15,446,447],{},[448,449],"img",{"alt":450,"src":451},"Claude Code auto compact context growth: default compaction near 967K versus a 400K window, with the input cost of each request shaded","/img/blog/claude-code-auto-compact-settings-context-growth.jpg",[15,453,454],{},"So how much does compacting earlier save? One user reported that compacting at 400K instead of about 967K cut their cost per request by 43%. We can't check their session, so we built our own.",[15,456,457],{},"Say a session runs 200 requests on Opus 5.5 with an API key and a warm cache. Each request adds 10,000 new tokens and returns 1,000. After a compaction the context restarts at 60,000 tokens, and the summary itself costs 10,000 output tokens.",[200,459,460,479],{},[203,461,462],{},[206,463,464,467,470,473,476],{},[209,465,466],{},"Compaction point",[209,468,469],{},"Compactions",[209,471,472],{},"Session cost",[209,474,475],{},"Per request",[209,477,478],{},"vs default",[219,480,481,498,515,531],{},[206,482,483,486,489,492,495],{},[224,484,485],{},"About 967K (default)",[224,487,488],{},"2",[224,490,491],{},"$34.47",[224,493,494],{},"$0.172",[224,496,497],{},"baseline",[206,499,500,503,506,509,512],{},[224,501,502],{},"600K",[224,504,505],{},"3",[224,507,508],{},"$28.25",[224,510,511],{},"$0.141",[224,513,514],{},"18% lower",[206,516,517,519,522,525,528],{},[224,518,408],{},[224,520,521],{},"5",[224,523,524],{},"$25.78",[224,526,527],{},"$0.129",[224,529,530],{},"25% lower",[206,532,533,535,538,541,544],{},[224,534,397],{},[224,536,537],{},"14",[224,539,540],{},"$26.52",[224,542,543],{},"$0.133",[224,545,546],{},"23% lower",[15,548,549],{},[92,550,551],{},"Calculated from Anthropic's list prices on 10 November 2026; compaction modelled at the window. The workload is hypothetical.",[15,553,554],{},"Look at the last row: at 200K the session compacts 14 times, and the summaries eat the saving.",[556,557,558],"blockquote",{},[15,559,560],{},"Compacting earlier is cheaper until it isn't. Every compaction is a paid request of its own.",[15,562,563],{},"On a plan, a smaller window stretches your week the same way. Try it before you upgrade, and if you still need more room, compare Claude Max vs Ultra.",[106,565,567],{"id":566},"window-or-percentage-the-two-settings-side-by-side","Window or percentage: the two settings side by side",[15,569,570,571,573],{},"The ",[22,572,24],{}," key takes a token count from 100,000 to 1,000,000 and works in any settings file. Left unset, Claude Code picks a window tuned for your model.",[15,575,576,577,580,581,583,584,587],{},"A window you save with ",[22,578,579],{},"/autocompact"," lands under ",[22,582,233],{}," for the current model, and that beats the top-level key in the same file. The ",[22,585,586],{},"CLAUDE_CODE_AUTO_COMPACT_WINDOW"," variable beats everything, which is why the docs suggest it for scripts and cloud environments.",[15,589,590,591,594,595,598],{},"One trap with that variable: a bare number means tokens. ",[22,592,593],{},"CLAUDE_CODE_AUTO_COMPACT_WINDOW=200"," is 200 tokens, so Claude Code warns and treats it as the 100K minimum, even though ",[22,596,597],{},"/autocompact 200"," means 200,000.",[15,600,601,603],{},[22,602,28],{}," works differently. Per the environment variable reference, it sets \"the percentage (1-100) of the auto-compact window at which auto-compaction triggers.\" It can only lower the trigger, and values above the default percentage are ignored.",[15,605,606],{},"Anthropic doesn't publish what that default percentage is. The docs also say the variable applies only in sessions that compact before the model's context limit, which includes every native 1M model at its default.",[15,608,609,610,613],{},"Set both, and the percentage applies to the window you set: a 400K window with ",[22,611,612],{},"50"," compacts around 200K.",[15,615,616,617,619],{},"We'd pick one. The window is a plain token count, and ",[22,618,579],{}," shows it back to you.",[15,621,622,623,625,626,629,630,633],{},"The percentage has one real use: it applies to subagents as well as the main conversation. For a single subagent, the cleaner tool is ",[22,624,24],{}," in its frontmatter (v2.1.296+). Write it as ",[22,627,628],{},"200000",", because in frontmatter ",[22,631,632],{},"200k"," reads as 200 and Claude Code ignores it.",[15,635,636],{},[448,637],{"alt":638,"src":639},"Claude Code auto compact settings.json card: autoCompactWindow and CLAUDE_AUTOCOMPACT_PCT_OVERRIDE highlighted, with the precedence order","/img/blog/claude-code-auto-compact-settings-two-keys.jpg",[106,641,643],{"id":642},"the-trade-off-more-compactions-and-what-each-one-forgets","The trade-off: more compactions, and what each one forgets",[15,645,646,647,651],{},"Every compaction is a pause. One user reported each one taking about 76 seconds on a large session. Hermes Agent users know this wait too, and our ",[350,648,650],{"href":649},"/blog/hermes-agent-compaction-slow-fix","Hermes Agent compaction fixes"," cover its version of the trade-off.",[15,653,654],{},"Per the prompt caching docs, compaction is a separate request that repeats your history; with a warm cache it reads it cheaply and \"spends most of its time generating the summary.\"",[15,656,657,658,661],{},"Then there's what the summary drops: rules with ",[22,659,660],{},"paths:"," frontmatter and nested CLAUDE.md files drop out until Claude touches a matching file again, and long instructions you typed in hour one can shrink to a line.",[556,663,664],{},[15,665,666],{},"If a rule has to survive compaction, it belongs in your project-root CLAUDE.md, not in a message you sent at 9 a.m.",[15,668,669],{},[448,670],{"alt":671,"src":672},"Claude Code auto compact trade-off table: earlier compaction versus the default on cost per request, number of compactions, waits and what the summary drops","/img/blog/claude-code-auto-compact-settings-trade-off.jpg",[106,674,676],{"id":675},"picking-a-value-for-your-work","Picking a value for your work",[15,678,679],{},"Start from how you work, not from the default. These are our picks, not Anthropic's:",[200,681,682,695],{},[203,683,684],{},[206,685,686,689,692],{},[209,687,688],{},"Your work",[209,690,691],{},"Our pick",[209,693,694],{},"Why",[219,696,697,711,722,733,746],{},[206,698,699,702,708],{},[224,700,701],{},"Bug fixes and short tasks",[224,703,704,707],{},[22,705,706],{},"/clear"," between tasks, 300K window",[224,709,710],{},"Stale context is pure cost",[206,712,713,716,719],{},[224,714,715],{},"A day of feature work in one repo",[224,717,718],{},"400K to 500K",[224,720,721],{},"Big saving, few summaries",[206,723,724,727,730],{},[224,725,726],{},"Long agent runs, big codebase reads",[224,728,729],{},"Default, reads pushed to subagents",[224,731,732],{},"Keeps the main thread clean",[206,734,735,738,743],{},[224,736,737],{},"A gateway that rejects requests over 200K",[224,739,740],{},[22,741,742],{},"CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000",[224,744,745],{},"Anthropic's documented fix",[206,747,748,755,758],{},[224,749,750,751,754],{},"Scripts and ",[22,752,753],{},"-p"," runs",[224,756,757],{},"The environment variable",[224,759,760],{},"Overrides every saved setting",[15,762,763,764,766],{},"Our default for most people is ",[22,765,53],{},", saved per model.",[15,768,769],{},"Always-on agents have the same problem: they re-send context on every step, all night.",[15,771,772,773],{},"That's why BetterClaw runs agents on your own API key: bring your own key across 28+ providers with zero markup, so your provider bills you directly and the spend limit you set on that key stays the real ceiling. Plans start at $19 a month, and your first workspace starts with a 7-day free trial. ",[350,774,776],{"href":775},"/pricing","See BetterClaw plans",[106,778,780],{"id":779},"claude-code-auto-compact-not-working-five-causes","Claude Code auto compact not working? Five causes",[15,782,783],{},"Most cases come down to one of these:",[200,785,786,799],{},[203,787,788],{},[206,789,790,793,796],{},[209,791,792],{},"What you see",[209,794,795],{},"Likely cause",[209,797,798],{},"Fix",[219,800,801,826,848,872,894],{},[206,802,803,806,812],{},[224,804,805],{},"Your window is ignored",[224,807,808,809,811],{},"A higher settings scope, the environment variable or a per-model ",[22,810,579],{}," value wins",[224,813,814,815,818,819,822,823,825],{},"Run ",[22,816,817],{},"/status"," and check ",[22,820,821],{},"Setting sources","; run ",[22,824,579],{}," to see the window in use",[206,827,828,833,839],{},[224,829,830,831],{},"A warning quoting ",[22,832,586],{},[224,834,835,836],{},"The value is out of range, or a bare ",[22,837,838],{},"200",[224,840,841,842,844,845,847],{},"Use ",[22,843,628],{},", or ",[22,846,632],{}," on v2.1.304+",[206,849,850,855,865],{},[224,851,852],{},[22,853,854],{},"Context limit reached · /compact or /clear to continue · auto-compact is off · /config to turn it on",[224,856,857,860,861,864],{},[22,858,859],{},"autoCompactEnabled"," is false, or ",[22,862,863],{},"DISABLE_AUTO_COMPACT"," is set",[224,866,867,868,871],{},"Turn Auto-compact back on in ",[22,869,870],{},"/config",", or unset the variable",[206,873,874,877,883],{},[224,875,876],{},"A 1M model compacting at 200K",[224,878,879,882],{},[22,880,881],{},"CLAUDE_CODE_DISABLE_1M_CONTEXT",", or a model ID Claude Code doesn't recognize",[224,884,885,886,889,890,893],{},"Unset the variable; for a gateway ID, run ",[22,887,888],{},"claude update"," or add a ",[22,891,892],{},"modelOverrides"," entry",[206,895,896,901,904],{},[224,897,898],{},[22,899,900],{},"Autocompact is thrashing: the context refilled to the limit...",[224,902,903],{},"One file or tool output refills the window after each summary",[224,905,906,907],{},"Read the file in chunks, use a subagent, or run ",[22,908,706],{},[15,910,911,912,914],{},"If ",[22,913,579],{}," isn't a known command, you're on a version before v2.1.221.",[106,916,918],{"id":917},"the-manual-command-compact-and-when-to-use-it-instead","The manual command: /compact, and when to use it instead",[15,920,921,924,925,928],{},[22,922,923],{},"/compact"," summarizes the conversation on demand, and it takes focus instructions: ",[22,926,927],{},"/compact focus on the auth bug fix",". That summary keeps what you chose instead of what the automatic pass guesses matters.",[15,930,931,932,935],{},"For a standing rule, add a \"Compact instructions\" section to your project's CLAUDE.md, and run ",[22,933,934],{},"/context"," to see what fills the window.",[15,937,938],{},"We'd compact by hand at three moments:",[35,940,941,944,947],{},[38,942,943],{},"Before starting a new task in the same session.",[38,945,946],{},"Before stepping away from a large session on an API key, so the next message doesn't hit a cold cache at full size.",[38,948,949],{},"After a big exploration you only need the conclusions from.",[15,951,952,953,955,956,958,959,962,963,965,966,969],{},"If you don't need continuity at all, ",[22,954,706],{}," is better: the cost docs note it \"costs nothing,\" while ",[22,957,923],{}," is itself a large request. ",[22,960,961],{},"DISABLE_AUTO_COMPACT=1"," stops the automatic pass but keeps ",[22,964,923],{},"; ",[22,967,968],{},"DISABLE_COMPACT=1"," turns off both.",[15,971,972,973,68],{},"For more ways to keep context small, from output compression to MCP pruning, see our guide to ",[350,974,976],{"href":975},"/blog/skills-that-reduce-token-usage","skills that reduce token usage",[106,978,980],{"id":979},"related-settings-that-touch-cost","Related settings that touch cost",[15,982,983,986,987,990,991,994],{},[22,984,985],{},"cleanupPeriodDays"," keeps session transcripts for 30 days by default, then deletes them silently. It doesn't change what a request costs, but it decides how long ",[22,988,989],{},"/resume"," can find an old session. The minimum is 1; ",[22,992,993],{},"0"," fails validation.",[15,996,997,1000],{},[22,998,999],{},"idleCompaction"," is on by default. It compacts a conversation of 200,000 tokens or more after about an hour idle, before its one-hour cache expires, so your next message doesn't reprocess everything. It needs the one-hour cache, which a subscription gets by default and an API key doesn't.",[15,1002,1003,1006,1007,1010],{},[22,1004,1005],{},"promptCacheTtl"," set to ",[22,1008,1009],{},"1h"," (v2.1.242+) gives an API-key session that longer cache. On Opus 5.5 the hour-long write costs $8 per million tokens instead of $5, so it pays off if you often step away for longer than five minutes.",[15,1012,1013,1014,1017],{},"Effort matters too. Opus 5.5 defaults to ",[22,1015,1016],{},"medium",", and the settings reference notes lower levels are faster and cheaper on straightforward tasks.",[106,1019,1021],{"id":1020},"the-default-is-a-ceiling-not-a-recommendation","The default is a ceiling, not a recommendation",[15,1023,1024],{},"967K was tuned so a session almost never hits the wall. It wasn't tuned for your bill.",[15,1026,1027,1028,1031],{},"Pick the window you'd actually pay for. Then watch ",[22,1029,1030],{},"/usage"," for a day and move it once.",[31,1033,1035,1040],{"type":1034},"cta",[15,1036,1037],{},[41,1038,1039],{},"Want a second pair of eyes on your agent costs?",[15,1041,1042,1043],{},"If your team runs Claude Code, scripts and always-on agents side by side, we can map where the tokens go with you. The AI automation audit starts with a 30-minute call about how your team works, and within 5 business days you get a report with where agents fit, the agent architecture and ROI projections. ",[350,1044,1046],{"href":1045},"/ai-automation-audit","Book an AI automation audit",[106,1048,1050],{"id":1049},"frequently-asked-questions","Frequently Asked Questions",[1052,1053,1055],"h3",{"id":1054},"what-is-claude-code-auto-compact","What is Claude Code auto compact?",[15,1057,1058],{},"Auto compact is Claude Code's automatic summary of a long conversation. When the context nears the auto-compact window, Claude Code replaces the message history with a summary so the session can continue. Your project-root CLAUDE.md, auto memory and up to five recent files are reloaded afterwards.",[1052,1060,1062],{"id":1061},"what-is-the-default-auto-compact-threshold","What is the default auto compact threshold?",[15,1064,1065],{},"On native 1M-context models, including the Fable models, Sonnet 5 and later, Haiku 5.5 and Opus 4.7 and later, Claude Code compacts at about 967K tokens by default. Sonnet 4.6 and Opus 4.6 without extended context compact at 200K. Model IDs Claude Code doesn't recognize compact at an assumed 200K window.",[1052,1067,1069],{"id":1068},"how-do-i-change-the-auto-compact-window","How do I change the auto compact window?",[15,1071,814,1072,1074,1075,64,1077,1079,1080,1082],{},[22,1073,53],{}," to save a window for the current model, or add ",[22,1076,63],{},[22,1078,67],{}," for every model. Values run from 100,000 to 1,000,000 tokens. The ",[22,1081,586],{}," environment variable overrides both.",[1052,1084,1086],{"id":1085},"why-is-auto-compact-not-working","Why is auto compact not working?",[15,1088,1089,1090,1092,1093,1095,1096,1098,1099,1101],{},"Usually a higher settings scope or the environment variable overrides your value, auto-compact is turned off in ",[22,1091,870],{}," or with ",[22,1094,863],{},", or your version is older than the setting needs. Run ",[22,1097,817],{}," to see which settings files loaded and ",[22,1100,579],{}," to see the window in use.",[1052,1103,1105],{"id":1104},"does-compacting-reduce-cost","Does compacting reduce cost?",[15,1107,1108],{},"Yes, up to a point. Each request re-sends the whole context, so a smaller context makes every request cheaper; in our calculated example a 400K window cut cost per request by about 25% on Opus 5.5. Compacting too often adds summary requests that eat the saving.",[1052,1110,1112],{"id":1111},"what-does-claude_autocompact_pct_override-do","What does CLAUDE_AUTOCOMPACT_PCT_OVERRIDE do?",[15,1114,1115],{},"It sets the percentage, from 1 to 100, of the auto-compact window at which compaction triggers, for both the main conversation and subagents. It can only lower the trigger: values above the default percentage are ignored. Anthropic doesn't publish the default percentage, so the window setting is easier to reason about.",[1117,1118,1119],"style",{},"html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}",{"title":119,"searchDepth":133,"depth":133,"links":1121},[1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132],{"id":108,"depth":133,"text":109},{"id":297,"depth":133,"text":298},{"id":357,"depth":133,"text":358},{"id":566,"depth":133,"text":567},{"id":642,"depth":133,"text":643},{"id":675,"depth":133,"text":676},{"id":779,"depth":133,"text":780},{"id":917,"depth":133,"text":918},{"id":979,"depth":133,"text":980},{"id":1020,"depth":133,"text":1021},{"id":1049,"depth":133,"text":1050,"children":1133},[1134,1135,1136,1137,1138,1139],{"id":1054,"depth":146,"text":1055},{"id":1061,"depth":146,"text":1062},{"id":1068,"depth":146,"text":1069},{"id":1085,"depth":146,"text":1086},{"id":1104,"depth":146,"text":1105},{"id":1111,"depth":146,"text":1112},"Guides","2026-11-13","How Claude Code auto compact works, the default threshold, the two settings that change when it compacts, the cost per request and when it is not working.","md",false,"/img/blog/claude-code-auto-compact-settings.jpg","Claude Code auto compact cover: a context bar filling toward a compact marker at 967K, with a settings card showing autoCompactWindow set to 400000",512,1024,null,{},true,"/blog/claude-code-auto-compact-settings","10 min read",{"title":5,"description":1142},"Claude Code Auto Compact: Threshold, Window and Settings","blog/claude-code-auto-compact-settings",[1158,1159,1160,24,28,1161,1162],"claude code auto compact","claude code auto compact threshold","claude code auto compact window","claude code auto compact not working","claude code /compact command","plMt6DMS_f55EkhGICfnNbuX7tdErl14DDqZrO2f5I4",[1165,1173,1183],{"stem":1166,"title":1167,"description":1168,"date":1169,"image":1170,"category":1171,"redirected":1144,"author":1172,"readingTime":1153},"blog/claude-md-vs-agents-md","CLAUDE.md vs AGENTS.md: Which File Each Agent Reads, and How to Keep One Copy","CLAUDE.md vs AGENTS.md: which tools read which file, how to keep one source of truth with an import or symlink, and where skills.md and hooks fit.","2026-11-10","/img/blog/claude-md-vs-agents-md.jpg","Comparison",{"name":7,"role":8,"avatar":9,"bio":10},{"stem":1174,"title":1175,"description":1176,"date":1177,"image":1178,"category":1179,"redirected":1144,"author":1180,"readingTime":1182},"blog/claude-cowork-missing-hcs-services-perbaikan","Perbaikan Claude Cowork \"Missing HCS Services (hns, vmcompute, vfpext)\" (2026)","Perbaiki Claude Cowork di Windows: bug update Windows September 2026, \"missing HCS services: hns, vmcompute, vfpext\", tab abu-abu, dan gagal dimuat.","2026-11-04","/img/blog/claude-cowork-missing-hcs-services-perbaikan.jpg","Troubleshooting",{"name":7,"role":8,"avatar":9,"url":1181,"bio":10},"https://www.betterclaw.io/about","14 menit membaca",{"stem":1184,"title":1185,"description":1186,"date":1187,"image":1188,"category":1140,"redirected":1144,"author":1189,"readingTime":1190},"blog/claude-skills-token-verbrauch-senken","Die besten Claude Skills gegen hohen Token-Verbrauch (2026): Caveman, RTK und 5 Methoden, die funktionieren","Caveman, RTK und claude-token-optimizer im Vergleich: Einsparung, Installation und 5 Methoden, die eine Claude-Rechnung von $304 auf $56 im Monat senken.","2026-11-03","/img/blog/claude-skills-token-verbrauch-senken.jpg",{"name":7,"role":8,"avatar":9,"url":1181,"bio":10},"14 Min. Lesezeit",[],1794569881646]