<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Claude Code on KnightLi Blog</title>
        <link>https://www.knightli.com/en/tags/claude-code/</link>
        <description>Recent content in Claude Code on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Sun, 19 Apr 2026 18:27:23 +0800</lastBuildDate><atom:link href="https://www.knightli.com/en/tags/claude-code/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Karpathy&#39;s 65-Line CLAUDE.md: Helping AI Coding Avoid Three Common Mistakes</title>
        <link>https://www.knightli.com/en/2026/04/19/karpathy-claude-md-ai-coding-rules/</link>
        <pubDate>Sun, 19 Apr 2026 18:27:23 +0800</pubDate>
        
        <guid>https://www.knightli.com/en/2026/04/19/karpathy-claude-md-ai-coding-rules/</guid>
        <description>&lt;p&gt;A GitHub project about AI coding has been getting a lot of attention recently. Its core is not a complex codebase, but a roughly 65-line &lt;code&gt;CLAUDE.md&lt;/code&gt; file. The reason it attracted so many stars is not technical complexity. It is that it captures problems many people repeatedly run into when using AI to write code.&lt;/p&gt;
&lt;p&gt;The background starts with Andrej Karpathy&amp;rsquo;s observations on AI coding. Karpathy is an influential educator and engineer in AI: a Stanford PhD, an early OpenAI contributor, and a former Tesla AI leader responsible for Autopilot&amp;rsquo;s vision system. He has continued to share his views on large models, education, and AI tools, so his comments on changes in programming workflows tend to draw a lot of attention from developers.&lt;/p&gt;
&lt;p&gt;He once said that after using Claude Code for a few weeks, his programming style changed noticeably. Previously it was roughly 80% handwritten code and 20% AI assistance. Now it is closer to 80% code written by AI and 20% edits by himself. He described it as &amp;ldquo;programming in English&amp;rdquo;, telling an LLM what to write through natural language.&lt;/p&gt;
&lt;p&gt;But he also pointed out several recurring problems in AI coding.&lt;/p&gt;
&lt;h2 id=&#34;01-wrong-assumptions&#34;&gt;01 Wrong Assumptions
&lt;/h2&gt;&lt;p&gt;The first problem is that models easily make assumptions on behalf of the user, then keep writing along that path. They do not always manage their own confusion, and they do not always stop to ask questions when the requirement is ambiguous.&lt;/p&gt;
&lt;p&gt;For example, if the user only says &amp;ldquo;add a user export feature&amp;rdquo;, the model might assume it should export all users, output JSON, write to a local file, and skip any confirmation around permissions or fields. Only after the code is done does the user discover that the model&amp;rsquo;s understanding does not match the real scenario.&lt;/p&gt;
&lt;p&gt;A better approach is to list the uncertainties first: should it export all users or filtered results? Should it trigger a browser download or run as a background job? Which fields are needed? How large is the data set? Are there permission constraints? If these questions are not clarified, writing faster only means drifting farther.&lt;/p&gt;
&lt;h2 id=&#34;02-over-complexity&#34;&gt;02 Over-Complexity
&lt;/h2&gt;&lt;p&gt;The second problem is that models often turn simple problems into complex ones. A task that could be handled with one function might receive abstract classes, strategy patterns, factory patterns, configuration layers, and a pile of extension points that may never be needed.&lt;/p&gt;
&lt;p&gt;This kind of code can look engineered, but in practice it increases maintenance cost. AI is especially good at quickly generating large structures, but it does not always judge whether those structures are necessary. The result is that a task solvable in 100 lines becomes inflated into 1,000 lines.&lt;/p&gt;
&lt;p&gt;The test is straightforward: would a senior engineer look at the change and think it is over-designed? If the answer is yes, remove the extra layers and solve the current problem with the least code needed.&lt;/p&gt;
&lt;h2 id=&#34;03-collateral-damage&#34;&gt;03 Collateral Damage
&lt;/h2&gt;&lt;p&gt;The third problem is that models sometimes modify or delete code they do not fully understand. While fixing a small bug, they may casually change comments, reformat nearby code, clean up imports that look unused, or even touch logic unrelated to the current task.&lt;/p&gt;
&lt;p&gt;These &amp;ldquo;drive-by improvements&amp;rdquo; are risky because they expand the change scope and make review harder. The user may only want to fix a validator crash caused by an empty email, but the model may also enhance email validation, add username validation, and rewrite docstrings. In the end, it becomes hard to tell which line changed behavior.&lt;/p&gt;
&lt;p&gt;A safer rule is: only change what must be changed, and only clean up issues caused by your own change. Existing dead code, formatting problems, or historical baggage should not be touched unless the task explicitly asks for it. At most, mention it.&lt;/p&gt;
&lt;h2 id=&#34;04-turning-complaints-into-claudemd&#34;&gt;04 Turning Complaints Into CLAUDE.md
&lt;/h2&gt;&lt;p&gt;After Karpathy&amp;rsquo;s comments spread widely, developer Forrest Cheung did something clever: he organized these complaints into executable behavior rules and put them into a &lt;code&gt;CLAUDE.md&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;The project does not contain complicated code. Its key idea is to turn the most failure-prone parts of AI coding into clear working rules. They can be summarized as four principles.&lt;/p&gt;
&lt;p&gt;The first is to think before writing. Do not silently assume. Do not hide confusion. If a requirement has multiple interpretations, list them. If there is a simpler approach, say so. Ask when clarification is needed, and push back when needed.&lt;/p&gt;
&lt;p&gt;The second is to keep things simple. Do not add features that were not requested. Do not abstract one-off code. Do not add unnecessary configuration. Do not write large amounts of defensive code for extremely unlikely scenarios. If 50 lines can solve it, do not write 200.&lt;/p&gt;
&lt;p&gt;The third is to make precise changes. Every changed line should trace directly back to the user&amp;rsquo;s request. Do not improve nearby code as a side quest. Do not refactor something that is not broken. Match the existing project style as much as possible.&lt;/p&gt;
&lt;p&gt;The fourth is goal-driven execution. Do not give the model only a vague instruction. Give it a verifiable success criterion. For example, &amp;ldquo;fix the bug&amp;rdquo; can become &amp;ldquo;write a test that reproduces the bug, then make it pass&amp;rdquo;; &amp;ldquo;add validation&amp;rdquo; can become &amp;ldquo;write invalid-input tests and make them pass&amp;rdquo;. The clearer the success criterion, the easier it is for the model to loop toward completion.&lt;/p&gt;
&lt;h2 id=&#34;05-why-it-took-off&#34;&gt;05 Why It Took Off
&lt;/h2&gt;&lt;p&gt;This project became popular not because the content is mysterious, but because it is close to real development work.&lt;/p&gt;
&lt;p&gt;Many people using AI for coding have seen similar scenes: the model confidently misunderstands the requirement, the code gets more complex as it goes, or it touches places it should not touch. The value of &lt;code&gt;CLAUDE.md&lt;/code&gt; is that it turns those experiences into collaboration rules that can be placed inside a project.&lt;/p&gt;
&lt;p&gt;The entry cost is also low: one file can start making a difference, with no complicated integration. Combined with Karpathy&amp;rsquo;s influence and the project&amp;rsquo;s practical comparison examples, it naturally spread through the Claude Code user base and the broader AI coding community.&lt;/p&gt;
&lt;p&gt;More importantly, these rules are not only for Claude Code. No matter which AI coding tool you use, the underlying issues are similar: the model needs to know when to ask, when to simplify, when to stop, and how to decide that the task is complete.&lt;/p&gt;
&lt;h2 id=&#34;06-what-developers-can-take-away&#34;&gt;06 What Developers Can Take Away
&lt;/h2&gt;&lt;p&gt;The lesson for ordinary developers is simple: AI coding is not about throwing one sentence at a model and waiting for a miracle. The effective approach is to give the model boundaries.&lt;/p&gt;
&lt;p&gt;When the requirement is unclear, ask it to expose its assumptions first. When the implementation starts getting complicated, ask it to return to the smallest viable solution. When changing code, keep it focused on the task goal. When finishing work, use tests, commands, or explicit checkpoints to verify the result.&lt;/p&gt;
&lt;p&gt;AI is already very capable at writing code, but it still needs good collaboration constraints. The fact that a short &lt;code&gt;CLAUDE.md&lt;/code&gt; can attract so much attention shows that developers do not only need smarter models. They also need more reliable ways of working.&lt;/p&gt;
&lt;p&gt;In short:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Think before writing to reduce wrong assumptions.&lt;/li&gt;
&lt;li&gt;Keep things simple to avoid over-design.&lt;/li&gt;
&lt;li&gt;Make precise changes to control change scope.&lt;/li&gt;
&lt;li&gt;Work toward goals with verifiable success criteria.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These four rules are not complicated, but they are practical. The prerequisite for AI coding to truly improve efficiency is not making the model write more. It is making it write more accurately, with less code, and under better control.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>Using Claude Code Quota More Efficiently: Models, Context, Caching, and /compact</title>
        <link>https://www.knightli.com/en/2026/04/19/claude-code-usage-context-compact-notes/</link>
        <pubDate>Sun, 19 Apr 2026 15:29:06 +0800</pubDate>
        
        <guid>https://www.knightli.com/en/2026/04/19/claude-code-usage-context-compact-notes/</guid>
        <description>&lt;p&gt;Many Claude Code or Claude Max users run into the same problem: even after paying for Pro, Max 5x, or Max 20x, the usage warning appears quickly, or they have to wait for the next reset. This feels especially obvious when Claude Code reads many files, fixes complicated bugs, or runs long tasks in a large project.&lt;/p&gt;
