# /clear without losing the thread

A tiny ritual for Claude Code sessions when `/clear` feels like deleting the whole workday.

The trick: do not use `/clear` as the memory mechanism. Use it as the broom after you have written the checkpoint.

## The rule

If the next session cannot resume from a file in the repo, you are not ready to clear.

## The 90-second checkpoint

Ask the agent:

```text
Before I run /clear, write a checkpoint for the next session.
Keep it short and operational:

1. Current goal
2. Decisions made
3. Files changed or important files read
4. Commands/tests run and their results
5. Open risks or unknowns
6. The next 1-3 concrete steps

Save it somewhere durable in the repo, not in chat only.
Do not dump the transcript. Distill state.
```

Then run:

```text
/clear
```

Then start the next session with:

```text
Read the checkpoint file first, then continue from the next step.
Do not assume anything that is not in the checkpoint or repo.
```

## When to use `/compact` instead

Use `/compact` when you are still in the same task and want to preserve momentum inside the current conversation.

Use `/clear` + checkpoint when you are switching task, cleaning up a messy session, or handing work to a fresh context.

## What not to do

- Do not paste an entire transcript as "memory".
- Do not put temporary panic notes into CLAUDE.md.
- Do not trust a vague summary that omits commands/tests/results.
- Do not wait until the context is already broken; checkpoint while the agent still understands the work.

Memory is not sentiment. Memory is a restart protocol.
