# Why Claude Code gets worse in long sessions

> Claude Code slips in long sessions because its context window fills, and Anthropic says performance degrades as it does. The signs, and six ways to fix it.

Source: https://shuriken.sh/guides/claude-code-worse-in-long-sessions

Claude Code slips in long sessions because its context window fills, and Anthropic says performance degrades as it does. The signs, and six ways to fix it.

By Shuriken Updated 27 October 2026 3 min read

**Contents**

Claude Code gets worse in long sessions because its context window fills up. Every message, file read and command output stays in it, and Anthropic's own [best-practice docs](https://code.claude.com/docs/en/best-practices) say "LLM performance degrades as context fills": Claude may start "forgetting" earlier instructions or making more mistakes. The fix is managing context, not a better prompt.

This page is about the quality drop: the session that was sharp at ten o'clock and sloppy by two. For the two commands that reset it, see [/compact vs /clear](https://shuriken.sh/guides/claude-code-compact-vs-clear).

## What fills the context window #

Anthropic's [context window page](https://code.claude.com/docs/en/context-window) lists what is in there before you type anything: CLAUDE.md, auto memory, MCP tool names and skill descriptions. Then, as Claude works:

- every file it reads,
- every command and its output,
- every message, yours and its own,
- rules and hook output that load along the way.

A single debugging session can add tens of thousands of tokens, the best-practice page says. Nothing in that list leaves on its own until the session compacts.

## The signs a session has gone stale #

The usual signs, all of them consistent with what Anthropic describes:

- It repeats a fix you already rejected.
- It forgets a rule from CLAUDE.md that it followed in the morning.
- It "fixes" the same test three times in three different ways.
- Answers get longer and vaguer, and it rereads files it has already seen.

Anthropic names two failure patterns that cause most of it. The kitchen sink session: one task, then an unrelated question, then back to the first. Correcting over and over: each failed attempt stays in context and pulls the next one off course.

## Six ways to keep a session sharp #

