# vault-optimizer

A Claude subagent that tunes Obsidian vault performance: finds oversized files, sorts out attachments and speeds up search.

- subagent · `type=agent` · Claude Code · 727 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/vault-optimizer.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/vault-optimizer

## What it does

vault-optimizer is a Claude subagent built for Obsidian vault performance. It watches load times and search response, flags markdown files over 1MB, breaks storage usage down by content type, and tells you what to do about it.

Five areas are covered: performance analysis, file size optimization, attachment handling, search indexing, and storage cleanup. The agent compresses images and PDFs, removes orphaned attachments, consolidates duplicates, archives old notes and templates. It runs `find` against the vault, so point it at the right path. The report includes a storage breakdown, the bottlenecks it found, and before/after metrics.

Back up first. The agent writes and moves files, and moving them is how note links break. It also carries target numbers: markdown capped at 1MB, JPEGs compressed to 85% quality, archiving for files older than 2 years. The age threshold is configurable; treat the rest as guidance rather than a hard rule. Its toolset is `Read`, `Write`, `Bash`, `Glob`, `LS`.

## Requirements
- Works with: Obsidian

## Install

### Claude Code (native platform)

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

2. **Manually: put the files in place**
- File: `.claude/agents/vault-optimizer.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/vault-optimizer.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/vault-optimizer.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/vault-optimizer.md

## When to use it
- find markdown files over 1MB that slow the vault down
- compress heavy images and PDFs without wrecking readability
- clear out orphaned attachments and duplicate notes
- sort attachments into folders instead of one dumping ground
- compare metrics before and after optimization

## Example prompts
- analyze my Obsidian vault performance and show me what's slowing it down
- find files over 1MB in the vault and suggest what to compress
- clean up orphaned attachments, but back up first

## Similar
- [vault-skill-factory](https://affpapa.org/en/nevibecode/skills/vault-skill-factory.md) — skill · 719 installs
- [wiki-query](https://affpapa.org/en/nevibecode/skills/wiki-query.md) — skill · 3600 installs
- [obsidian-canvas-creator](https://affpapa.org/en/nevibecode/skills/obsidian-canvas-creator.md) — skill · 2000 installs
- [obsidian-markdown](https://affpapa.org/en/nevibecode/skills/agricidaniel-obsidian-markdown.md) — skill · 545 installs
- [wiki](https://affpapa.org/en/nevibecode/skills/agricidaniel-wiki.md) — skill · 539 installs
- [second-brain](https://affpapa.org/en/nevibecode/skills/coreyhaines31-second-brain.md) — skill · 355 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 224 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
