惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
J
Java Code Geeks
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Make Claude Code's 5-Hour Usage Window Last Longer ...
Teruo Kunihiro · 2026-05-27 · via DEV Community

When using Claude Code with Claude Pro, one problem you will almost certainly run into is the Usage Limit.

The actual usage depends on many things: message length, attached files, conversation history, the model you are using, and the features you enable. Claude Pro has a session-based limit that resets every five hours, as well as a weekly usage limit. (Claude Help Center)

I use Claude Pro with the assumption that I will eventually hit the limit. Because of that, I try to avoid carrying unnecessary context, control when I start heavy work, and move important information out of the conversation and into files.

Use /clear

When I start a new task or switch models, I usually run /clear first.

/clear starts a new conversation with an empty context. The previous conversation is still available through /resume, so this does not mean throwing away the work entirely. I use it to separate the current task from old context that is no longer needed. (Claude Code)

The two cases I pay the most attention to are model switching and long idle periods.

In Claude Code, each model has its own prompt cache. Because of that, when you switch models with /model, the next request will reread the entire conversation history without a cache hit, even if the conversation itself has not changed. If you switch models while carrying a long conversation, the first request after the switch can consume a large amount of your usage limit. (Claude Code)

Long idle periods across sessions are also worth watching. For Claude subscriptions, Claude Code uses a one-hour TTL prompt cache for the main conversation. If the conversation is idle for a long time, the cache can expire. For example, if you wait more than an hour for a reset and then resume, the next input may reprocess the long history. (Claude Code)

New Claude Code sessions can also change the cache prefix. The working directory, OS, shell, and git status snapshot can all affect the prefix. The official docs explain that sequential sessions can share the cache only when they are on the same machine and directory, and when the git status snapshot at startup matches. In other words, it is better to think of session resumes as situations where cache misses can easily happen because of TTL expiration or prefix differences. (Claude Code)

For that reason, before switching models or leaving work idle for a long time, I save the necessary information as a plan or spec file and then run /clear. I want to avoid starting a new session with the first prompt already carrying a huge old conversation history.

If I want to continue the same task, I use /compact instead of /clear. /compact replaces the conversation history with a summary, so the conversation-layer cache is rebuilt. However, the next turn can rebuild the cache from a much shorter summary. Used at a natural stopping point, it helps both with usage and with keeping the model focused. (Claude Code)

Start the session early with /schedule

Claude Pro has a session limit that resets every five hours. If I start working at 6 a.m., I can expect resets around 11 a.m. and 4 p.m. during the workday. Of course, the exact remaining usage and reset time should be checked in the Usage screen or with /usage, but the timing of when you start heavy work matters a lot. (Claude Help Center)

Recently, the limits have become more generous, so once you clear each five-hour session, you can use a fairly large amount of tokens. On May 6, 2026, Anthropic announced that it doubled Claude Code's five-hour rate limits for Pro, Max, Team, and Enterprise users, and removed peak-hours limit reductions for Pro and Max users. Claude Code weekly limits were also increased by 50% through July 13. (Anthropic, ClaudeDevs, Business Insider)

Even so, if you use Claude Code heavily on Pro, you can burn through a five-hour session very quickly. A temporary increase in the weekly limit does not prevent you from hitting the session limit if you pack too much heavy work into a short period.

I want to maximize the number of useful resets during my daytime working hours, so I use /schedule to run a routine early in the morning. /schedule creates, updates, and runs Claude Code routines, and those routines run on Anthropic-managed cloud infrastructure. By scheduling something simple, such as a small hello command, I can start the session early and plan the day around the five-hour windows. (Claude Code)

For my schedule, simply controlling when the session starts can turn two useful reset windows into three.

Write plans and specs to files

For larger Claude Code tasks, I try not to keep plans and specs only inside the conversation. I write them out to files.

This is very important. If the working state exists only in the conversation history, running /clear removes the context. But if the plan or spec is saved as a Markdown file, I can simply ask the next session to read that file and continue.

I sometimes use Superpowers skills such as writing-plan and writing-spec. The Superpowers brainstorming skill stores design specs under docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md, and the writing-plans skill stores implementation plans under docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md. (GitHub, GitHub)

The tool itself does not have to be Superpowers. The important point is this: do not use the conversation as the only place where the working state lives.

I keep only "what to do now" in the conversation. Specs, plans, test procedures, and reasons for decisions go into files. That way, I can run /clear without losing productivity.

Use cheaper models when possible

Not every task needs Opus.

The official Claude Code cost management docs say that Sonnet can handle many coding tasks well and is cheaper than Opus. Opus is better reserved for complex architecture decisions and multi-step reasoning. (Claude Code)

To be honest, I do not always optimize this perfectly. But when using Superpowers skills or subagents, simple subtasks are sometimes routed toward Sonnet, which feels like it saves usage. The official docs also mention that simple subagent tasks can be configured to use Haiku. (Claude Code)

On the other hand, for tasks that involve orchestrating multiple subagents or making high-level design decisions, Opus feels more stable to me. If I try too hard to save usage there, I often pay for it later with retries and corrections.

So the pattern I usually follow is similar to the Superpowers SKILL.md: use Sonnet for simple implementation, research, test fixes, and file-level work; use Opus for design decisions, complex debugging, subagent orchestration, and reviewing long plans.

Conclusion

If you use Claude Code on Claude Pro, it is better to assume that you will eventually hit the usage limit.

The most important thing is to avoid carrying unnecessary context. Use /clear when starting a new task or switching models. Use /compact when continuing the same task while cleaning up the context. Do not keep all working state inside a long conversation; write plans and specs to files.

Also, pay attention to when your five-hour session starts. Starting early in the morning makes it easier to take advantage of multiple resets during the day. With /schedule, you can control the start timing of routine work to some extent.

For models, use Sonnet for everyday work and reserve Opus for heavy design decisions and complex orchestration. The goal is not simply to use the cheapest model. The goal is to choose the model that fails the least within your available usage limit.

In the end, saving Claude Code usage is not really about being stingy. It is about managing working state. Keep the session light, move important information into files, and avoid making the model carry everything in the conversation.