mom-rebuild

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Rebuild discards the synthesized vault and re-creates it from offset 0 over the entire captured history. It is heavier than a fold — use it deliberately. For routine end-of-session saves, use
/mom-fold
instead.
重建操作会丢弃已合成的vault,并从偏移量0开始基于完整的捕获历史重新创建它。它比fold操作更耗费资源——请谨慎使用。对于常规的会话结束保存,请改用
/mom-fold

Preflight

前置检查

Check that
mom
is on PATH:
bash
command -v mom
If it is missing, tell the user MOM is not installed and ask permission to install it:
text
MOM is not installed. Install it now with Homebrew?
  brew install momhq/tap/mom
Source: https://github.com/momhq/mom
If the user agrees, run that command. If the user declines, stop. Do not install MOM without explicit permission.
Confirm a project is bound:
bash
test -f .mom-project.yaml
If it is missing, the directory is unbound — there is nothing to rebuild. Tell the user to bind first with
/mom-project
, then stop.
确认
mom
已在PATH中:
bash
command -v mom
如果未找到,请告知用户MOM未安装并询问是否允许安装:
text
MOM is not installed. Install it now with Homebrew?
  brew install momhq/tap/mom
Source: https://github.com/momhq/mom
如果用户同意,执行该命令。如果用户拒绝,停止操作。未经明确许可不得安装MOM。
确认项目已绑定:
bash
test -f .mom-project.yaml
如果该文件缺失,说明当前目录未绑定项目——没有可重建的内容。告知用户先使用
/mom-project
绑定项目,然后停止操作。

Run

执行步骤

Confirm with the user before rebuilding — it regenerates the whole vault from scratch (human-authored content in CLAUDE.md is preserved; synthesized vault files are replaced) and runs the LLM engine over all history, so it can be slow.
On confirmation:
bash
mom vault rebuild
Append
--engine <auto|claude|codex|pi>
only if the user named a specific engine. When it finishes, run
mom vault status
and report the watermark, file count, and engine used.
重建前需与用户确认——这会从头开始重新生成整个vault(CLAUDE.md中的人工编写内容会保留;合成的vault文件将被替换),并针对所有历史运行LLM引擎,因此可能会较慢。
获得确认后执行:
bash
mom vault rebuild
仅当用户指定了特定引擎时,才添加
--engine <auto|claude|codex|pi>
参数。完成后,执行
mom vault status
并报告水印、文件数量和所使用的引擎。

Rules

规则

  • Always confirm before rebuilding — it is a full regeneration over all captured history.
  • For routine saves use
    /mom-fold
    ; reserve rebuild for engine changes or recovery from a corrupted vault.
  • CLI flag surface — never invent flags. Before using any flag, run
    mom vault rebuild --help
    and confirm it appears.
  • 重建前必须确认——这是针对所有捕获历史的完整重新生成操作。
  • 常规保存请使用
    /mom-fold
    ;仅在切换引擎或从损坏的vault恢复时才使用重建操作。
  • CLI参数仅使用现有选项——切勿自创参数。 使用任何参数前,请执行
    mom vault rebuild --help
    确认该参数存在。

Postflight (version hint)

后续检查(版本提示)

Any
mom ...
command may print a banner to stderr like:
MOM 0.40.1 available. Run `brew upgrade mom` or `mom self-update`
If you see that line, finish the task first, then add one short line at the end of your reply suggesting the upgrade. Do not run the upgrade yourself.
任何
mom ...
命令都可能在stderr中打印如下横幅:
MOM 0.40.1 available. Run `brew upgrade mom` or `mom self-update`
如果看到该提示,请先完成当前任务,然后在回复末尾添加一行简短的升级建议。请勿自行执行升级操作。