Claude Code tutorials · Part 07

Context and cost control

Keep answer quality high over long, multi-task sessions with Claude Code, while keeping usage under control.

I. What context is and why Claude seems to get “dumber”

Everything in a session sits in the context: what you say, the files it has read, command output, and screenshots. The longer the context gets:

So managing context really comes down to keeping only useful information in the main conversation.

II. Key commands

Command What it does When to use it
/clear Clears the current session When switching to a completely unrelated task
/compact Compresses earlier content into a summary When you’ve been on the same task for a long time and want to continue
--continue / --resume Resumes a previous session When picking up the same task the next day

Rule of thumb: one task per session. Run /clear after finishing one thing. That works far better than doing ten things in one session.

III. Keeping the main conversation clean

IV. Put rules in files, not in chat

Repeating the same requirement in chat every time wastes context and is easy to miss. Instead:

V. Cutting rework is the biggest saving

The most expensive thing isn’t reading files, it’s doing something wrong and starting over. A few habits help:

VI. Choosing a model

Use different models for different tasks (switch with /model):

VII. A checklist

Before finishing a task, go through this list: