Skip to content

Commands

Valerio edited this page Oct 16, 2026 · 2 revisions

MEM defines a small set of reserved commands: explicit instructions you write on their own line in a prompt. They make frequent operations deterministic, because the agent follows a documented procedure instead of guessing one from prose.

Grammar

MEM <COMMAND> [<SUBCOMMAND>] [target]
  • The line starts with MEM, and MEM, the command and the subcommand are uppercase.
  • Some commands require a target, some refuse one.
  • A command applies to the current request only.
  • When a command activates, the agent opens its reply with a line such as > MEM HELP: active, so a wrong activation is visible at once and you can correct it.

A command is recognised only when it is genuinely an instruction. Mentioning one in a sentence ("what does MEM FORCE do?"), quoting one, or showing one in a code block, as on this page, does not trigger it. Lowercase does not trigger it either.

Subcommands

Most commands have none. An extension that offers subcommands declares the exact list, and any other word after the command is read as the target. If you need to act on a file whose name matches a subcommand, write it as ./NAME: MEM CLEAN ./STATUS works on a file called STATUS. Core commands never have subcommands, and extensions cannot add any to them.

Core commands

Available on every installation, with no extension:

Command What it does
MEM HELP Lists the available commands with a one-line purpose each. MEM HELP <extension-id> explains one extension in full
MEM STATUS Reports the MEM version, KB_ROOT, the configuration in effect, and each registered extension with its status and installed and available versions
MEM INIT Runs first-time initialization, including the extension offer
MEM UPDATE Updates MEM.md, applies the upgrade steps, checks extension versions, offers new extensions
MEM LINT Reviews the knowledge base, or one path of it
MEM FORCE Re-anchors the session (see below)

All core commands are read-only except INIT and UPDATE.

MEM FORCE

Long sessions drift: the agent forgets a convention it read an hour ago, or answers from memory instead of the files. MEM FORCE makes it re-read MEM.md, the configuration, the index and the project page, read the pages relevant to the request, inspect the source, record what it discovers, and then tell you which MEM files it read and which it changed. That last report is the point of the command.

FORCE is a modifier: it applies to the whole request wherever it appears on its line, and it combines with any other command. It never lets the knowledge base outrank the source code.

Extension commands

Extensions add commands to the same namespace. A short map, with the details on each page:

Command Extension What it does
MEM REVIEW <target> mem-commands Assess a plan, task or troubleshooting note before it is implemented
MEM CHECK <target> mem-commands Verify work declared complete against what actually exists
MEM DEFINE <COMMAND> mem-commands Write a command of your own
MEM TOOLS, CHECK, SETUP mem-toolbox What tools and libraries are known; probe runtimes and environments; record this computer's tools folder and environments once
MEM WORKSPACE, CHECK, INIT mem-workspace Status of every repository in the workspace; check the layout; record it
MEM STATS ... mem-stats SETUP, STATUS, RESET, REPORT, WATCH, INGEST, PRUNE, INIT, INVENTORY, READ
MEM OPTIMIZE ... mem-optimize SETUP, STATUS, RESET, PAGES
MEM CLEAN ... mem-cleaner In development, not yet in the catalogue

How a command is resolved

The agent looks for the command in this order: a core command, a command of an installed extension, a project command under an extension's custom/ folder, then any extension that declares it in EXT.md. Core commands cannot be shadowed, and a clash between two extensions is reported and refused, never settled arbitrarily.

Situation What the agent does
Found Runs it
Unknown, but clearly meant as a MEM command Says so, lists the available commands, suggests the closest, and asks. It never auto-corrects
Nothing installed provides it Checks the catalogue and offers to install the extension that provides it, once, with a confirmation naming the files and the source URL
extensions_enabled: false Says the command exists but is disabled by configuration, and proposes nothing
Registered, but its files are missing Reports a broken registration

The agent never ignores a recognised command silently, and never invents the meaning of one it cannot resolve.

Asking about an extension

You do not need a command to learn what an extension does. Type its name alone, or with a word asking for help, in any language or case:

mem-optimize
mem-optimize ?
mem-optimize --help
explain mem-optimize
what is mem-optimize

The agent answers with the extension's full help: what it is for, its commands, its configuration options with the values in effect, and its status, including whether it ships code and whether your configuration allows it. Answering changes nothing. If the extension is not installed, you get the catalogue's description and an offer to install it. MEM HELP <extension-id> is the explicit form of the same request.

A prompt that asks the extension to do something ("run mem-stats on this project") is an ordinary request, not a help request.

Clone this wiki locally