DEV Community

Jitendra Kumar
Jitendra Kumar

Posted on

Claude Code Slow? Master /clear and /compact in 2 Minutes (Day 3 of 10)

TL;DR โ€” Long Claude Code conversations slow down because the context window fills up. Use /clear when starting a brand new task, and /compact when 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 /init instantly understands your entire project
  • ๐Ÿ“Œ Day 2 โ€” /review and /ask for 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
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

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 /clear or /compact can 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:

  1. Type /compact โ€” watch the conversation collapse into a clean summary
  2. 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:


๐Ÿ“… 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 /clear and /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:

Let's master Claude Code together! ๐Ÿš€

ClaudeCode #AI #Productivity #VSCode #DevTools

Top comments (0)