&lt;p&gt;The key point is this: usage is not deducted linearly by &amp;ldquo;minutes.&amp;rdquo; It depends on the model, context length, attachments, codebase size, conversation history, tool calls, and current capacity. In the same 5-hour window, one person may work for a long time while another hits the limit in minutes. Usually the account is not broken; each request is simply too heavy.&lt;/p&gt;
&lt;p&gt;This note collects a set of practical habits for using quota more efficiently.&lt;/p&gt;
&lt;h2 id=&#34;01-first-understand-claudes-usage-window&#34;&gt;01 First Understand Claude&amp;rsquo;s Usage Window
&lt;/h2&gt;&lt;p&gt;Claude Pro and Max both have usage limits. Claude Code usage is shared with Claude on web, desktop, and mobile under the same subscription quota. Anthropic&amp;rsquo;s help center explains that message counts depend on message length, attachment size, current conversation length, model or feature used, and that Claude Code usage is also affected by project complexity, codebase size, and auto-accept settings.&lt;/p&gt;
&lt;p&gt;A simple way to think about it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pro: suitable for light usage and small projects.&lt;/li&gt;
&lt;li&gt;Max 5x: suitable for more frequent usage and larger codebases.&lt;/li&gt;
&lt;li&gt;Max 20x: suitable for heavier daily collaboration.&lt;/li&gt;
&lt;li&gt;Usage windows reset on a 5-hour session basis.&lt;/li&gt;
&lt;li&gt;Long messages, long conversations, large files, and complex tasks consume usage faster.&lt;/li&gt;
&lt;li&gt;Stronger models such as Opus hit limits faster than Sonnet.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So &amp;ldquo;I only used it for 20 minutes&amp;rdquo; does not explain much by itself. What matters is how much context Claude read during those 20 minutes, which model was used, whether large files were processed repeatedly, and whether the same long conversation kept accumulating more tasks.&lt;/p&gt;
&lt;h2 id=&#34;02-first-habit-do-not-default-to-the-most-expensive-model&#34;&gt;02 First Habit: Do Not Default to the Most Expensive Model
&lt;/h2&gt;&lt;p&gt;The Claude model family is commonly positioned like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Opus&lt;/code&gt;: strongest capability, suitable for complex reasoning, architecture decisions, and hard bugs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sonnet&lt;/code&gt;: balanced capability and cost, suitable for most everyday coding tasks.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Haiku&lt;/code&gt;: lighter, suitable for simple classification, summarization, and format conversion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For daily scripts, small bug fixes, documentation cleanup, and code explanation, Sonnet is usually enough. Save Opus for cases such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Complex architecture design.&lt;/li&gt;
&lt;li&gt;Deep multi-file refactors.&lt;/li&gt;
&lt;li&gt;Bugs that are hard to reproduce.&lt;/li&gt;
&lt;li&gt;Long-chain troubleshooting.&lt;/li&gt;
&lt;li&gt;Tasks where the normal model is clearly stuck.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In Claude Code, use &lt;code&gt;/model&lt;/code&gt; to switch models, or set the default in &lt;code&gt;/config&lt;/code&gt;. A steadier habit is to use Sonnet by default and switch to Opus only at key points, rather than running the whole task on Opus.&lt;/p&gt;
&lt;h2 id=&#34;03-second-habit-control-context-do-not-drag-old-tasks-along&#34;&gt;03 Second Habit: Control Context, Do Not Drag Old Tasks Along
&lt;/h2&gt;&lt;p&gt;The longer the context, the more Claude needs to process on each turn, and the faster usage is consumed. The Claude Code docs explicitly recommend proactive context management:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;/clear&lt;/code&gt; when switching to an unrelated task.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/compact&lt;/code&gt; when one phase is done but important context should remain.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/context&lt;/code&gt; to see what is taking space.&lt;/li&gt;
&lt;li&gt;Configure a status line if you want continuous status visibility.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A useful rhythm:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Small phase done: /compact
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Large task done: /clear
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Switching to unrelated work: /clear
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Context usage getting high: /compact early
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;/compact&lt;/code&gt; summarizes earlier conversation history while preserving key task state, conclusions, file paths, and remaining work. It reduces the amount of history carried into later requests. You can also add a short instruction:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/compact Preserve changed files, test results, remaining TODOs, and key design decisions
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Do not wait for automatic compaction. The docs note that Claude Code auto-compacts when context approaches the limit, but manually compacting at phase boundaries is usually easier to control.&lt;/p&gt;
&lt;h2 id=&#34;04-third-habit-long-conversations-and-large-files-make-every-request-heavier&#34;&gt;04 Third Habit: Long Conversations and Large Files Make Every Request Heavier
&lt;/h2&gt;&lt;p&gt;Many people assume that &amp;ldquo;I only asked one more question&amp;rdquo; should be cheap. But in a long conversation, that question may carry a lot of history, file summaries, tool definitions, and system rules behind it.&lt;/p&gt;
&lt;p&gt;Things that easily bloat context include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Long conversations that are never cleared.&lt;/li&gt;
&lt;li&gt;Asking Claude to read entire large files.&lt;/li&gt;
&lt;li&gt;Pasting long logs, build output, or test output.&lt;/li&gt;
&lt;li&gt;Adding many screenshots or images at once.&lt;/li&gt;
&lt;li&gt;Asking it to repeatedly scan the whole repository.&lt;/li&gt;
&lt;li&gt;An overly long &lt;code&gt;CLAUDE.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Too many MCP servers enabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A more efficient approach: paste only key errors from logs, include only failing parts of test output, and let Claude use &lt;code&gt;rg&lt;/code&gt;, &lt;code&gt;head&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt;, and symbol search before reading only the necessary parts. If command-line filtering can shrink the content, do not paste the whole thing into context.&lt;/p&gt;
&lt;h2 id=&#34;05-fourth-habit-understand-caching-but-do-not-worship-it&#34;&gt;05 Fourth Habit: Understand Caching, but Do Not Worship It
&lt;/h2&gt;&lt;p&gt;Anthropic&amp;rsquo;s Prompt Caching can cache repeated prompt prefixes. The default cache lifetime is 5 minutes, and a 1-hour cache is also supported. When cache hits, large repeated context does not need to be fully reprocessed, which helps reduce cost and improve rate limit utilization.&lt;/p&gt;
&lt;p&gt;But caching has limitations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Content must match exactly, including text and images.&lt;/li&gt;
&lt;li&gt;The default cache is short-lived.&lt;/li&gt;
&lt;li&gt;Changing models, tools, system prompts, or context structure may reduce cache hits.&lt;/li&gt;
&lt;li&gt;Output tokens do not disappear because of caching; the response still needs to be generated.&lt;/li&gt;
&lt;li&gt;How Claude Code uses caching is a product-level implementation detail, so do not treat it as permanent &amp;ldquo;free memory.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In practice, the important part is not studying every caching detail. It is keeping the session stable:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoid frequent model switching within the same phase.&lt;/li&gt;
&lt;li&gt;Do not repeatedly rewrite large rule blocks mid-task.&lt;/li&gt;
&lt;li&gt;Do not keep adding new images inside the same task.&lt;/li&gt;
&lt;li&gt;Do not leave a long task idle for too long and then return with another huge request.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/compact&lt;/code&gt; at phase boundaries.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This makes repeated context easier to reuse and reduces later request weight.&lt;/p&gt;
&lt;h2 id=&#34;06-about-peak-hours-avoid-them-when-you-can-but-do-not-treat-them-as-a-formula&#34;&gt;06 About Peak Hours: Avoid Them When You Can, but Do Not Treat Them as a Formula
&lt;/h2&gt;&lt;p&gt;People often say certain hours feel tighter. Anthropic&amp;rsquo;s help center is more careful: message counts can be affected by current Claude capacity, conversation length, attachments, model, and features. In other words, peak capacity can affect the experience, but do not treat a specific local time window as a permanent rule.&lt;/p&gt;
&lt;p&gt;Practical suggestions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Put large refactors and heavy analysis in periods when both your network and the service are stable.&lt;/li&gt;
&lt;li&gt;Do not start a huge task right before you plan to step away.&lt;/li&gt;
&lt;li&gt;If you expect to leave for a long time, run &lt;code&gt;/compact&lt;/code&gt; or &lt;code&gt;/clear&lt;/code&gt; first.&lt;/li&gt;
&lt;li&gt;For small edits, do not use Opus with a long context unless you really need it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is more reliable than memorizing a fixed &amp;ldquo;do not use it from X to Y&amp;rdquo; rule.&lt;/p&gt;
&lt;h2 id=&#34;07-slim-down-claudemd-rules-mcp-and-skills&#34;&gt;07 Slim Down CLAUDE.md, rules, MCP, and skills
&lt;/h2&gt;&lt;p&gt;Claude Code loads project rules, tool information, and some environment context into the session. The official docs also recommend separating general rules from specialized rules so every session does not start with a large amount of unrelated text.&lt;/p&gt;
&lt;p&gt;A useful split:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt;: only global rules that always apply.&lt;/li&gt;
&lt;li&gt;rules: path-specific or file-type-specific rules.&lt;/li&gt;
&lt;li&gt;skills: specific workflows, such as publishing posts, deployment, image generation, or committing code.&lt;/li&gt;
&lt;li&gt;MCP: only enable servers that the current task actually needs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If &lt;code&gt;CLAUDE.md&lt;/code&gt; is hundreds or thousands of lines long, every session carries that cost. A better pattern is to move occasional workflows into skills and load them only when needed.&lt;/p&gt;
&lt;p&gt;MCP is similar. More tools do not automatically mean more efficiency. The Claude Code docs mention using &lt;code&gt;/mcp&lt;/code&gt; to view and disable unnecessary servers, and &lt;code&gt;/context&lt;/code&gt; to see what is consuming context space.&lt;/p&gt;
&lt;h2 id=&#34;08-practical-command-list&#34;&gt;08 Practical Command List
&lt;/h2&gt;&lt;p&gt;These are the most useful daily commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/model
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Switch models. Sonnet is a good default; use Opus for complex reasoning.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/clear
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Clear the current context. Use it when switching to unrelated work.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/compact
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Compress conversation history. Use it when a phase is done but the same task continues.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/context
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Inspect context usage and find what is taking space.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Check subscription or usage-related status. Anthropic&amp;rsquo;s help center also recommends monitoring remaining allocation.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/mcp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;View and manage MCP servers, and disable tools not needed for the current task.&lt;/p&gt;
&lt;p&gt;If you use API billing, &lt;code&gt;/cost&lt;/code&gt; can be useful. But for Pro/Max subscriptions, the Claude Code docs explain that the dollar estimate from &lt;code&gt;/cost&lt;/code&gt; is not the right billing reference; subscribers should rely more on usage information such as &lt;code&gt;/stats&lt;/code&gt; and &lt;code&gt;/status&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;09-a-quota-saving-workflow&#34;&gt;09 A Quota-Saving Workflow
&lt;/h2&gt;&lt;p&gt;A practical workflow looks like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;/clear&lt;/code&gt; before starting a new task.&lt;/li&gt;
&lt;li&gt;Use Sonnet by default.&lt;/li&gt;
&lt;li&gt;Let Claude inspect project structure and key files first, not the whole repository.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;/compact&lt;/code&gt; after each small phase.&lt;/li&gt;
&lt;li&gt;Switch to Opus only for hard blockers.&lt;/li&gt;
&lt;li&gt;Filter logs, errors, and test output before pasting them.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;/clear&lt;/code&gt; after the task is done; do not start new work with stale context.&lt;/li&gt;
&lt;li&gt;Periodically review &lt;code&gt;CLAUDE.md&lt;/code&gt;, MCP, and skills to shrink always-on context.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The core idea is simple: let Claude see only what it truly needs for the current task.&lt;/p&gt;
&lt;h2 id=&#34;10-summary&#34;&gt;10 Summary
&lt;/h2&gt;&lt;p&gt;Claude Code usage running out quickly is usually not caused by one thing. It is often a combination of high-cost models, long uncleared conversations, too many files and logs, heavy MCP and rule context, weaker cache reuse, and peak capacity fluctuations.&lt;/p&gt;
&lt;p&gt;The practical fixes are also simple:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use Sonnet for daily work.&lt;/li&gt;
&lt;li&gt;Save Opus for truly complex problems.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/compact&lt;/code&gt; when a phase is done.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/clear&lt;/code&gt; when switching tasks.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/context&lt;/code&gt; to find context bloat.&lt;/li&gt;
&lt;li&gt;Slim down &lt;code&gt;CLAUDE.md&lt;/code&gt;, rules, MCP, and skills.&lt;/li&gt;
&lt;li&gt;Do not dump the whole repository, full logs, or large image batches into context.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How much work the same Pro or Max plan can support depends heavily on how you manage context. Make the context smaller and task boundaries clearer, and Claude Code will feel much steadier.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Claude Help Center: Using Claude Code with your Pro or Max plan: &lt;a class=&#34;link&#34; href=&#34;https://support.claude.com/en/articles/11145838-using-claude-code-with-your-pro-or-max-plan&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://support.claude.com/en/articles/11145838-using-claude-code-with-your-pro-or-max-plan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude Help Center: About Claude&amp;rsquo;s Max Plan Usage: &lt;a class=&#34;link&#34; href=&#34;https://support.anthropic.com/en/articles/11014257-about-claude-s-max-plan-usage/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://support.anthropic.com/en/articles/11014257-about-claude-s-max-plan-usage/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude Code Docs: Manage costs effectively: &lt;a class=&#34;link&#34; href=&#34;https://code.claude.com/docs/en/costs&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://code.claude.com/docs/en/costs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Anthropic Docs: Prompt caching: &lt;a class=&#34;link&#34; href=&#34;https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
