FLSoft Academy

MODULE 1 · GETTING STARTED / 20 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, and know which built-in command to reach for.

Slash commands you’ll use constantly

Type / in a session to see the full list. The essentials:

CommandWhat it does
/helpLists commands and shortcuts
/clearStarts a fresh conversation (project memory still loads)
/compact [instructions]Summarises the conversation to free up context
/contextShows what’s filling the context window, as a grid
/rewindRestores code and/or conversation from a checkpoint, or summarises part of the history
/btw <question>Asks a side question without adding it to the conversation
/resumeOpens an earlier session (paste a PR URL to find the session that made it)
/usageSession cost, plan limits and what’s driving them (/cost is an alias)
/model, /effortSwitch model, or how hard it thinks (Module 4)
/initGenerates a CLAUDE.md for the project (Module 2)
/permissionsShows and edits allow/ask/deny rules
/doctorChecks your setup and offers fixes
/powerupShort interactive lessons on Claude Code features

What “context” means and why you manage it

Everything in the conversation is in the model’s context window: your messages, files it read, command output and its own replies. The window is large but not infinite, and it fills faster than you’d expect when Claude reads big files or long test logs.

Rules of thumb:

  • One task per conversation. Finished? /clear.
  • Long task still going? /compact with a hint about what to keep, for example /compact keep the decisions about the database schema.
  • Unsure? /context shows what’s using space.
  • Quick question that shouldn’t clutter the task? Use /btw.
  • Long, noisy debugging stretch? Open the rewind menu and choose Summarize from here to compress just that part.
  • Cleared by mistake? Right after /clear, the rewind menu offers the previous session at the top of the list.

When the window fills up, Claude Code compacts automatically. Compacting yourself at a natural break point keeps more control over what survives.

Exercise: one session, three moves

In your loop-practice repo from the last lesson:

  1. Start claude and ask: “Add a truncate(text, max) helper with tests.” Let it finish.
  2. Run /context and look at the breakdown.
  3. Run /compact keep a note of the helpers that exist and their tests.
  4. Ask: “What helpers exist in this repo and how are they tested?” Check that the summary kept what matters.
  5. Run /clear, then ask the same question. Notice that Claude now has to re-read the files, because the conversation memory is gone.
  6. Exit with /exit, then run claude --continue. You’re back in the last conversation.
  7. Ask a side question with /btw what does node:test's describe() do? and notice it doesn’t become part of the task’s history.

Running a one-off from your shell

You don’t always need an interactive session. Print mode answers and exits:

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

You can pipe into it, too:

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

This is the seed of automation, which we come back to in Module 8.

Verify it worked

  • You used /context, /compact and /clear, and can explain the difference
  • 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?