From pmm
Populates empty or template-only memory files from session context and existing memory. Supports single file, batch (--all), and force re-hydration of active files.
npx claudepluginhub nominexhq/pmm-pluginThis skill uses the workspace's default tool permissions.
Populate empty or thin memory files from existing session context and loaded memory. Use when:
Saves Claude Code session state to memory by synthesizing changes, dispatching maintain agent to update files, and committing to git. Skips if no meaningful activity.
Lists loaded memory files and scans disk for available memory context (schema, daily logs, registers, archive) in Claude Code sessions. Highlights gaps and suggests actions.
Share bugs, ideas, or general feedback.
Populate empty or thin memory files from existing session context and loaded memory. Use when:
pmm:update) but the memory/ directory already has populated filespmm:settingsThis is not a greenfield operation. If memory files are already populated, they contain history that should inform every new file. Hydrate before the first maintain cycle runs on a new file. An empty file that gets maintained stays shallow. A hydrated file starts with the full context the system already has.
Parse $ARGUMENTS:
| Argument | Mode |
|---|---|
| (no args) | Show usage hint |
--all or all | Batch mode — hydrate all template-only files |
<filename> | Single file mode — hydrate one named file |
<filename> --force or --force <filename> | Force mode — re-hydrate even if file has content |
--all --force | Force batch mode — re-hydrate all active files |
Read memory/config.md to determine which files are active. Only operate on active files.
If $ARGUMENTS is empty, output usage and list active files:
pmm:hydrate — populate memory files from existing context
Usage:
pmm:hydrate --all hydrate all empty/stub files
pmm:hydrate <file> hydrate one file (e.g. voices.md)
pmm:hydrate <file> --force re-hydrate even if already populated
pmm:hydrate --all --force re-hydrate all active files
Active files (from memory/config.md):
[list active files with status: populated / template-only / empty]
Read each active file. A file is "template-only" if, after stripping blank lines, comment lines (<!--), and heading lines (#), it has fewer than 3 lines of content.
Before dispatching any agent, read each candidate file and classify:
Read memory/<file>
Strip: blank lines, comment lines (<!-- ... -->), heading lines (# ...)
Count remaining content lines
If count < 3 → template-only (candidate for hydration)
If count ≥ 3 → populated (skip unless --force)
Apply this check in main context — no agent needed for detection.
One file specified, no --force.
Check if the file is template-only. If populated (≥ 3 content lines), output:
memory/<file> already has content. Use --force to re-hydrate.
Stop.
If template-only (or --force), dispatch a single foreground agent (not background — agents need Edit/Write permissions):
Hydrate a memory file from existing memory. This is a WRITE task — edit the target file only. Do NOT run git commands.
Target file:
memory/<filename>Purpose:<what this file captures — infer from filename and core.md>Template structure: Read${CLAUDE_PLUGIN_ROOT}/references/templates.mdfor the correct format for this file type before writing.Instructions:
- Read
${CLAUDE_PLUGIN_ROOT}/references/templates.mdand locate the template for<filename>. Use it as the structural skeleton for your output — follow its format exactly.- Read ALL populated memory files to build context:
memory/timeline.md,memory/summaries.md— what happened over timememory/decisions.md— what was decided and whymemory/lessons.md— what went wrong and what to do insteadmemory/preferences.md— how the user worksmemory/processes.md— established workflowsmemory/standinginstructions.md— persistent rulesmemory/memory.md— long-term factsmemory/assets.md— people, tools, systemsmemory/graph.md,memory/vectors.md— relationships and similaritiesmemory/last.md,memory/progress.md— recent context Skip any file that doesn't exist or is template-only — no useful signal there.- Infer content for
memory/<filename>based on what the existing files reveal.
- Do not copy content verbatim — synthesise. Each file has one job.
- Only add entries you can justify from the existing memory. Never hallucinate.
- Use
[system:hydrate]as the attribution tag for all hydrated entries (applies to decisions.md, timeline.md, lessons.md, standinginstructions.md, last.md).- Write the inferred content to
memory/<filename>.- Return a brief summary: what was inferred and which source files informed it.
Use Maintain Agent Model from memory/config.md as the agent model. Default: haiku.
After the agent returns, main context commits:
git add memory/<filename> && git commit -m "memory: hydrate <filename> from existing memory"
Report what was hydrated.
--all)Two or more files need hydrating. Use a single agent — reads context once, writes all targets. More efficient than one agent per file.
Scan all active files (from memory/config.md). Classify each as template-only or populated (see detection logic above).
If --force is NOT set: collect only template-only files as targets. If no template-only files found:
All active files are already populated. Use --force to re-hydrate.
Stop.
If --force IS set: all active files are targets (excluding secrets.md — always excluded, never touched).
Report targets before dispatching:
Hydrating <N> files: <file1>, <file2>, ...
Dispatch a single foreground agent:
Hydrate multiple memory files from existing memory. This is a WRITE task — edit the target files only. Do NOT run git commands.
Target files:
<comma-separated list>References directory:${CLAUDE_PLUGIN_ROOT}/references/Instructions:
- Read
${CLAUDE_PLUGIN_ROOT}/references/templates.md. For each target file, locate its template section and use it as the structural skeleton.- Read ALL populated memory files to build context:
memory/timeline.md,memory/summaries.md— what happened over timememory/decisions.md— what was decided and whymemory/lessons.md— what went wrong and what to do insteadmemory/preferences.md— how the user worksmemory/processes.md— established workflowsmemory/standinginstructions.md— persistent rulesmemory/memory.md— long-term factsmemory/assets.md— people, tools, systemsmemory/graph.md,memory/vectors.md— relationships and similaritiesmemory/last.md,memory/progress.md— recent context Skip non-existent or template-only files — no useful signal there.- For EACH target file, infer appropriate content from the existing files.
- Do not copy content verbatim — synthesise. Each file has one job.
- Use the correct format from templates.md for each file type.
- Only add entries you can justify from existing memory. Never hallucinate.
- Use
[system:hydrate]as the attribution tag for all hydrated entries (applies to decisions.md, timeline.md, lessons.md, standinginstructions.md, last.md).- Special rules per file:
graph.mdedges are append-only — write new edges only, never modify existing entriesvectors.mdembedding registry is append-only — clusters/similarities are livingdecisions.md,lessons.md,standinginstructions.mdare append-only — write new entries onlylast.mdis always replaced entirely — write the full current-state window- Write inferred content to each target file.
- Return a brief summary per file: what was inferred and which source files contributed.
Use Maintain Agent Model from memory/config.md. Default: haiku.
After the agent returns, main context commits:
git add memory/ && git reset HEAD memory/secrets.md 2>/dev/null; git commit -m "memory: hydrate <file1>, <file2>, ... from existing memory"
Report the summary per file.
--force with a single file: skip the template-only check, always dispatch the agent. Useful when a file has content but it's stale or thin.
--force with --all: re-hydrate every active file, whether populated or not.
In force mode, the agent prompt is identical — the distinction is only in whether the detection gate fires.
secrets.md is never touched — excluded from all hydration operations, batch or singleconfig.md is never a hydration target — it controls the system, not records historyrun_in_background: true) do not inherit Edit/Write permissions — always dispatch as foreground agentsmemory/config.md${CLAUDE_PLUGIN_ROOT}/references/templates.md before dispatching the hydration agentAfter hydration, the new file will be picked up automatically by the SessionStart hook if it's listed as active in config.md. No CLAUDE.md changes needed — hooks handle loading.