Clio Coder
All tutorials

Context and memory5 min read

Keep a long coding task on track

Inspect context, preserve decisions through a handoff, and resume the correct branch without turning every past message into a current instruction.

Written for
v0.5.7
Works in
Terminal · Desktop alpha
Basis
Documented workflow with v0.5.7 captures
Desktop Session tools panel with a table of what fills the context window and how much is reserved and free.
Session tools, Context window: the parts that fill the window, the compaction reserve, and the automatic threshold. Desktop alpha · v0.5.7
On this pageGive the project a starting point Inspect before the context fills Reduce with a stated purpose Hand off a defined continuation Recover an interrupted transition explicitly Keep memory reviewable

Long coding work needs more than saved chat history. You need the current objective, the decisions that still apply, the relevant files, and the checks left to run. Clio Coder gives you controls for inspecting that context and continuing after a session grows.

Four controls for a long task

  1. /context

    Inspect

    Usage, reserved output, remaining headroom, and any pending handoff.

  2. history grows

    /context compact

    Reduce

    A focused summary that keeps what you name.

  3. the work continues

    /handoff

    Hand off

    A continuation bound to this branch and its decisions.

  4. a transition stops

    /context recover

    Recover

    Reduce or deliver, chosen explicitly by its ID.

Inspect first; reduce, hand off, or recover only for a stated reason.

Give the project a starting point

A project handbook orients the model toward the repository's structure and rules. The context commands prepare a CLIO-CODER.md handbook and a structural code index, now called a codemap.

Shell

clio-coder context init
clio-coder context index

Review generated project material as you would any other change. Keep build commands and verification expectations specific to the project: an incorrect handbook makes the wrong answer easier to repeat.

The codemap locates structural information without reading every file into the conversation. It does not replace reading a function before changing its behavior. Legacy codewiki files remain readable; new output uses codemap.

Inspect before the context fills

In the terminal, /context shows usage, output reservation, remaining headroom, and any pending handoff. On the desktop alpha, open Session tools beside the conversation.

  1. Terminal Context Window overlay showing a usage grid and 12,450 of 262,144 tokens in use.

    01 /context: the probed window, tokens in use, and what fills them. Terminal · v0.5.7

  2. Desktop Session tools panel with a table of what fills the context window and how much is reserved and free.

    02 Session tools, Context window: the parts that fill the window, the compaction reserve, and the automatic threshold. Desktop alpha · v0.5.7

  3. Desktop Branches list showing each turn of the conversation with Continue here and Fork buttons.

    03 Session tools, Branches: each turn with actions to continue from it or fork. Desktop alpha · v0.5.7

The same conversation's context in the terminal and the desktop alpha, and its branches.

Watch what you are accumulating. A large test log, an old exploration branch, and a current design decision should not carry the same weight. Ask the agent to cite the file or tool result behind an important conclusion instead of a remembered paraphrase.

Reduce with a stated purpose

/context compact Keep the objective, decisions, changed files, test results, and remaining work.

After compaction

Read the continuation. Compaction reduces history; it does not prove that the model kept every fact. If an important constraint disappears, restate it with its source.

Hand off a defined continuation

/handoff <goal> prepares a continuation around a stated goal. A useful goal says what the receiving session should do next and which work must stay intact.

Example handoff goal

/handoff Fix the empty-input parser bug: keep the failing case in tests/parser.test.ts, the chosen approach of validating before tokenizing, and rerun the parser tests before finishing.

Handoffs are bound to the active branch and its decisions. A fork can recall earlier notes without inheriting permission to resume its parent's pending transition. Use /tree and /fork deliberately, and confirm which branch you are continuing.

Recover an interrupted transition explicitly

If /context shows a pending handoff, use its exact ID:

/context recover <handoffId> reduce
/context recover <handoffId> deliver

These are two different recoveries, not two commands to run in turn. Choose reduce when the reduction has not committed and another attempt remains; choose deliver when the validated commit exists. The continuity guide explains those states.

A restarted process records an interrupted handoff as paused and waits for your command. Do not create a new handoff just because a pending one looks unfamiliar.

Keep memory reviewable

Proactive memory is separate from the working context. Review a proposed lesson before accepting it as durable material; an observation about one repository should not quietly become a rule for every project.

Settings lets you choose the memory route, including Rules only when you do not want a background model call. Stored memory is not fine-tuning of the underlying model. Its value depends on selection, scope, and whether it is still relevant.

Boundaries

  • A summary is a model's reduction, so check it against sources when it matters.
  • A handoff belongs to the branch that prepared it; a fork recalls its notes but cannot resume it.
  • Memory proposals need review before they influence later sessions.

By The Clio team · Clio Coder

Continue with the documentation