Skip to content

A self-organizing Obsidian vault that gives AI coding agents persistent memory.

feat: om-tidy + hygiene-aware commands and agents (the acting half) (#127)

Brenno Ferraric98f6d22a44d
diff --git a/.claude/agents/cross-linker.md b/.claude/agents/cross-linker.md
index 3962246..7b86711 100644
--- a/.claude/agents/cross-linker.md
+++ b/.claude/agents/cross-linker.md
@@ -26,7 +26,7 @@ Glob all linkable notes and build a lookup:
- `org/people/*.md` — every person name (including aliases from frontmatter)
- `org/teams/*.md` — every team name
- `perf/competencies/*.md` — every competency name
-- `work/active/*.md`, `work/archive/**/*.md` — every project name
+- `work/active/**/*.md`, `work/archive/**/*.md` — every project name (recursive: grouped workstreams live in `active/<Topic>/` subfolders)
- `work/incidents/*.md` — every incident name
### 2. Scan for Missing Links
diff --git a/.claude/commands/om-prep-1on1.md b/.claude/commands/om-prep-1on1.md
index b403e67..ba97e1b 100644
--- a/.claude/commands/om-prep-1on1.md
+++ b/.claude/commands/om-prep-1on1.md
@@ -23,7 +23,9 @@ Example: `/om-prep-1on1 Scott Detweiler`
- Topics that recurred across sessions
- Anything flagged in "What to Watch"
-3. **Load active work** — read `work/Index.md` and relevant `work/active/*.md` notes; identify:
+2b. **Carry-forward check** — open the person's last THREE 1:1 notes and diff their Action Items: any unchecked item appearing (same or near-same wording) in **two or more consecutive notes is a chronic loop**, not just an open one. List these separately with their first-seen date — "carried 3× since <date>" is the prep signal a single note can never show. (The hooks' open-loops flag only reads the latest note; this step is where the chronic pattern surfaces.)
+
+3. **Load active work** — read `work/Index.md` and relevant `work/active/**/*.md` notes (recursive — grouped workstreams live in `active/<Topic>/` subfolders); identify:
- Projects this person is connected to (via wikilinks or shared team)
- Blockers or open questions that need a decision or support
- Work in progress worth giving visibility to
@@ -40,6 +42,7 @@ Example: `/om-prep-1on1 Scott Detweiler`
- **Who** — one-line reminder: role, relationship, standing dynamics
- **Since Last Time** — unresolved action items, open "What to Watch" signals
+ - **Chronic Loops** — items carried across 2+ consecutive 1:1s (from step 2b), oldest first; each one is either blocked (raise it), obsolete (kill it), or under-prioritized (say so)
- **Wins to Share** — completed work and milestones worth mentioning, with enough context to explain impact
- **Things to Raise** — blockers needing a decision, projects needing visibility, North Star drift
- **Questions to Ask** — based on vault gaps or unclear priorities
diff --git a/.claude/commands/om-project-archive.md b/.claude/commands/om-project-archive.md
index c84c563..3378895 100644
--- a/.claude/commands/om-project-archive.md
+++ b/.claude/commands/om-project-archive.md
@@ -28,6 +28,14 @@ git mv "work/active/<Note>.md" "work/archive/YYYY/"
Use the year from the note's `date` field.
+**Clustered workstreams**: when the project lives in a topic folder (`work/active/<Topic>/` — the grouping convention for >1-note workstreams), move the WHOLE folder and keep the grouping:
+
+```bash
+git mv "work/active/<Topic>" "work/archive/YYYY/<Topic>"
+```
+
+Every note inside keeps its cluster context, and wikilinks resolve by basename so nothing breaks.
+
### 4. Update Indexes
- **`work/Index.md`**: Move from Active Projects to the appropriate Completed quarter section
diff --git a/.claude/commands/om-standup.md b/.claude/commands/om-standup.md
index f226d27..90202f7 100644
--- a/.claude/commands/om-standup.md
+++ b/.claude/commands/om-standup.md
@@ -2,21 +2,23 @@
description: "Morning kickoff. Load today's context, review yesterday, surface open tasks, and identify priorities."
---
-Run the morning standup:
+Run the morning standup.
-1. Read `Home.md` for current dashboard state
-2. Read `brain/North Star.md` for current goals
-3. Check `work/Index.md` for active projects
-4. Read yesterday's and today's daily notes if they exist: `obsidian daily:read`
-5. List open tasks: `obsidian tasks daily todo`
-6. Check recent git activity: `git log --oneline --since="24 hours ago" --no-merges`
-7. Check for any unlinked notes or inbox items needing processing
+**Start from the SessionStart injection — do NOT re-read what it already carries.** The hook has already injected: the North Star excerpt, active work, recent git changes, open tasks, hygiene flags (incl. open loops), and the file listing. Re-reading `Home.md`, `brain/North Star.md`, or re-running `git log` doubles the token cost for zero new information.
+
+Gather only what the injection does NOT have:
+
+1. Read yesterday's and today's daily notes if they exist: `obsidian daily:read`
+2. List Obsidian-tracked tasks: `obsidian tasks daily todo` (the injected Open Tasks section covers checkbox tasks in active notes and the vault root — this adds daily-note tasks)
+3. Read `work/Index.md` ONLY if the injected active-work list needs status detail the summary will actually use
+4. Check for unprocessed inbox items (`work/meetings/` raw exports — the hygiene flags name them when they age)
Present a structured standup summary:
-- **Yesterday**: What got done (from git log and daily note)
+- **Yesterday**: What got done (from the injected Recent Changes + daily note)
- **Active Work**: Current projects in work/active/ with their status
- **Open Tasks**: Pending items
+- **Open Loops**: stale follow-ups from the injected hygiene flags — anything to chase today?
- **North Star Alignment**: How active work maps to current goals
-- **Suggested Focus**: What to prioritize today based on goals + open items
+- **Suggested Focus**: What to prioritize today based on goals + open items — act on injected hygiene flags here
Keep it concise. This is a quick orientation, not a deep dive.
diff --git a/.claude/commands/om-tidy.md b/.claude/commands/om-tidy.md
new file mode 100644
index 0000000..b210405
--- /dev/null
+++ b/.claude/commands/om-tidy.md
@@ -0,0 +1,38 @@
+---
+description: "Self-maintenance pass — acts on every hygiene flag: archives completed work, groups loose clusters, splits oversized notes, reports stale open loops, fixes links. Safe by construction: never deletes, never commits, zero content loss."
+---
+
+# /om-tidy
+
+The acting half of the hygiene system. The SessionStart/Stop hooks and the PostToolUse write-time flags DETECT drift; this command ACTS on it. Run on demand, at wrap-up when flags are present, or when the flag list has visibly piled up.
+
+## Hard rails (safe by construction)
+
+- **Never delete.** Reorganization is `git mv` + splits with verbatim content moves. Zero content loss.
+- **Never commit.** Git sync stays the user's call — leave the working tree for review.
+- **Judgment calls get flagged, not executed.** Anything ambiguous (does this cluster share real context? is this note's status actually done?) is listed for the user instead of acted on.
+
+## The mechanical tier (act on these)
+
+Work through the current hygiene flags in order:
+
+1. **Completed-not-archived** — `git mv` from `work/active/` to `work/archive/YYYY/`; clusters keep their folder (mirror the grouping); update `work/Index.md`. Same semantics as `/om-project-archive` — use it for anything with ceremony.
+2. **Ungrouped clusters** — when the loose notes genuinely share context (judge, don't trust token overlap): create `work/active/<Topic>/`, `git mv` the members in.
+3. **Oversized notes (25KB+)** — SPLIT, never trim: move whole sections verbatim into domain notes, event-log satellites, or an archive note; leave a one-liner index behind in the original; retarget links that pointed at the moved sections. `*Archive*` names are exempt by design. A split is complete only when the new notes are wired into the graph — search each new note's concepts (QMD when available) and link what surfaces.
+4. **Index drift, orphans, broken links** — new notes must be linked from at least one note; fix wikilinks broken by any moves this pass made; update `work/Index.md` / `org/People & Context.md` / `perf/Brag Doc.md` as touched.
+5. **Semantic-linking pass** — for notes created or split this pass, `qmd query` their core concepts (index name from `vault-manifest.json`) and add the links the graph is missing.
+
+## The report tier (list, never act)
+
+- **Open loops** — the stale follow-up flags from the hygiene scan. Chasing, closing, or parking a follow-up is the user's judgment; list them with paths + counts and move on.
+- **Competency evidence freshness** — for each `perf/competencies/*.md`, count inbound links from notes modified this half (grep/QMD backlinks + mtime). Competencies with ZERO fresh evidence this half get listed — months of lead time to generate the missing evidence beats discovering thinness at review season. Report only; what counts as evidence is review judgment.
+- Any judgment calls deferred from the mechanical tier.
+
+## Report
+
+Write `thinking/YYYY-MM-DD-tidy-report.md`: actions taken (moves, splits, links), flags cleared, judgment calls deferred, open loops listed. Keep it compact — the report is a receipt, not an essay. Delete it once its findings are resolved (thinking/ is a scratchpad by contract).
+
+## Related
+
+- `/om-weekly` § hygiene sweep — the scheduled home of this pass
+- `/om-project-archive` · `/om-vault-audit` (deep audit, agent-backed)
diff --git a/.claude/commands/om-weekly.md b/.claude/commands/om-weekly.md
index 3400b6c..30c1cd7 100644
--- a/.claude/commands/om-weekly.md
+++ b/.claude/commands/om-weekly.md
@@ -55,14 +55,18 @@ For each competency in `perf/competencies/`:
Present as a compact table: competency name, exercised (yes/no), linked (yes/no).
-### 6. Forward Look
+### 6. Hygiene Sweep
+
+Act on the current vault-hygiene flags (the SessionStart/Stop scan): archive completed-not-archived notes, group genuine clusters, split oversized notes, and list stale open loops for the user to chase or park. This is `/om-tidy`'s mechanical tier on a schedule — invoke `/om-tidy` directly for the full pass with its report.
+
+### 7. Forward Look
- Blocked items or upcoming deadlines from active work notes
- North Star goals that need attention next week
- Scheduled 1:1s or meetings worth preparing for
- Suggested priority ordering for next week based on goals + momentum + gaps
-### 7. Present Synthesis
+### 8. Present Synthesis
Structure the output as:
diff --git a/CLAUDE.md b/CLAUDE.md
index 5c6a351..3724934 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -97,7 +97,7 @@ obsidian orphans # Unlinked notes
### Starting a Substantial Session
-The `SessionStart` hook automatically injects rich context: vault file listing, North Star goals, active work, recent git changes, open tasks (aggregated from `work/active/` and the vault root, excluding infrastructure files), and triggers a QMD re-index. Most context is already loaded -- you don't need to manually read files.
+The `SessionStart` hook automatically injects rich context: vault file listing, North Star goals, active work, recent git changes, open tasks (aggregated from `work/active/` and the vault root, excluding infrastructure files), vault-hygiene drift flags (act on them or run `/om-tidy`), and triggers a QMD re-index. Most context is already loaded -- you don't need to manually read files.
**Shortcut**: Run `/om-standup` for a structured morning kickoff that reads everything and presents a summary with suggested priorities.
@@ -337,11 +337,11 @@ Five lifecycle hooks in `.claude/settings.json`:
| Hook | When | What |
|------|------|------|
-| SessionStart | On startup/resume | QMD re-index, inject North Star, active work, recent changes, tasks, file listing |
+| SessionStart | On startup/resume | QMD re-index + self-heal, inject North Star, active work, recent changes, tasks, file listing, vault-hygiene drift flags (completed-not-archived, ungrouped clusters, 25KB oversize, stale open loops, meetings-inbox pressure); ends with an injection-size meter line |
| UserPromptSubmit | Every message | Classifies content (decision, incident, win, 1:1, architecture, person, project update) and injects routing hints |
-| PostToolUse | After writing `.md` | Validates frontmatter, checks for wikilinks |
+| PostToolUse | After writing `.md` | Validates frontmatter + wikilinks, blocks misplaced memory files, flags notes crossing the 25KB organization threshold (split, don't trim) and write-time topic clusters |
| PreCompact | Before context compaction | Backs up session transcript to `thinking/session-logs/` |
-| Stop | End of every session | Lightweight checklist reminder: archive, update indexes, check orphans. For thorough review, use `/om-wrap-up` instead. |
+| Stop | End of every session | Lightweight checklist reminder + concrete vault-hygiene drift findings (same scan as SessionStart). For thorough review, use `/om-wrap-up` instead. |
## Rules