---
title: "Manage CLI context and memory"
summary: "See what the Matilda Code CLI carries in its context window, compress a long conversation, start clean, and keep facts across sessions."
url: https://help.maincode.com/products/matilda/v1/en/code/cli-context-memory
product: "Matilda"
kind: how-to
version: v1
discovery: {"area":"code","components":["code-cli"],"capabilities":["conversations","configuration"],"tasks":["Check context window usage","Compress the conversation","Start a clean session","Save and manage memories"],"platforms":[],"releases":[]}
source: MaincodeHQ/matilda-code@9cb4e347eac124436884507afaa521a370ed5850
---

# Manage CLI context and memory

The context window fills as you chat. These commands show what is in it, shrink it, and keep facts across sessions.

## See what the context holds {#see-what-the-context-holds}

Run `/context` for a breakdown of the window: model, tokens used and free, how much goes to the system prompt, tools, memory files, skills, and your messages, and where you stand against the automatic compression thresholds. Run `/context detail` for a per-item list with each tool, memory file, and skill's token count.

## Compress a long conversation {#compress-a-long-conversation}

Run `/compress` (or `/compact`, `/summarize`) to replace the history with a summary and free up the window. Add instructions to steer the summary, for example `/compress keep the migration plan`. Instructions longer than 2000 characters are truncated.

`/compress-fast` makes no model call. It strips old tool outputs and thinking parts, so it is quick and costs nothing. The trade-off is a coarser cut.

## Start a clean session {#start-a-clean-session}

Run `/clear` (or `/new`, `/reset`) to drop the history, free the window, and start a new session. The command refuses while background tasks are running, so stop them first.

## Catch up on the session {#catch-up-on-the-session}

Run `/recap` for a one-line overview of the current session.

## Give the project a memory {#give-the-project-a-memory}

Run `/init` to analyse the project and write a MATILDA.md. New sessions load that file into context, so keep it short and useful. If a non-empty MATILDA.md already exists, `/init` asks before overwriting it.

## Remember things for next time {#remember-things-for-next-time}

Run `/remember <text>` to save a durable fact for future sessions, and `/forget <text>` to remove matching auto-memory entries.

Run `/memory` to open the Memory manager: toggle auto-memory and auto-dream, and open your user memory file, this project's memory file, or the auto-memory folder to edit by hand. Run `/dream` to consolidate auto-memory topic files on demand.
