# Reset Claude Code Session Limits

> Terminal workaround to clear Claude Code CLI session state and limits

This is a command-line trick to clear session history and local limits in Anthropic's Claude Code CLI. By trimming the active session log file inside the hidden Claude directory, users can start a clean session without losing their base configuration.

## How it works

1. Open your terminal.
2. Navigate to the hidden Claude directory: \`cd ~/.claude\`
3. Locate your active session log file.
4. Open the log file in a text editor.
5. Delete all lines except for the very first line (the header).
6. Save the file and restart Claude Code to initiate a fresh session.

## What it is for

- Clear accumulated context when hitting local session limits in Claude Code
- Reset Claude Code CLI to a fresh session state without reinstalling
- Purge long conversation history in terminal AI sessions

## Key points

- Navigate to the hidden directory: cd ~/.claude
- Identify and open the active session log file in a text editor
- Delete all session lines except for the initial header row
- Save the file to preserve the session structure while clearing history
- Restart Claude Code to launch into an empty session state

## Pricing

Free

## Details

- Type: Tip
- Category: [Development](https://xiry.app/topics/development.md)
- Platforms: Command line, macOS, Linux
- For: Developers using Anthropic's Claude Code CLI tool
- Tags: claude, claude code, cli, terminal, ai coding, workaround

## Why it was saved

- [@technerdpeter, 17 April 2026](https://www.instagram.com/reel/DXPBYItAXnL/): Aims to let developers restart Claude Code in a fresh session state when hitting session-level usage thresholds.

## Related

- [Boris Cherny's Claude Code Setup](https://xiry.app/resources/boris-cherny-s-claude-code-setup): Battle-tested Claude Code workflow tips directly from the tool's creator (Tip, Free)
- [Claude Code](https://xiry.app/resources/claude-code): Agentic command-line tool that navigates, edits, and debugs codebases directly (Paid)
- [Kisuke](https://xiry.app/resources/kisuke): Mobile and cross-platform IDE with terminal, browser devtools, and AI agents. (Mobile app, Free)
- [Awesome DESIGN.md](https://xiry.app/resources/awesome-design-md): Curated collection of plain-text design systems extracted from popular tech websites. (GitHub repo, Open source)
- [Google Antigravity](https://xiry.app/resources/google-antigravity): Agentic development platform and IDE for running autonomous coding agents. (Desktop app, Freemium)
- [Mole](https://xiry.app/resources/mole): Open-source macOS command-line toolkit for disk cleanup, uninstallation, and system monitoring (Web app, Open source)

Updated 3 October 2026. Page: https://xiry.app/resources/reset-claude-code-session-limits

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
