TL;DR โ Long Claude Code conversations slow down because the context window fills up. Use
/clearwhen starting a brand new task, and/compactwhen you want to keep working on the same task but free up memory. Master this rule and your Pro plan will go 2x further.
Welcome back to Day 3 of my "10 Days of Claude Code" series! ๐
If you missed the earlier days:
- ๐ Day 1 โ How
/initinstantly understands your entire project - ๐ Day 2 โ
/reviewand/askfor instant code audits
Today we're solving a problem every Claude Code user faces but most don't know how to fix.
๐ฉ The Problem Nobody Talks About
You start a Claude Code session in VS Code. Everything is fast and crisp. You build a feature, fix a bug, refactor some code.
Then 30 minutes in...
- โณ Replies become slower
- ๐ธ Tokens deplete faster
- ๐ค Claude starts giving slightly off answers
- ๐ค You're getting frustrated
What's happening?
Every message you send adds to Claude's context window. Your old chat from 30 minutes ago โ the one about a totally different file โ is still being processed with every new request. It's like asking your friend a quick question while they're holding 200 sticky notes from earlier in the day.
Two slash commands solve this completely.
โก Command #1: /clear
What it does: Wipes the entire conversation history and starts fresh. Same session, same project, but Claude forgets everything you've discussed.
When to use it:
- โ Starting a completely new task (e.g., done with auth, now working on payments)
- โ Switching to an unrelated file or feature
- โ Claude is giving weird/confused responses
- โ You want maximum speed and a clean slate
How to use it:
/clear
That's it. One command. Fresh terminal, fresh brain, full speed.
Real example from my workflow:
[Worked on user authentication for 20 min]
[Bug fixed, feature shipped โ
]
Me: /clear
[New conversation begins]
Me: Now help me build the Stripe payment integration.
Claude doesn't carry over the auth context โ which is exactly what I want. Less noise, faster response.
๐๏ธ Command #2: /compact
What it does: Summarizes your current conversation, keeps the important parts, and discards the fluff. You don't lose context โ you compress it.
When to use it:
- โ Continuing the same task but the chat is getting long
- โ You're deep in a complex feature and need Claude to remember decisions
- โ You see token usage climbing but can't afford to lose context
- โ Mid-debugging session where history matters
How to use it:
/compact
Claude generates a summary of what you've discussed and replaces the long history with that summary. Same context, way less memory.
Real example:
[60 messages deep into building a dashboard]
[Multiple component decisions, design choices made]
Me: /compact
Claude: [summarizes the entire session into ~5 key points]
Me: Now add a filter dropdown to the chart we built earlier.
Claude still remembers the chart, the design system, the framework choice โ but it's not re-reading 60 messages every time.
๐ฏ The Golden Rule (memorize this)
| Situation | Command |
|---|---|
| Starting a new task | /clear |
| Continuing the same task | /compact |
| Claude is confused | /clear |
| Conversation is long but relevant | /compact |
That's it. Two commands, infinite productivity.
๐ฐ Why This Matters for Pro Users
If you're on the Pro plan (like me), this is money saved.
- Every token in your context window counts toward your usage
- Bloated conversations = wasted Pro quota
- A 5-second
/clearor/compactcan save you hundreds of tokens per task
I personally run /clear between every major task switch. My Pro plan now lasts way longer than it did before I knew this.
๐งช Try It Right Now
Open Claude Code in VS Code, run a few prompts, then try:
- Type
/compactโ watch the conversation collapse into a clean summary - Type
/clearโ see a fresh terminal, ready for a new task
You'll feel the difference immediately.
๐ฌ Watch the 60-Second Version
If you prefer video, I made a quick reel covering this:
- ๐บ YouTube Shorts: https://www.youtube.com/shorts/lM1YE2FuD8o
- ๐ฑ **Instagram Reel: **https://www.instagram.com/tech_jitendra_nadol/reel/DX9oSwNMhIh/
๐ What's Next?
Tomorrow โ Day 4 I'm covering the /model command โ when to use Sonnet vs Opus and how to save tokens by picking the right model for the right job. This one's a game-changer for Pro users.
๐ Follow me on Dev.to so you don't miss it!
๐ฌ Your Turn
- Did you know about
/clearand/compact? - Which one will you use more often?
- What's your biggest Claude Code pain point?
Drop a comment โ I read every single one. ๐
About the series: I'm sharing one Claude Code productivity tip every day for 10 days. Follow along on:
- ๐ฆ Twitter/X: https://x.com/JitendraV9521
- ๐ท Instagram: https://www.instagram.com/tech_jitendra_nadol/
- ๐บ YouTube: https://www.youtube.com/@techjitendranadol9876
Let's master Claude Code together! ๐
Top comments (0)