/memory-mason:mmc [YYYY-MM-DD|raw-folder-path|--all]from memory-mason
Compiles daily captures into an Obsidian vault structure using a three-stage EXTRACT->TRANSFORM->LOAD pipeline. Updates concepts, MOCs, synthesis pages, and index. Trigger with 'compile today' or '/mmc'.
Ships in memory-mason. 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.
Compile one raw daily capture into the Vault Architecture v2 knowledge base.
This command is operational only. Do not write /mmc, /memory-mason:mmc, or their execution chatter back into the vault.
Before any other reasoning, resolve vault config in this priority order:
./.env./memory-mason.json~/.memory-mason/.env~/.memory-mason/config.jsonResolve:
Resolve vaultPath from the first source in priority order that provides it.
Resolve subfolder independently using the nearest source in the same priority order:
./.env MEMORY_MASON_SUBFOLDER./memory-mason.json subfolder~/.memory-mason/.env MEMORY_MASON_SUBFOLDER~/.memory-mason/config.json subfolderai-knowledge only if none of those define a subfolderDo not claim config is missing until you have attempted all four locations above. If none provide a vault path, fail fast with an explicit error that names every location checked.
Resolve minimize from the same priority order:
MEMORY_MASON_MINIMIZE (highest precedence)./.env MEMORY_MASON_MINIMIZE./memory-mason.json key minimize~/.memory-mason/.env MEMORY_MASON_MINIMIZE~/.memory-mason/config.json key minimizefalseWhen minimize is true, apply deterministic lossless compression (whitespace and punctuation normalization) to assistant narrative text before vault writes. Content is compacted but never dropped; code blocks, inline code, URLs, and quoted strings are preserved verbatim. When false (the default), write captured text verbatim.
All reads, writes, and wikilinks are strictly scoped to {vault}/{subfolder}/. Never access, create, or link files in sibling subfolders; only add [[{subfolder}/concepts/slug]] links to concepts confirmed to exist in this subfolder during this compile.
Use these paths for all operations:
--all, enter batch mode: read _meta/state.json ingested map, glob all date folders under _raw/, identify every folder not present in the ingested map (or whose hash changed), and process each in ascending chronological order. Run the full EXTRACT → TRANSFORM → LOAD pipeline for each date. After each date completes, persist state and manifest before proceeding to the next date. Report per-day results. After all days complete, run a final TRANSFORM pass across the full concept set to ensure atlas/synthesis pages reflect the complete corpus.YYYY-MM-DD, use that date folder under _raw/.sourceKey as the date folder name YYYY-MM-DD.meta.json if present for operational metadata only. Do not treat meta.json as narrative source text. Inspect the schemaVersion field: version 2 signals session-scoped layout; any other value or absence signals legacy daily layout.Raw layout detection and chunk reading — support both layouts, including mixed transition days:
Session-scoped layout (meta.json schemaVersion 2): chunk files are primarily named {HHMMSS}-{sid8}-{NNN}.md (session start time, first 8 chars of session id, 3-digit chunk index). Also glob legacy numeric chunks matching ^[0-9]{3}\.md$; on transition days they are part of the same compile and hash input as a separate legacy group. Build ordered groups as follows:
legacy group first and sort those files by numeric chunk index ascending.{HHMMSS}-{sid8} prefix; within each group, sort by {NNN} ascending.legacy group, process session groups in ascending {HHMMSS} order. Use {sid8} as a deterministic tie-breaker if two groups share the same {HHMMSS}.For parsing, hashing, and manifest chunk ordering, concatenate chunks in full group order: legacy group first when present, then session groups by {HHMMSS}/{sid8}, with chunk order ascending inside each group. Insert a single blank line between chunks. Legacy numeric chunks remain their own group even when schemaVersion is 2; do not merge them into any session group.
Legacy daily layout (schemaVersion absent or not 2): read chunk files matching ^[0-9]{3}\.md$ in numeric order: 001.md, 002.md, and so on. Concatenate in numeric order with a single blank line between chunks.
In both layouts, sourceKey is the date folder name YYYY-MM-DD.
_raw/{YYYY-MM-DD}/_meta/ subfolder is a sibling artifact class. Do NOT concatenate its files into chunk text and do NOT include them in the sourceKey hash. They are processed separately in section 1.5.sourceKey with the same hash, and the user did not explicitly request recompilation, stop and report Already compiled (unchanged).Continuation chunk boundary (> [!continued]): when an exchange (user prompt → assistant reply pair) is split across two chunk files due to a hard size cap, the continuation chunk begins with:
> [!continued]
EXTRACT and all compile parsing must treat > [!continued] as a split boundary marker — skip it and treat the remainder of that chunk as the direct continuation of the preceding chunk's content. Do not surface it as vault content, a callout, or a key point.
For every concept page, use this exact frontmatter schema:
---
title: "Concept Name"
type: concept
status: seedling
confidence: medium
aliases: []
tags: []
has_contradiction: false
sources:
- "_raw/2026-05-04/143022-a1b2c3d4-001.md"
created: 2026-05-04
updated: 2026-05-04
---
Frontmatter discipline rules (vault-wide):
Concept status rules:
seedling.growing when the concept has 3 or more unique sources entries.evergreen when at least one synthesis page links to the concept.evergreen overrides growing, and growing overrides seedling.Confidence rules:
low: weakly supported, inferred, or only briefly mentioned.medium: directly supported by the current raw capture or one durable prior source.high: corroborated by multiple sources or expressed as an explicit stable decision.Concept page body format (frontmatter omitted here because the schema above is authoritative):
# Concept Name
[2-4 sentence core explanation]
## Key Points
- [decision] Chose X over Y because of Z #tag
- [fact] This system always does A before B
- [gotcha] Omitting the config key silently disables the feature #tag
- [method] Run X then Y to achieve Z
- [Self-contained point with no category prefix when none fits]
## Details
[Encyclopedia-style paragraph]
[Second encyclopedia-style paragraph]
## Related
- [[{subfolder}/concepts/related-concept]] - [How it relates]
- [[{subfolder}/atlas/topic-slug]] - [Parent topic map]
Typed observations grammar for ## Key Points: each bullet SHOULD begin with a category tag in [brackets] where a category fits. Valid categories: decision (a choice made), fact (an observable truth or invariant), gotcha (a non-obvious trap or surprise), method (a procedure or technique). Plain bullets without a category are allowed as fallback when none of the four categories fits naturally. Inline #tag tokens within a bullet are encouraged for discoverability but optional. The category tag is for human and LLM comprehension only; it does not affect status or confidence rules.
If creating or updating a concept leaves at least one [decision] bullet in ## Key Points, ensure frontmatter tags contains decision so atlas/bases/decisions.base can discover it.
Keep source provenance in frontmatter only. Do not add a separate ## Sources section to concept pages.
Concept update rules:
created date.updated on every material change.aliases, tags, and sources.status and confidence after merging sources.Contradiction detection and supersede lifecycle:
## Key Points.has_contradiction: true in the concept's frontmatter:[!contradiction] Session _raw/2026-05-05/143022-a1b2c3d4-001.md states Y, but existing evidence from _raw/2026-05-01/090011-deadbeef-002.md says X.
[!contradiction] callouts must not be promoted to evergreen.Supersede resolution (when later evidence resolves a contradiction): when 3 or more sources agree on a newer fact that contradicts an older key point, the contradiction is considered resolved by supersession. Perform the split:
[!contradiction] callout, set has_contradiction: false, add frontmatter fields superseded_by: "[[{subfolder}/concepts/new-slug]]" and invalid_at: YYYY-MM-DD (the date of this compile). Do not delete the superseded concept — it remains in the vault as an archived record. Do not promote a superseded concept to evergreen.## Related: - supersedes [[{subfolder}/concepts/old-slug]].Gap flagging for thin concepts:
confidence: low and the ## Key Points section has fewer than 3 items, append a callout at the end of the ## Details section:[!gap] Sparse capture — this concept was only briefly mentioned. Awaiting future sessions for enrichment.
confidence: medium or high.Coaching advisories are deterministic, hook-emitted files describing workflow signals such as repeated prompts. They are NOT durable knowledge and must NOT become concept pages.
{vault}/{subfolder}/_raw/{YYYY-MM-DD}/_meta/*.mdkind, hash, count, sessionId, iso, plus an optional snippet key (a short redacted excerpt of the repeated prompt or error text — absent on older advisories written before this field existed).kind values: prompt-repeat, error-repeat. Unknown kind values must be ignored, not compiled.Advisories must not enter concepts, taxonomy, or synthesis pages and must not be included in sourceKey hashing. Route each advisory exclusively to {vault}/{subfolder}/atlas/workflow-coaching.md.
Atlas workflow-coaching page format:
---
title: "Workflow Coaching"
type: moc
tag: workflow-coaching
created: 2026-06-26
updated: 2026-06-26
---
# Workflow Coaching
## Summary
Repeated workflow signals captured deterministically by Memory Mason hooks. Each entry below corresponds to a unique prompt hash whose recurrence has crossed the nag threshold.
## Active Advisories
- **<hash16>** — kind: `prompt-repeat` — count: N — first: ISO — last: ISO — sessions: [s1, s2] — snippet: "<redacted excerpt>"
- ...
## Resolved Advisories
- **<hash16>** — kind: `prompt-repeat` — count: N — resolved: ISO — note: [optional]
Advisory upsert rules:
_raw/{date}/_meta/, parse its frontmatter.## Active Advisories, update count, last (= advisory iso), append sessionId to its sessions list deduplicated, and replace snippet with the newest advisory's value when present.## Active Advisories. Omit the — snippet: "..." segment entirely when the source frontmatter has no snippet key.## Active Advisories to ## Resolved Advisories is a manual user action; only honor it when an advisory already appears under ## Resolved Advisories in the existing page content.## Active Advisories by count descending, then by last descending.After upserting, update updated in the page frontmatter to today's date.
For each date being compiled, emit one session note per session found in the raw chunk files. Session identity depends on layout:
{HHMMSS}-{sid8} group is one session. The sid8 value is normally the first 8 characters of the sanitized (lowercased, non-alphanumeric-stripped) session id; when sanitizing yields an empty string, sid8 falls back to the literal nosession (9 characters — treat it as an opaque fallback token, not a length-8 slice). The session start time is {HHMMSS} (parse as HH:MM:SS local time on the date being compiled). Read meta.json entries to find sessionId for each chunk when available.sid8 = "daily". Read session id from meta.json if present; otherwise use "daily".Emit the session note at: {vault}/{subfolder}/sessions/YYYY-MM-DD-{sid8}.md
If the file already exists, update it: merge any new files, tags, and decisions; update updated and outcome; do not overwrite a user-edited narrative.
Session note frontmatter schema:
---
title: "Session YYYY-MM-DD {sid8}"
type: session
date: YYYY-MM-DD
session_id: "{full session id or 'daily'}"
project: "{project name derived from context or path, or 'unknown'}"
files:
- "path/to/file.ts"
tags: []
outcome: "One-line summary of what was accomplished."
sources:
- "_raw/YYYY-MM-DD/HHMMSS-{sid8}-001.md"
created: YYYY-MM-DD
updated: YYYY-MM-DD
---
Session note body format:
# Session YYYY-MM-DD {sid8}
## What happened
[2-4 sentence narrative of what occurred in this session: what was being built, investigated, or decided.]
## Decisions
- [Decision made or conclusion reached]
- [Another decision]
## Links
- [[{subfolder}/concepts/related-concept]] - [Why relevant]
- [[{subfolder}/_raw/YYYY-MM-DD/HHMMSS-{sid8}-001]] - Raw part 1
Session note rules:
files lists source files touched or discussed in the session, inferred from raw chunks. Omit if none are identifiable.tags mirrors the union of tags from concept pages extracted from this session's chunks.outcome is one line; derive it from the most prominent decision or result in the session.sources uses plain string paths (no wikilink brackets), same convention as concept sources: arrays. For session-scoped layout, prefer entries like "_raw/YYYY-MM-DD/143022-a1b2c3d4-001.md". For legacy daily layout, list the numeric chunk files: "_raw/YYYY-MM-DD/001.md", etc.## Links uses wikilinks with {subfolder}/ prefix. Include links to every concept page extracted from this session's chunks, and wikilinks to raw chunk files for direct navigation.{vault}/{subfolder}/ after EXTRACT, not just pages touched in this run. Never read concepts from sibling subfolders.{vault}/{subfolder}/concepts/ for shared tags. Add [[{subfolder}/concepts/related-slug]] entries in the ## Related section for concepts that share 2 or more tags. Target 3-5 outbound wikilinks per concept page. Only link to concepts confirmed to exist in the current subfolder.MOC generation rule:
Sparse MOC rule:
status: sparse in the frontmatter.{tag-slug}-sparse.md to {tag-slug}.md and remove the status: sparse field.Atlas page format:
---
title: "Tag Name"
type: moc
tag: tag-slug
created: 2026-05-04
updated: 2026-05-04
---
# Tag Name
## Summary
[1 short paragraph describing what this tag collects]
## Concepts
- [[{subfolder}/concepts/concept-a]] - [One-line summary]
- [[{subfolder}/concepts/concept-b]] - [One-line summary]
## Related Synthesis
- [[{subfolder}/synthesis/tag-slug]] - [Only if a synthesis page exists]
## Related Tags
- [[{subfolder}/atlas/another-tag]] - [Only when genuinely related]
Synthesis generation rule:
Synthesis page format:
---
title: "Synthesis: Tag Name"
type: synthesis
tag: tag-slug
concepts:
- "concepts/concept-a"
- "concepts/concept-b"
sources:
- "_raw/2026-05-01/090011-deadbeef-001.md"
- "_raw/2026-05-03/002.md"
- "_raw/2026-05-04/143022-a1b2c3d4-001.md"
created: 2026-05-04
updated: 2026-05-04
---
# Synthesis: Tag Name
## Pattern
[State the non-obvious cross-cutting pattern in 1-2 paragraphs]
## Evidence
- [[{subfolder}/concepts/concept-a]] - [Evidence]
- [[{subfolder}/concepts/concept-b]] - [Evidence]
- [[{subfolder}/concepts/concept-c]] - [Evidence]
## Implications
- [Reusable lesson]
- [Constraint or tradeoff]
- [Follow-up question or operational consequence]
Maturity promotion during TRANSFORM:
evergreen only if it has no unresolved [!contradiction] callouts and does not have a superseded_by field.seedling or growing) until the contradiction is resolved.superseded_by frontmatter) are permanently excluded from evergreen promotion regardless of synthesis citations.updated dates if their status changed.Home MOC rule:
/mmc run.atlas/home.md must include current vault stats and recent activity, even if no tag MOC or synthesis page changed.Home MOC format:
---
title: "Memory Mason Home"
type: moc
created: 2026-05-04
updated: 2026-05-04
---
# Memory Mason Home
## Vault Stats
- Concepts: [count]
- Synthesis: [count]
- MOCs: [count]
- Last compile: [ISO timestamp]
## Active Tags
- [[{subfolder}/atlas/tag-slug]] - [Concept count for the tag]
## Recently Updated
- [[{subfolder}/concepts/example-concept]]
- [[{subfolder}/synthesis/example-tag]]
- [[{subfolder}/atlas/example-tag]]
knowledge/ folder.concept, synthesis, moc.Index format:
# Memory Mason Index
| Type | Article | Summary | Updated |
|------|---------|---------|---------|
| concept | [[{subfolder}/concepts/example-concept]] | One-line summary. | 2026-05-04 |
| synthesis | [[{subfolder}/synthesis/example-tag]] | One-line summary. | 2026-05-04 |
| moc | [[{subfolder}/atlas/example-tag]] | One-line summary. | 2026-05-04 |
| session | [[{subfolder}/sessions/2026-05-04-a1b2c3d4]] | One-line outcome. | 2026-05-04 |
session row per session note created or updated during this compile.session exactly.{
"ingested": {},
"last_compile": null,
"last_lint": null
}
Preserve all other existing keys (including capture_metrics and total_cost_usd) when updating an existing state.json.
ingested[sourceKey] to:{
"hash": "<16-char-hash>",
"compiled_at": "<ISO-8601 timestamp>",
"chunk_count": 3
}
last_compile to the current ISO-8601 timestamp.{
"sources": {}
}
sources[sourceKey] to:{
"source_path": "_raw/YYYY-MM-DD/",
"hash": "<16-char-hash>",
"compiled_at": "<ISO-8601 timestamp>",
"chunks": [
"_raw/YYYY-MM-DD/143022-a1b2c3d4-001.md",
"_raw/YYYY-MM-DD/002.md"
],
"pages_created": [
"concepts/example-concept.md",
"atlas/example-tag.md",
"sessions/2026-05-04-a1b2c3d4.md"
],
"pages_updated": [
"concepts/another-concept.md",
"synthesis/example-tag.md",
"index.md"
]
}
The chunks array may mix session-scoped filenames ({HHMMSS}-{sid8}-{NNN}.md) with bare numeric filenames (002.md). Bare numeric entries are legacy daily-layout chunks — they remain valid and readable; no migration is required.
Include every session note created or updated during this compile in pages_created (if new) or pages_updated (if it already existed).
pages_created and pages_updated if the source key already exists.tags: arrays.---
type: meta
title: "Taxonomy"
updated: 2026-05-04
---
# Taxonomy
| Tag | Canonical | Aliases |
|-----|-----------|---------|
| tag-slug | Tag Name | alias-1, alias-2 |
{vault}/{subfolder}/atlas/bases/. Bases require Obsidian 1.9 or later and read real frontmatter properties only.atlas/bases/ directory if it does not exist..base file only when one of those canonical elements is missing, invalid, or differs from the canonical block. This is canonical drift..base file is valid YAML and still preserves the canonical structure, leave it unchanged so user formatting or other non-canonical edits are not clobbered.atlas/bases/sessions-timeline.base — table of all session notes, newest first:
filters:
and:
- 'type == "session"'
views:
- type: table
name: Sessions Timeline
groupBy:
property: date
direction: DESC
order:
- file.name
- date
- project
- outcome
- tags
atlas/bases/decisions.base — concepts that contain decision-category key points or a decision tag:
filters:
and:
- 'type == "concept"'
- tags.contains("decision")
views:
- type: table
name: Decisions
groupBy:
property: updated
direction: DESC
order:
- file.name
- updated
- tags
atlas/bases/contradictions.base — concepts with an unresolved contradiction (approximated via the has_contradiction frontmatter flag):
filters:
and:
- 'type == "concept"'
- has_contradiction == true
views:
- type: table
name: Contradictions
groupBy:
property: updated
direction: DESC
order:
- file.name
- updated
- has_contradiction
atlas/bases/seedlings.base — concepts still at seedling maturity:
filters:
and:
- 'type == "concept"'
- 'status == "seedling"'
views:
- type: table
name: Seedlings
groupBy:
property: created
direction: DESC
order:
- file.name
- created
- status
has_contradiction flag discipline: when adding a [!contradiction] callout to a concept page, set has_contradiction: true in that concept's frontmatter. When removing all [!contradiction] callouts from a concept page (because supersede resolution cleared them), set has_contradiction: false. The flag must stay in sync with callout presence on every concept update.
## [ISO-timestamp] compile | YYYY-MM-DD
- Source: _raw/YYYY-MM-DD/ ([chunk count] chunks, [session count] session(s))
- Concepts created: [count]
- Concepts updated: [count]
- Sessions created: [count]
- Sessions updated: [count]
- Synthesis created: [count]
- Synthesis updated: [count]
- MOCs created: [count]
- MOCs updated: [count]
- Index rows touched: [count]
_meta/log.md entries by ## [ headings._meta/log.md has 32 or more entries, auto-fold the oldest 16 entries (k=4) into {vault}/{subfolder}/_meta/folds/{fold-id}.md./mma extractive rules for the fold page: no invented facts, preserve verbatim source entries, and summarize only what those entries record._meta/log.md with:<!-- folded: [[{subfolder}/_meta/folds/{fold-id}]] ({COUNT} entries, {EARLIEST-DATE} to {LATEST-DATE}) -->
_meta/log.md after the replacement:## [ISO-timestamp] fold | {fold-id}
- Entries folded: {COUNT} ({EARLIEST-DATE} to {LATEST-DATE})
- Fold page: [[{subfolder}/_meta/folds/{fold-id}]]
/mmc output whenever auto-archive runs.context.md body rather than appending or fragmenting it. Rewrite the body as a single coherent narrative that incorporates new focus, decisions, and threads while discarding anything resolved or stale. Keep the total body under 300 words. Update the updated frontmatter timestamp.context.md must summarize only current focus, open decisions, and active threads that are still relevant after this compile.context.md format:
---
type: meta
title: "Session Context"
updated: 2026-05-04T12:34:56Z
---
## Current Focus
[Short paragraph]
## Open Decisions
- [Decision still unresolved]
## Active Threads
- [Thread still active]
.md extensions in article bodies._raw/YYYY-MM-DD/143022-a1b2c3d4-001.md for source provenance when session-scoped chunks exist.Every [[wikilink]] in article bodies must include the {subfolder}/ prefix followed by the full directory-prefixed path. This ensures Obsidian resolves links within the correct project when multiple subfolders share a vault.
| Target type | Correct | Wrong |
|---|---|---|
| Concept | [[{subfolder}/concepts/hook-system-architecture]] | [[concepts/hook-system-architecture]] |
| Synthesis | [[{subfolder}/synthesis/hook-architecture-and-wiring]] | [[synthesis/hook-architecture-and-wiring]] |
| Atlas MOC | [[{subfolder}/atlas/hooks]] | [[atlas/hooks]] |
| Session | [[{subfolder}/sessions/2026-05-04-a1b2c3d4]] | [[sessions/2026-05-04-a1b2c3d4]] |
| Raw source (body) | [[{subfolder}/_raw/YYYY-MM-DD/HHMMSS-sid8-NNN]] | [[_raw/YYYY-MM-DD/HHMMSS-sid8-NNN]] |
| Raw source (legacy) | [[{subfolder}/_raw/2026-05-04/001]] (legacy numeric layout — still readable) | [[_raw/2026-05-04/001]] |
| Meta fold | [[{subfolder}/_meta/folds/fold-id]] | [[_meta/folds/fold-id]] |
sources: arrays use plain string paths like "_raw/2026-05-04/143022-a1b2c3d4-001.md", not wikilink brackets. These do not need the subfolder prefix.What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/mmaArchive log entries when they exceed 32 entries, using batches of 2^k for compact storage. Extractive only — no invented facts. Run whenever _meta/log.md grows unwieldy.
/mmlLint the knowledge base for broken links, orphan pages, stale captures, and wikilink convention violations. Run as a periodic health check.
/mmqQuery the knowledge base. Reads session context first, then the root index, then relevant atlas, concept, and synthesis pages, and synthesizes a clear answer with [[wikilink]] citations. Use when you want to ask about past decisions, patterns, lessons, or technical knowledge captured in previous AI conversations. Use the `insights` argument to surface workflow-coaching advisories from hook-generated data.
npx claudepluginhub s-gryt/memory-mason --plugin memory-masonOther plugins' skills for the same job