Agents
Agent memory
Control Deck keeps a shared memory for your agents. A fact that an agent on one provider saves is given to agents on every provider. The memory is plain text files on your PC. This page covers what is stored, who writes it, where the files are, and the background memory reviewer.
What Control Deck remembers
Control Deck stores 4 kinds of information for agents. All of it is plain text on your PC.
| Kind | How many | What it holds |
|---|---|---|
| Deck memory | 1 per project folder | Facts about that project: conventions, decisions and the reason for each, and problems to avoid. Every agent that works in the project folder shares it. |
| Global memory | 1 for your Windows user on this PC | Facts that hold in every project: your PC, your tools, and your preferences. Every agent on every deck shares it. |
| Persona file | 1 global file, and 1 per project folder | A short text that says how commanders work and communicate. Control Deck has a built-in default. |
| Skills | 1 set per deck | Written procedures that agents save so that later agents on the deck can repeat them. |
Control Deck has no screen for reading or editing memory. You open the files, or you ask an agent. See Read, edit, or clear memory.
Facts
Deck memory and global memory are lists of facts. Each fact is one line. The agent that saves a fact gives it one of 6 kinds: convention, decision, gotcha, preference, reference, or env.
Memory is for facts that stay true and that agents can use again. Agents leave out secrets, details of the current task, and anything they can read from the code or from Git.
The lists are short on purpose, because every agent gets all of them.
| Memory | Limit for the facts |
|---|---|
| Deck memory | 2,200 characters |
| Global memory | 1,375 characters |
When a memory is 80% full, agents remove facts that are out of date and shorten long ones.
What an agent gets
When an agent starts, Control Deck gives it this context:
- The deck memory for its project folder, and the path of that file.
- The global memory, and the path of that file.
- The project's persona file.
- The project's instruction files, if they exist:
CTRL_DECK.md,AGENTS.md, andCLAUDE.md. Control Deck looks in the project folder and in up to 3 folders above it. - A list of the deck's skills, one line per skill. The agent reads the full text of a skill when it needs it.
The persona file, the instruction files, and the skills list together are limited to 24,576 characters. The whole context is limited to 32,768 characters. If the text is longer, Control Deck cuts it in the middle.
Agents save facts to Control Deck memory, not to the provider's own memory feature. The provider's own memory reaches only that one CLI.
What goes to the provider
Control Deck passes the context through each CLI's own option for extra instructions. The context is then part of what the CLI sends to its provider with your prompts.
- Claude, Codex, Grok, and OpenCode agents get the context this way.
- A Cursor agent gets a rule file instead. It reads memory through the
ctrl-deckMCP server when it needs it. What it reads also goes to its provider.
See MCP and the command line for the files and options that Control Deck adds to each CLI. See Your data and privacy for everything that leaves your PC.
See what a card was given
For each agent card, Control Deck writes the context to a file named terminal-agent-context-<id>.md in the project's .ctrl-deck folder. Open the file in a text editor to read what the agent got. Control Deck deletes these files when they're more than 14 days old.
Who writes memory, and when
Two things write memory: the agents on your decks, and the background memory reviewer if you turn it on.
Agents
Any agent on a deck can add, replace, or remove a fact while it works. The change is saved at once. An agent that starts later gets the new memory. An agent that is already running can read the current memory again when it needs it.
An agent can also do these things:
- Replace the project's persona file, when you ask it to change how the project's agents behave.
- Create, change, and archive the deck's skills.
- Look up facts that were removed. See History, later in this section.
To make an agent remember something, say so. For example: Remember that this repo uses pnpm.
The background memory reviewer
The reviewer is off by default. If you turn it on, it reads finished agent work and saves facts and skills that the agents didn't save themselves. See The background memory reviewer.
Checks on every change
| Case | What Control Deck does |
|---|---|
| The change makes the facts longer than the limit. | Refuses the change. The agent must remove or shorten older facts first. |
| The new fact is already stored. | Ignores the new fact. |
| The new fact is close to a stored fact. | Refuses the new fact and tells the agent to replace the stored fact instead. |
| A deck fact names a file or folder that isn't in the project. | Refuses the fact. If the agent confirms that the path is correct, Control Deck stores the fact with (unverified) at the end. |
Facts of the kinds reference and env can go out of date. When an agent audits memory, Control Deck reports each such fact that is 90 days old or more, so that the agent checks it again. The audit also reports deck facts that name a file that no longer exists, and facts stored with (unverified). The audit removes nothing.
History
Control Deck records every change that an agent or the reviewer makes in a history file next to the memory file. Each record has the time, the agent's name, and the old and new text. A fact that was removed stays in the history, and agents can look it up there.
When a history file reaches 1 MB, Control Deck renames it to memory-ledger.1.jsonl and starts a new one. This replaces an older memory-ledger.1.jsonl.
Skills
Each skill is a folder with a SKILL.md file. About once a week, Control Deck checks the skills that agents or the reviewer created on a deck:
- A skill with no activity for 30 days is marked stale.
- A skill with no activity for 90 days is archived. Control Deck moves its folder to an
archivefolder inside the same deck folder. - A skill that an agent pinned is left alone.
Read, edit, or clear memory
There are two ways to work with memory: ask an agent, or open the files.
Ask an agent
Type the request in any agent card on the deck. For example:
Show me the deck memory and the global memory.Remove the fact about the staging server from deck memory.Replace the pnpm fact in deck memory with: this repo uses npm.
Changes that an agent makes are recorded in the history file.
Edit the files
Open the memory file in a text editor. See Where the files are.
Change, add, or delete lines. Each fact is one line that starts with
-.A line that Control Deck wrote looks like this:
- [a3f9 decision] Use pnpm in this repo, because the lockfile is pnpm.The square brackets hold a 4-character id and the kind. A line that you add can leave them out:
- The staging server is reached through the VPN.Keep the heading and the paragraph at the top of the file. Save the file.
Agents that start after you save get the new text. A change that you make by hand isn't recorded in the history file.
If your edit makes the facts longer than the limit, agents can't add facts until the list is shorter.
Clear memory
| To clear | Do this |
|---|---|
| Deck memory for one project | Delete MEMORY.md in the project's .ctrl-deck folder, or delete its fact lines. |
| Global memory | Delete GLOBAL_MEMORY.md, or delete its fact lines. |
| The history of removed facts | Delete memory-ledger.jsonl and memory-ledger.1.jsonl in the same folder as the memory file. |
| A skill | Delete the skill's folder. |
If you delete a memory file, Control Deck creates it again, empty, the next time an agent saves a fact.
Change the persona
Each project folder has its own persona file, .ctrl-deck\soul\SOUL.md. Control Deck creates it the first time an agent starts in the project. To change how commanders behave in that project, edit this file.
The first text of a project's persona file comes from the global persona file, GLOBAL_SOUL.md. To set the persona for projects you open in the future:
Open the folder
%AppData%\Ctrl Deck\ctrl-deck. If it doesn't exist, create it.Create or open
GLOBAL_SOUL.mdand write your text.
If GLOBAL_SOUL.md is missing or empty, Control Deck uses its built-in default. A change to the global file doesn't change a project that already has a SOUL.md.
The soul folder also holds MEMORY.md and USER.md. Control Deck doesn't give those two files to agents. Deck memory is the MEMORY.md one level up, in .ctrl-deck.
Where the files are
Files for one project are in the .ctrl-deck folder inside the project folder. Files for all projects are in the Control Deck data folder, %AppData%\Ctrl Deck.
| File or folder | What it is |
|---|---|
<project>\.ctrl-deck\MEMORY.md | Deck memory. |
<project>\.ctrl-deck\memory-ledger.jsonl | History of changes to deck memory. |
<project>\.ctrl-deck\soul\SOUL.md | The project's persona file. |
<project>\.ctrl-deck\decks\<deck id>\skills | The deck's skills. Each skill is a folder with a SKILL.md file. |
<project>\.ctrl-deck\terminal-agent-context-<id>.md | The context that one agent card was given. |
%AppData%\Ctrl Deck\ctrl-deck\GLOBAL_MEMORY.md | Global memory. |
%AppData%\Ctrl Deck\ctrl-deck\memory-ledger.jsonl | History of changes to global memory. |
%AppData%\Ctrl Deck\ctrl-deck\GLOBAL_SOUL.md | The global persona file. It exists only if you create it. |
%AppData%\Ctrl Deck\port\backend_reviews.jsonl | The reviewer's log. It keeps the last 500 reviews. |
%AppData%\Ctrl Deck\reviewer-scratch | The folder the reviewer's CLI runs in. |
Memory and Git
When Control Deck creates a project's .ctrl-deck folder, it writes a .gitignore file in it. That file tells Git to ignore everything in the folder except MEMORY.md and the .gitignore file itself.
- You can commit
MEMORY.md. Everyone who clones the repository then starts with the same deck memory. - Git sees
MEMORY.mdas a new file. Check it for private facts before you commit. - The persona file, the skills, the history, and the per-card files stay out of Git.
- If
.ctrl-deck\.gitignorealready exists, Control Deck doesn't change it.
The background memory reviewer
The reviewer reads finished agent work and decides whether it holds a fact or a procedure worth keeping. It then changes deck memory, global memory, or the deck's skills. Its changes apply at once. Control Deck doesn't ask you first.
The reviewer is off until you pick a provider for it. To set it up, open Settings > Agent Backend and find the Background memory reviewer panel.
| Setting | What it does | Default |
|---|---|---|
| Reviewer provider | Picks what runs the reviewer: Disabled, Claude, Codex, Cursor, OpenCode, Grok, or Custom API endpoint. Disabled turns the reviewer off. | Disabled |
| Review Worker Turns | Reviews each completed worker turn. A turn that ends with an error isn't reviewed. | On |
| Review Terminal Sessions | Reviews an agent card's session when the session closes. Shell cards and very short sessions are not reviewed. | On |
The two switches have an effect only when Reviewer provider is not Disabled. A line under the switches shows the state of the Control Deck backend, for example ready.
Run the reviewer on a provider CLI
If you pick Claude, Codex, Cursor, OpenCode, or Grok, the reviewer runs on that provider's CLI on your PC, with the account you're signed in to. Two more settings appear.
| Setting | What it shows or does |
|---|---|
| CLI sign-in | Shows Signed in, Not signed in, or CLI-owned auth. CLI-owned auth means Control Deck can't tell whether the CLI is signed in. |
| Model | Picks the model for reviews. Provider default is the default and uses the CLI's own default model. Control Deck remembers one choice per provider. |
Under Model, the app shows Runs on your Claude plan., with the name of the provider you picked.
The CLI must be installed. The reviewer runs only when CLI sign-in shows Signed in, or when the provider's API key is set in an environment variable. See Sign in to provider CLIs.
Run the reviewer on a custom endpoint
If you pick Custom API endpoint, the reviewer sends each review to a server that you name. The server must accept OpenAI-style chat completions requests.
| Setting | What to enter |
|---|---|
| Base URL | The address of the API, for example https://host/v1. Control Deck sends reviews to chat/completions under this address. |
| API key | Your key for that server. Control Deck sends it as a bearer token. |
| Model | The model for reviews. To load the server's model list, enter the key and click Refresh models. |
All three are required. Next to Refresh models, the app shows one of these messages:
| Message | Meaning |
|---|---|
| Enter an API key to load models. | The API key field is empty. |
| Loading models… | Control Deck is asking the server for its models. |
| 12 models loaded. | The list came from the server. The number is the count of models. |
| Using known models (reason) | The server didn't return a list. The menu shows models that Control Deck already knows, and the reason is in the parentheses. |
| 12 known models. | The menu shows models that Control Deck already knows. |
| (error text) | The request failed. The message is the error text. |
| Could not load models. | The request failed and gave no error text. |
| Could not load models: (error) | The request itself failed. The error follows the colon. |
If the menu has models and you haven't picked one, the first entry is Select a model…. If the menu has no models, it shows No models and a hint to refresh after you add a key.
What the reviewer costs
The reviewer uses your own account. Control Deck doesn't provide a model for it.
- On a provider CLI, each review is a request on your plan with that provider. It counts toward that plan's limits like any other use of the CLI.
- On a custom endpoint, each review is a request that the endpoint bills to your API key.
- Each review is 1 request. If the reply can't be read, the reviewer asks 1 more time.
- With both switches on, there is 1 review for each finished worker turn and 1 for each agent card session that closes.
What the reviewer sends and does
For each review, Control Deck sends this text to the reviewer's provider or endpoint:
- The agent's name, its provider, the project folder path, and the deck's name.
- The current deck memory and global memory, up to 4,096 characters each.
- For a worker turn: the task text, up to 6,144 characters, and the worker's reply, up to 20,480 characters.
- For an agent card session: the last part of the terminal text, up to 20,480 characters.
Before Control Deck sends terminal text, it replaces values that look like credentials with a [REDACTED] marker. This covers private keys, authorization headers, bearer tokens, keys that start with sk-, JSON Web Tokens, passwords inside web addresses, and values of settings whose names contain words such as api_key, token, secret, or password.
Redaction matches patterns, so it can miss a secret that has an unusual form. If a session showed a secret on screen, treat the reviewer's provider as having received it.
One review can make up to 5 changes to memory and save up to 2 skills. The same checks apply as for agents. See Who writes memory, and when.
Limits on a reviewer that runs on a CLI
- It has no card on the board.
- It runs in
%AppData%\Ctrl Deck\reviewer-scratch, not in your project folder. - It gets no terminal and no MCP servers.
- Control Deck refuses every permission request that it makes.
- Reviews run one at a time. A review that takes more than 5 minutes is stopped.
- Control Deck keeps the reviewer's CLI running between reviews and closes it after 5 minutes without a review.
After a review of an agent card session completes, Control Deck discards its copy of that session's terminal text.
If reviews don't run
A review that runs ends as completed, skipped, or failed. The result is in the Agent backend card and in the reviewer's log. See See what the reviewer did.
The reviewer can't start
If the reviewer can't start, no review runs and nothing is written to the log. The Agent backend card shows Memory learning paused one time for each cause. The card doesn't name the cause. Check these:
| Cause | What to do |
|---|---|
| The provider's CLI isn't installed, or Control Deck can't find its command. | Install the CLI, or pick another Reviewer provider. |
| CLI sign-in doesn't show Signed in. | Sign in to the provider's CLI. |
| Reviewer provider is Custom API endpoint, and Base URL, API key, or Model is empty. | Fill in all 3 fields. |
| 3 reviews in a row failed or were skipped. | Control Deck pauses the reviewer for 5 minutes, then tries again. Fix the cause of the failures. See the next table. |
A review that is skipped because the card is a shell card doesn't count toward the 3.
A review is skipped or fails
The Agent backend card and the log show the reason. These are the messages that Control Deck writes itself. A message that names a provider uses the reviewer's provider.
| Message | Meaning and what to do |
|---|---|
| Custom endpoint is rate-limited for background review. | The endpoint answered with HTTP status 429. The review is skipped. Later reviews try again. |
| Custom endpoint rejected the API key. Update it in Settings > Agents to resume background memory review. | The endpoint answered with HTTP status 401 or 403. Enter a valid key in API key. The field is in Settings > Agent Backend. |
| Claude reviewer session failed to start: (error) | The provider's CLI didn't start a session. The error text comes from the CLI. |
| claude reviewer turn timed out after 300s | The review took more than 5 minutes. |
| Reviewer declined the review turn. | The model refused the review. |
| Reviewer session was cancelled mid-review. | The provider's CLI stopped the review before it finished. |
If a custom endpoint answers with another error, the message is the HTTP status code and the endpoint's reply.
The sign-in expired notice
If a review fails or is skipped because the provider reports an expired sign-in or an invalid API key, Control Deck shows a notice. Its title is a provider name and sign-in expired. Its text says to reconnect in Settings > Agents.
- The notice stays for 12 seconds.
- It appears one time per provider until you restart Control Deck.
- The provider in the title is the provider of the agent whose work was under review. That can differ from the Reviewer provider.
To fix the problem, sign in to the reviewer provider's CLI again. For a custom endpoint, enter a valid API key in Settings > Agent Backend.
See what the reviewer did
The Agent backend card
To open the card, press Ctrl+K and run Open the agent backend, or type open backend in the command bar. See Commands.
The card shows these things, from top to bottom:
- The state of the Control Deck backend: Ready, Offline, Needs attention, or Connecting, and the number of active agent sessions.
- Two counts: sessions and events.
- One line for the last review. Before the first review, it reads No background reviews yet.
- The last 8 events. If there are none, the list reads No backend activity yet.
The line for the last review starts with the agent's name.
| Line | Meaning |
|---|---|
| Alpha: 2 memory writes | The review completed and changed memory 2 times. 0 memory writes means it found nothing to save. |
| Alpha: 1 skill update | The review completed and saved 1 skill, with no change to memory. |
| Alpha: skipped (reason) | The review didn't run. The reason is in the parentheses. |
| Alpha: failed (error) | The review ran and failed. |
| Alpha: reconnect Claude in Settings > Agents | The reviewer's sign-in or API key is no longer valid. |
| Alpha: CLI auth works; reconnect Claude for backend review | The same problem, for a review of an agent card session. |
These events in the list are about memory:
| Event | Meaning |
|---|---|
| Memory loaded | Control Deck gave an agent its memory context. |
| Memory review started | A review began. |
| Memory review completed · no changes | The review found nothing to save. |
| Memory review completed · 2 writes, 1 skill | The review changed memory 2 times and saved 1 skill. |
| Memory review skipped | The review didn't run. If there is a reason, the event shows the reason instead of this text. |
| Memory review failed | The review failed. If there is an error message, the event shows the message instead of this text. |
| Memory learning paused | The reviewer can't run now, for example because the CLI isn't signed in. |
| Skill review completed | A review saved a skill. |
| Skill curator completed | The weekly check of the deck's skills ran. |
Settings > Status
The Services panel has a Control Deck backend row. The backend runs agent sessions and the reviewer. The row shows running, offline, or unknown.
The reviewer's log
Every review is recorded in %AppData%\Ctrl Deck\port\backend_reviews.jsonl. The file keeps the last 500 reviews.