/mstack:mstackfrom mstack
Operating guide for mstack single-agent mode, where one big agent does all the work in one context instead of orchestrating subagents, with session memory that survives compaction, crystallized core memories and a model policy tied to plan limits. Use when the user mentions mstack, when a hook message starting with "mstack" asks for a checkpoint, a pause or a reload after compaction, when unsure how to write session or core memory, or when tempted to hand work to a subagent in an mstack project.
Ships in mstack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are the one agent doing this work. Not a tech lead with a team: the engineer. You read the code, write the change and run it, in this context, where the user can watch every step.
mstack trades speed for that. No handoffs means nothing is lost between agents, and one visible stream of work means the user supervises you directly instead of building guardrails around a swarm. Hooks handle the mechanics. This guide covers your part.
web-fetch and claude-code-guide are allowed). When the user wants parallelism they open another terminal. If a spawn is denied, do not look for a way around it. Do the work.The full list, with reasons: principles.
One file per session in docs/mstack/sessions/, local and gitignored. Its path is in the session-start message; mstack session prints it (and creates it).
Hooks tell you when to write. What to do with each message:
| Hook message | Do this |
|---|---|
mstack checkpoint | At the next natural pause, update the file, then carry on |
mstack FINAL checkpoint | Before any other work, bring the file fully up to date. Compaction is about to happen |
this conversation was just compacted | The session file is inlined (or you are told to Read it). First bring it up to date from the compaction summary, which holds the last few steps the file may lack. Then continue from "State". Do not ask the user to repeat what the file records |
| A stop is blocked asking for a checkpoint | Update the file, then finish your turn |
What to write, by section:
The test: could a capable engineer who never saw this conversation continue from the file alone? Be specific, not long. "Fixed the auth bug" fails the test. "Session#valid? compared against local time; now Time.now.utc in lib/session.rb; spec added" passes.
Leave the mstack:auto-snapshot block alone. A hook rewrites it before each compaction.
You may also checkpoint without being asked, at a milestone or before a risky step.
docs/mstack/core_memories/<YYYY-MM-DD>-<slug>.md. Committed. Loaded into every future session, so each one costs context forever.
Write one only for a breakthrough or discovery: something that took real effort to learn, will stay true, and is not evident from the code or git history. Most sessions produce none. Progress and to-dos never belong here.
# Sequel models must load after DB.extension(:pg_json)
Loading a model first silently returns JSON columns as strings.
The require order in config/db.rb is load-bearing.
A title that states the fact, then a few lines. Before adding one, check the existing files and update or merge instead of duplicating.
If the session-start message says auto-writing is disabled (core_memories: false), write a core memory only when the user explicitly asks.
The rule is the best model the plan can afford: Fable 5.2 at high effort, stepping down to Opus 5.5 when the weekly limit passes 70%, pausing when the session limit passes 90%.
When a hook says mstack model policy: PAUSE:
/model command. You cannot switch models yourself.An FYI policy message (step back up) is one line to the user, then keep working.
| Command | Use |
|---|---|
mstack init | Set up a project (/mstack:setup does this and checks requirements) |
mstack doctor | Check the context cap, model, effort and status line |
mstack status | Config, plan usage, memory sizes |
mstack session | This session's memory file path |
mstack is on PATH while the plugin is enabled. If it is not found, run ${CLAUDE_PLUGIN_ROOT}/bin/mstack.
.mstackrc and required Claude Code settingsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub makevoid/mstack --plugin mstack5 skills in this plugin
/checkpointWrite the current session's state to the mstack session memory file now, so it survives compaction or a restart. Use when the user asks to checkpoint, save progress, save the session, write session memory, or says they are about to compact, clear or step away, and before running /compact manually./rememberCrystallize a breakthrough or discovery into a short, committed mstack core memory that every future session in the project starts with. Use when the user asks to remember something permanently, save a core memory, or says a finding should never be lost, and when a final checkpoint prompts for a core memory after a real discovery./setupSet up mstack in the current project and check its requirements, namely the 300k auto-compaction cap, the default model and effort, and the status line that tracks plan limits. Use when the user asks to set up, install, initialize or configure mstack, when a session-start message says mstack is not initialized or lists setup problems, or when `mstack doctor` reports a failure./statusReport mstack's current state for this project, including plan usage against the weekly and session limits, the model policy, the context cap, and the size of session and core memories. Use when the user asks for mstack status, how much of their limit is used, which model they should be on, or whether mstack is set up correctly.