CLIO Coder
All tutorials

Context and memory4 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.8.0
Works in
Terminal · Desktop alpha
Basis
Documented workflow
Updated
Terminal Context Window dock after one short turn: a usage bar with the tokens in use out of the 200,000-token window, split into system prompt, tool definitions, agent fleet, project context, messages, tool results and assistant output, then free space, the autocompact reserve, and the next request's input, output reserve and headroom.
/context: the probed window, tokens in use, and what fills them. Terminal · v0.8.0
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 called the 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, the Session column has Context and Branches cards, and typing / in the composer offers /context, /tree, /fork, and /handoff.

  1. Terminal Context Window dock after one short turn: a usage bar with the tokens in use out of the 200,000-token window, split into system prompt, tool definitions, agent fleet, project context, messages, tool results and assistant output, then free space, the autocompact reserve, and the next request's input, output reserve and headroom.

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

  2. Terminal tree view of a forked conversation, noting which session it was forked from and listing the turns.

    02 /tree after /fork: the branch records where it came from, and /resume reaches the turns left behind. Terminal · v0.6.0-dev

The terminal's context window, and a forked conversation in /tree.

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 conversation 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. To return to a session after quitting, type the /resume <id> line from the exit summary; a prefix works when it matches one session.

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. Open /memory and use its Review tab to approve a proposed lesson with a, or press x twice to reject it; an observation about one repository should not quietly become a rule for every project.

Global, procedural, runtime, and agent lessons wait for you. A repository knowledge lesson can be approved automatically once a session records that it held with no contradiction, and a later contradiction demotes it.

In /settings, under Context and memory, Memory connection and Memory model choose where memory's model calls run. With neither set, memory uses your chat route and spends model calls there. Turning Proactive memory off stops those calls, along with task memory and the memory section of the prompt.

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.
  • Only approved lessons influence later sessions, and a repository knowledge lesson can be approved automatically, so check /memory.

By The CLIO Coder team · CLIO Coder

Continue with the documentation