# moc-agent

A Claude subagent that builds and maintains maps of content (MOCs) in an Obsidian vault. Useful once notes pile up in folders with no navigation.

- subagent · `type=agent` · Claude Code · 666 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/obsidian-ops-team/moc-agent.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/moc-agent

## What it does

moc-agent handles navigation inside an Obsidian vault. It spots directories that hold plenty of notes but no map of content, generates a new MOC from a template, and wires it into the rest of the network. Stale maps get repaired too: missing note links are added, dead ones dropped, and topic areas that deserve their own MOC are flagged.

The hierarchy has three tiers, following the LYT system: a home MOC acting as the index, topic maps beneath it, and sub-MOCs for narrow subjects. Every map lives in `map-of-content/`, is named like `MOC - [Topic Name].md`, and carries `type: moc` in its frontmatter. The template ships with a Dataview block that pulls in tagged notes; drop that block if the Dataview plugin is not installed.

Auditing runs on Glob and Grep, so no external scripts are required. When a vault happens to contain `moc_generator.py`, the agent can invoke it from the vault root instead. Orphaned images are a separate job: PNG, JPG, GIF and SVG files with no incoming links get grouped into gallery notes by category and attached to `Visual_Assets_MOC`. Nothing is moved on disk. Before writing, the agent confirms that `map-of-content/` exists and adapts to whatever folder layout the vault actually uses.

## Requirements
- Works with: Obsidian

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --agent obsidian-ops-team/moc-agent
```

2. **Manually: put the files in place**
- File: `.claude/agents/moc-agent.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/moc-agent.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/moc-agent.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/obsidian-ops-team/moc-agent.md

## When to use it
- create a MOC for a folder full of unlinked notes
- refresh stale maps after a bulk note import
- find notes that no map links to
- group orphaned images into gallery notes
- keep the MOC network tied to a home index

## Example prompts
- My vault has a pile of new AI notes and no top-level MOC for them. Sort it out.
- There are screenshots and diagrams in the attachments folder that nothing links to. Build galleries for them.
- I imported notes from Notion and my MOCs are out of date. Diff them against the current file tree and fix them.

## Similar
- [llm-wiki](https://affpapa.org/en/nevibecode/skills/ar9av-llm-wiki.md) — skill · 4100 installs
- [wiki-ingest](https://affpapa.org/en/nevibecode/skills/wiki-ingest.md) — skill · 3600 installs
- [obsidian-kb-artifacts](https://affpapa.org/en/nevibecode/skills/obsidian-kb-artifacts.md) — skill · 319 installs
- [second-brain](https://affpapa.org/en/nevibecode/skills/second-brain.md) — skill · 2800 installs
- [wiki](https://affpapa.org/en/nevibecode/skills/agricidaniel-wiki.md) — skill · 539 installs
- [save](https://affpapa.org/en/nevibecode/skills/save.md) — skill · 511 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 495 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
