> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xysq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Session loop

> Two skills that close the loop between sessions: wrap-up saves what you decided at the end, auto-mem recalls it before asking during the next one, so you teach once and stop re-explaining.

Every session your agent learns things: the decisions you made, the tools you settled on, the way you like to work. Then the session ends and it forgets, so the next one starts blank and asks you the same questions again. The **session loop** closes that gap with two skills. `wrap-up` saves what you decided at the end of a session; `auto-mem` recalls it before asking during the next one. Between them you teach the agent something once and stop re-explaining it.

The mental model: `wrap-up` is the deposit and `auto-mem` is the spend. `wrap-up` writes durable knowledge into your vault when a session ends; `auto-mem` reaches into that vault and answers questions from it before it stops to ask you. They're the backward and forward halves of the same loop.

## The two halves

### wrap-up, the save

`wrap-up` fires at the end of a session when you say "wrap up", "summarize this session", "save the session", "save what we did", "checkpoint this", or "store this session". It summarizes the whole conversation into **one compact document** and saves it to xysq, losing no knowledge, just fewer tokens.

What it captures: the decisions you made, the facts that surfaced, the blockers you hit, the open tasks left over, and your corrections and preferences (including operating preferences like "stop asking me to approve every step"). Re-running it in the same session **updates** that same memory, it doesn't create a duplicate.

The way to think about it: `wrap-up` is the inverse of `/compact`. `/compact` keeps the shape of the conversation and loses precision. `wrap-up` drops the conversational shape but keeps the precise atoms, the numbers, file paths, and decisions, that a future recall actually needs.

### auto-mem, the recall-before-asking

`auto-mem` is the forward-looking half. You turn it on once by saying "/auto-mem", "recall before asking", "use my memory for decisions", or "stop re-asking me things", and it activates **recall-before-asking mode** for the rest of the session: before the agent stops to ask you a decision or preference question, it first queries your xysq memory for a prior answer, and acts on it if it finds one.

Two behaviors are locked:

1. **Recall, else ask.** If memory holds a clear prior answer, the agent acts on it and notes the source. If memory is silent or ambiguous, it asks you normally. It never guesses.
2. **Sticky session mode.** You turn it on once and it governs the rest of the session, so you don't have to re-invoke it turn by turn.

## Why they're a loop

The two skills feed each other. Every `wrap-up` makes the next session ask fewer questions, because the answers are now in the vault. Every `auto-mem` recall spends the memory that `wrap-up` built. Run them together across sessions and the questions your agent asks you shrink over time.

<Note>
  Week one the agent asks which test runner you use. You tell it pytest, and `wrap-up` saves that. Week three, with `auto-mem` on, it just uses pytest, no question asked. That's the loop compounding: the more you capture, the less you re-explain.
</Note>

## What auto-mem does NOT do

`auto-mem` reduces the **questions** the agent asks, by answering them from memory. That's the whole scope. It's worth being precise about the line it doesn't cross:

* It does **not** flip the agent's permission mode.
* It does **not** auto-approve tool calls, file writes, or shell commands.

Permission posture is a separate lever that you control. `auto-mem` handles the question layer, not the action layer. So an agent with `auto-mem` on will still stop and ask before it runs a command, if that's what your permission settings require. It just won't stop to ask you a decision or preference it could have recalled.

## Using them in Claude Code

Both skills ship in the **xysq plugin for Claude Code** (plugin version 2.8.0), the same plugin that provides the xysq connection and the [standard skill](/features/skills). If you already have the plugin, update it:

```
/plugin update xysq
```

Then start a new session. First-time setup is the same as any xysq skill, see [recall skills](/features/recall-skills#first-time-install) for the install and sign-in steps. The short version:

```
/plugin marketplace add xysq-ai/xysq-claude-plugin
/plugin install xysq
```

Once it's loaded, `wrap-up` fires when you signal the session is ending:

```
wrap up
```

And you turn `auto-mem` on once, near the start of a work session:

```
/auto-mem
```

or just:

```
recall before asking
```

From there `auto-mem` stays on for the rest of the session and `wrap-up` is ready whenever you want to checkpoint.

<Info>
  Both skills also have `claude-web`, `chatgpt`, and `generic` variants, served to those agents when they connect. The slash-command experience described here (`/auto-mem`, `/skills`) is specific to Claude Code.
</Info>

## Verifying they loaded

Inside Claude Code, run `/skills`. Alongside `xysq` you should see both `auto-mem` and `wrap-up` in the list. If either is missing, run `/plugin update xysq` and start a fresh session.

## Related

* [Standard skill](/features/skills) - the core retain and recall protocol both halves build on
* [Recall skills](/features/recall-skills) - the five single-query read skills (recap, decisions, blockers, prep, actionables)
* [Goal loop](/features/goal-loop) - the coverage loop that walks your whole vault toward a goal
* [Connect your agent](/integrations/connect-agent) - install the plugin that ships these skills
