Vibepanions Get Vibepanions

Home / Guides / Claude Code tips

Claude Code tips that make your 5-hour window last longer

Updated 23 Sep 2026 by DevSparks

Quick answer: Claude Code resends the whole conversation on every turn, so the biggest saving is a smaller context. Run /clear between unrelated tasks, use Sonnet for routine work and Opus only when you are stuck, point Claude at file paths instead of pasting, keep CLAUDE.md under about 200 lines, and ask for a plan before large changes. Check /usage before a long job and put your 5-hour limit in the status line so it never surprises you.

What uses the most of your window?

Anthropic's help center says usage depends on the length and complexity of your conversations, the features you use, the model and the effort level. Claude Code, claude.ai and Claude Desktop all count towards the same limit. Its Claude Code article explains that every turn sends three things: the conversation so far, project context (your CLAUDE.md and any files Claude has read) and your new prompt. The conversation grows fastest.

The Claude Code docs add a few less obvious causes of a session that climbs:

Every tip below attacks one of these.

12 Claude Code tips

1. Run /clear between unrelated tasks

Clearing is the single most effective habit, because stale history is resent with every message. Anthropic's test: if your next prompt would make sense in a brand-new terminal, clear first. Your CLAUDE.md and project files stay; only the chat history goes.

/rename login-redirect-fix
/clear

Naming the session first lets you find it again with /resume.

2. Use /compact to keep going on a long task

/compact summarizes the conversation so far and frees context while you stay on the same task. You can tell it what to keep:

/compact Focus on code samples and API usage

Compacting reads everything it summarizes, so on a large context it is a large request in itself. When you want a fresh start rather than continuity, /clear costs nothing. Claude Code also compacts on its own near the limit.

3. Match the model to the job with /model

Opus uses meaningfully more of your quota than Sonnet, and Sonnet more than Haiku. Anthropic suggests Sonnet for most coding, Opus for hard debugging, cross-cutting refactors and architecture calls, and Haiku for renames, log lines and boilerplate. Run /model to see and switch models mid-session without losing the conversation. To plan with Opus and build with Sonnet automatically, use the opusplan alias:

/model opusplan

4. Lower the effort level for simple work

Thinking tokens are billed as output, and higher effort uses more of them. For routine tasks, drop the level with /effort (or the left and right arrows in /model). Levels run from low to max on current models.

/effort low
/effort status

5. Point at files instead of pasting them

Anything you paste stays in context, in full, for the rest of the session. Name the path and the part you care about, for example "look at the validateToken function in src/auth.ts", and Claude reads selectively. Anthropic's help article notes that an @ mention pulls in the entire file, so use a bare path when saving tokens matters. Trim logs and stack traces to the relevant 20 or 30 lines, and leave anything large on disk.

6. Keep CLAUDE.md short and specific

CLAUDE.md loads into context at the start of every session. Keep it under about 200 lines, and only add a rule the second time you have to correct Claude on the same thing. Move instructions for specific workflows, such as PR reviews or migrations, into skills, which load only when used. You can also tell compaction what to keep:

CLAUDE.md

# Compact instructions

When you are using compact, please focus on test output and code changes

7. Ask for a plan before large changes

A plan costs a few hundred tokens; a wrong 400-line diff costs thousands, twice. Press Shift+Tab until the status bar shows plan mode, or start one directly:

/plan add rate limiting to the upload endpoint

Claude reads and proposes, but edits nothing until you approve. If it still heads the wrong way, press Esc to stop at once, and use /rewind (or Esc twice) to go back to an earlier checkpoint.

8. Send broad searches to a subagent

Subagents run in their own context window and return only a summary, so reading dozens of files does not fill your main conversation. The docs suggest the same for verbose work such as running tests, fetching documentation or processing logs. Ask in plain words:

Use subagents to investigate how our authentication system handles token
refresh, and whether we have any existing OAuth utilities I should reuse.

9. Check /usage and /context before a long task

/usage shows your plan usage bars, and on Pro, Max, Team and Enterprise a breakdown of what counted: skills, subagents, plugins and MCP servers, plus flags for long context or cache misses when they cause 10% or more of recent usage. /context draws your context window as a grid and suggests what to trim. If a heavy job would not fit in what is left, start it after the reset.

10. Put your limits and reset time in the status line

On Pro and Max, the status line script receives rate_limits.five_hour and rate_limits.seven_day, each with used_percentage and resets_at, after the first response of a session. Showing them keeps the 5-hour window in view without typing a command. This is the docs' minimal version:

~/.claude/settings.json

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  }
}

Our Claude Code status line guide has a full script, and how to check your Claude Code and Codex usage limits explains when each window resets.

11. Get told when a session is waiting

On a subscription the prompt cache lasts an hour, so a session left waiting longer than that reprocesses its full context on your next message. A Notification hook tells you when Claude needs permission or has finished and you have not typed for about 60 seconds:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt|idle_prompt",
        "hooks": [
          { "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff", "async": true }
        ]
      }
    ]
  }
}

See Claude Code hooks for a version that shows a Mac notification with the project name. If you do come back after a long break, Claude Code on Pro and Max offers to resume a large session from a summary.

12. Run parallel sessions on purpose

Every session carries its own context, and all of them draw on the same 5-hour and weekly limits at once. Run several when the work is truly separate, give each its own git worktree so edits do not collide, and close the ones you are done with. Agent teams, an experimental feature, use roughly 7 times the tokens of one session when teammates run in plan mode.

Watching several sessions at once

Tips 9 to 12 are easier when you can see everything together. Vibepanions, a macOS 14+ app, shows the 5-hour and weekly limits and which session is waiting for you, across every Claude Code and Codex session at once, and a click takes you to that terminal. It reads only local files and costs SGD 7.99 once.

FAQ

Does switching to a cheaper model help once I hit my session limit?

No. The session and weekly limits are shared across all models, so /model does not bring access back. It does help after a model-specific message such as "You've hit your Opus limit": switching to a model outside that family keeps you working.

Should I use /clear or /compact?

Use /clear when you start a new task, and /compact when you are mid-task and need to keep going. /clear costs nothing, while /compact reads the whole conversation to summarize it, so on a large context it is itself a large request.

Does /cost still work?

Yes. /cost is now an alias for /usage. On Pro and Max the session dollar figure is not what you pay; look at the plan usage bars on the same screen instead.

What happens if I hit the limit in the middle of a task?

On Claude Code v2.1.234 or later, signed in with a claude.ai subscription, an interactive session waits and continues the task on its own after the limit resets. Keep the session open, or press Esc to cancel the wait.

Does a long CLAUDE.md really cost that much?

Less than its size suggests, because prompt caching bills later turns at the cheaper cache-read rate. It still takes context space on every message, so Anthropic suggests keeping it under about 200 lines.

Want your limits on screen all day? Get Vibepanions.

Sources

Fetched 23 Sep 2026.

Next: How to check your Claude Code and Codex usage limits.