- Clear between unrelated tasks. /clear starts the context over. Old conversation "crowds out the files you need next and costs tokens on every message", the context page says.
- Two strikes, then start fresh. Anthropic's rule: corrected more than twice on the same issue? /clear and write a better first prompt with what you learned. "A clean session with a better prompt almost always outperforms a long session with accumulated corrections."
- Compact with a focus, before it compacts for you. /compact focus on the auth bug fix keeps what you choose instead of what the automatic pass guesses. /autocompact 500k makes it compact earlier.
- Send research to a subagent. A subagent reads the files in its own context and returns a summary, so the big reads never land in yours. More in [skills vs subagents](https://shuriken.sh/guides/claude-code-skills-vs-subagents).
- Keep CLAUDE.md short. It loads into every session. Anthropic warns that a bloated one makes Claude ignore your actual instructions.
- Watch the meter. /context shows what is using the window right now; a [custom status line](https://shuriken.sh/guides/claude-code-status-line) keeps it on screen.

Shuriken runs your coding agents on your own computers and keeps them going when an account hits its limit.

[Download](https://shuriken.sh/download)

## What survives a compaction #

When a session compacts, Claude Code replaces the conversation with a summary. Some things come back from disk; others are only summarised. From Anthropic's table:

| Comes back in full | Only summarised |
| --- | --- |
| The project-root CLAUDE.md and unscoped rules | The conversation itself |
| Auto memory | Context hooks added earlier |
| A plan written in plan mode | Rules with paths: frontmatter (they reload when their files are read again) |
| Up to five recently changed files Claude read or edited | Older file reads |

So a rule that must hold all day belongs in the root CLAUDE.md, not in a message you typed at 9:00.

## Does a bigger window help? #

A 1M-token window gives you more room before compaction. It doesn't make the context cleaner, and the context page says compaction "works the same way at the larger limit". It's worth it for one big task that needs many files at once; our [1M context guide](https://shuriken.sh/guides/claude-code-1m-context-window) covers when. For a day of mixed tasks, clearing between them does more.

## Shorter sessions, more of them #

The habit that helps most is giving each task its own session. That's how Shuriken is laid out: every chat in a project is its own agent session, and every chat but the project's Main chat works on its own branch, so a new task starts with a clean context instead of inheriting the last one's.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-worse-in-long-sessions&text=Why%20Claude%20Code%20gets%20worse%20in%20long%20sessions)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-worse-in-long-sessions)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-worse-in-long-sessions&t=Why%20Claude%20Code%20gets%20worse%20in%20long%20sessions)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-worse-in-long-sessions&title=Why%20Claude%20Code%20gets%20worse%20in%20long%20sessions)[E-mail](mailto:?subject=Why%20Claude%20Code%20gets%20worse%20in%20long%20sessions&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-worse-in-long-sessions)

## Sources

- [Claude Code docs: Best practices](https://code.claude.com/docs/en/best-practices) (accessed 23 October 2026)
- [Claude Code docs: Explore the context window](https://code.claude.com/docs/en/context-window) (accessed 23 October 2026)

## Frequently asked questions

**Does Claude Code get worse the longer a session runs?**

Anthropic's best-practice docs say so: performance degrades as the context window fills, and Claude may start forgetting earlier instructions or making more mistakes.

**How do I see how full the context window is?**

Run /context in the session. It breaks usage down by category and suggests what to trim. A custom status line can show it all the time.

**Is /compact or /clear better?**

/clear when you move to unrelated work; /compact with a focus, such as /compact focus on the auth fix, when you need to keep going on the same task.

**Will a 1M context window fix it?**

It gives you more room before compaction, not a cleaner context. Anthropic's docs say compaction works the same way at the larger limit.

**What does Anthropic suggest after repeated corrections?**

If you have corrected Claude more than twice on the same issue, run /clear and start fresh with a more specific prompt that includes what you learned.

Shuriken

The harness for your coding agents.

Run Claude Code, Codex and Gemini CLI on your own computers, move chats to your next account at a limit, and follow every chat from any device.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [How to change the model in Claude Code: Guide 27 Oct 2026 3 min read Change the model in Claude Code with /model, claude --model, an environment variable or settings.json. /model wins; Enter in its picker sets your default.](https://shuriken.sh/guides/change-model-in-claude-code)
- [Claude Code API Error 400 on tool_use: what to do: Guide 27 Oct 2026 4 min read A Claude Code API Error 400 about tool use means the saved history has a tool call out of step with its result. Update, then rewind past the broken turn.](https://shuriken.sh/guides/claude-code-api-error-400-tool-use)
- [Claude Code custom slash commands: make your own: Guide 27 Oct 2026 3 min read Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.](https://shuriken.sh/guides/claude-code-custom-slash-commands)
- [Claude Code thinking and effort levels, explained: Guide 27 Oct 2026 4 min read Claude Code's effort levels, low to max, set how much Claude thinks before it acts. What each level is for, the defaults, ultrathink, and how to set it.](https://shuriken.sh/guides/claude-code-effort-levels)
- [Claude Code chat history deleted? Set cleanupPeriodDays: Guide 27 Oct 2026 5 min read Claude Code deletes session transcripts after 30 days by default. Raise cleanupPeriodDays in settings.json to keep them, and back up what you can't lose.](https://shuriken.sh/guides/claude-code-history-deleted-after-30-days)
- [Claude Code hooks not working? Why they don't fire: Guide 27 Oct 2026 6 min read A Claude Code hook that never fires is either not loaded (missing from /hooks) or loaded with a matcher that matches nothing. The causes and their fixes.](https://shuriken.sh/guides/claude-code-hooks-not-working)
- [Claude Code keyboard shortcuts and commands cheat sheet: Guide 27 Oct 2026 5 min read Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.](https://shuriken.sh/guides/claude-code-keyboard-shortcuts)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
