FLSoft Academy

MODULE 1 · GETTING STARTED / 25 MIN Free NOVEMBER 2026 EDITION · CLAUDE CODE 2.1.318

Sessions, slash commands and context

Use slash commands, resume earlier work, and manage the context window so long sessions stay sharp.

Updated 5 November 2026 · Reviewed 5 November 2026

What you’ll be able to do

Keep long working sessions focused, pick up where you left off yesterday, and know which built-in command to reach for, so you spend your time on the task rather than on fighting the tool.

Why this matters

After a few days with Claude Code, most people hit the same problem: a session that started sharp gets slower, vaguer and starts mixing up details from earlier tasks. That’s not the model getting tired. It’s the context window filling up with old, irrelevant material. Learning to manage context is the single biggest step from beginner to confident user, and it costs you nothing but a few commands.

What “context” is

Everything in the current conversation is held in the model’s context window: your messages, every file Claude read, every command’s output, and Claude’s own replies. On each turn, the model works from all of it.

The window is large, but it fills faster than you’d expect. A few big files, a long test log and an hour of back-and-forth add up. As it fills:

  • cost and speed get worse, because more text is processed on every turn, and
  • focus can suffer, because instructions and facts from an earlier, unrelated task are still sitting there competing for attention.

When the window is nearly full, Claude Code compacts automatically: it replaces older parts of the conversation with a summary. That keeps you going, but you don’t choose what’s kept. Managing context yourself means doing this deliberately, at good moments.

The four ways to manage context

SituationDo thisWhat happens
Finished a task, starting an unrelated one/clearStarts a fresh conversation. The old one is kept and can be resumed
Long task still in progress, window getting full/compact keep <what matters>Replaces the history with a summary. Your instructions steer what’s kept
One noisy stretch, such as a long debugging detourEsc Esc → pick a prompt → Summarize from hereCompresses just that part, keeping the rest intact
A quick question that shouldn’t clutter the task/btw <question>Answers on the side, without adding it to the conversation

Use /context at any time to see a grid of what’s using the window, with suggestions when something is taking up a lot of space.

Slash commands you’ll use constantly

Type / in a session to see every command; keep typing to filter. These are the ones worth knowing from day one:

CommandWhat it doesTypical moment
/helpLists commands and keyboard shortcutsWhen you forget a shortcut
/clearStarts a fresh conversation (project memory still loads)Between unrelated tasks
/compact [instructions]Summarises the conversation to free up contextMidway through a long task
/contextShows what’s filling the context windowWhen a session feels slow or unfocused
/rewindRestores code and/or conversation from a checkpoint, or summarises part of the historyAfter a wrong turn (lesson 1.2)
/btw <question>Asks a side question without adding it to the conversationQuick lookups during a task
/resumeOpens an earlier session from a listPicking up yesterday’s work
/usageSession cost, plan limits and what’s using them (/cost is an alias)Keeping an eye on spending
/model, /effortSwitch model, or how hard it thinks (Module 4)Harder or simpler tasks
/initGenerates a CLAUDE.md for the project (Module 2)First session in a project
/permissionsShows and edits allow, ask and deny rules (Module 4)Reducing repetitive prompts
/doctorChecks your setup and offers fixesWhen something seems broken
/powerupShort interactive lessons on Claude Code featuresExploring what’s possible

Picking up where you left off

Every conversation is saved on your machine, per project folder. To return to one:

  • claude --continue (or claude -c) reopens the most recent conversation in the current folder.
  • claude --resume (or claude -r) shows a list to choose from. Inside a session, /resume does the same.

Exercise: one session, four moves

In your loop-practice project from lesson 1.2:

  1. Start claude and ask: “Add a truncate(text, max) helper with tests.” Let it finish. What you’ll see: the loop from lesson 1.2: reading, writing, running tests.
  2. Run /context. What you’ll see: a coloured grid of the window, split into categories such as system instructions, tools, files read and messages. Note roughly how full it is.
  3. Run /compact keep a note of the helpers that exist and their tests. What you’ll see: a short pause, then a summary replaces the history. /context now shows much less used.
  4. Ask: “What helpers exist in this repo and how are they tested?” What you’ll see: an answer drawn from the summary, often without re-reading files. Check it kept what you asked for.
  5. Run /clear auth-free-helpers, then ask the same question. What you’ll see: Claude now re-reads the files to answer, because the conversation memory is gone. This is normal, and it’s why clearing is safe.
  6. Ask a side question: /btw what does node:test's describe() do? What you’ll see: an answer that doesn’t become part of the conversation history.
  7. Type /exit, then run claude --continue. What you’ll see: you’re back in the most recent conversation, with its history intact.

Running a one-off from your shell

You don’t always need an interactive session. Print mode (-p) runs one request, prints the answer and exits:

claude -p "List the exported functions in this repo, one per line"

You can pipe text into it, too:

git diff | claude -p "Write a one-line commit message for this diff"

Common mistakes

  • One endless session for everything. Clear between unrelated tasks; your files and project instructions are never lost.
  • Waiting for auto-compaction. It works, but you don’t choose what’s kept. Compact yourself at natural break points, with a hint.
  • Pasting huge logs into the chat. Point Claude at the file instead, or ask it to show only the failing part.
  • Starting fresh when you meant to continue. Use claude --continue or /resume to get back to yesterday’s work.

Verify it worked

  • You used /context, /compact and /clear, and can explain when to use each
  • You asked a /btw side question
  • You resumed a session with claude --continue
  • You got an answer from claude -p without entering a session

Next: using Claude Code from inside your editor.

Knowledge check

3 QUESTIONS · PASS MARK 80%
1. You've finished one task and are starting an unrelated one in the same terminal. What should you usually do?
2. What does /compact do?
3. How do you pick up yesterday's conversation in the same project?

Tip: select the text that's wrong before clicking, and it's quoted in your report.

Report a problem

Lesson: Sessions, slash commands and context

What's wrong?