wiki-prune

wiki-prune is a skill for Claude Code from eliransu/digital-brain. It costs 124 tokens per session (1,939 once invoked), scanned C, original, MIT.

A weekly cleanup tool for an Obsidian wiki, a folder-based note-taking system. It moves daily folders older than seven days into weekly archive folders while keeping recent notes in place.

In plain words
What is it for?
Previewing and archiving old YYYY-MM-DD wiki folders, warning when summaries have not been created, and optionally deleting archive entries older than 30 days with an explicit flag.
Why use it?
It prevents the live daily-notes folder from growing indefinitely. Dry-run mode shows proposed changes first, and archiving keeps moved folders recoverable.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the digital-brain plugin — 18 skills, 5 commands, 2 agents, 3 hooks shipped together

Good fit Previewing and archiving old YYYY-MM-DD wiki folders, warning when summaries have not been created, and optionally deleting archive entries older than 30 days with an explicit flag.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eliransu/digital-brain/wiki-prune
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add eliransu/digital-brain --skill wiki-prune
Clone the repo
git clone --depth 1 https://github.com/eliransu/digital-brain

Made for: Claude Code.

Or install digital-brain, the plugin that ships this one along with the rest of its 18 skills, 5 commands, 2 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wiki-prune

README.md
[![agentmods](https://agentmods.dev/badge/skills/eliransu/digital-brain/wiki-prune/github.svg)](https://agentmods.dev/skills/eliransu/digital-brain/wiki-prune)
Your own site
<a href="https://agentmods.dev/skills/eliransu/digital-brain/wiki-prune"><img src="https://agentmods.dev/badge/skills/eliransu/digital-brain/wiki-prune/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wiki-prune

Your own site · 80×15
<a href="https://agentmods.dev/skills/eliransu/digital-brain/wiki-prune"><img src="https://agentmods.dev/badge/skills/eliransu/digital-brain/wiki-prune.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,939 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00124 $0.01939
Opus 5 $0.00062 $0.00970
Sonnet 5 $0.00025 $0.00388
Haiku 4.5 $0.00012 $0.00194

Measured 8d ago against content hash c0fbcaab0afc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

wiki-prune scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- On `y`, `rm -rf` them. On anything else, abort.
skills/wiki-prune/SKILL.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

wiki-prune: Weekly Daily-Folder Janitor

/digital-brain:sync writes a folder per day under wiki/daily/. Left alone, those pile up forever and /sup slows down. wiki-prune is the janitor: every Monday it archives folders older than 7 days into a per-ISO-week directory under wiki/.archive/, so the live wiki/daily/ directory only ever holds the current week.

Rules of engagement:

  • Dry run by default. Print what would happen. Move nothing until --commit.
  • Archive, don't delete. Move folders into wiki/.archive/YYYY-WW/, preserving structure. Originals stay recoverable via mv back.
  • Hard delete only on explicit opt-in. With --hard, delete archive entries older than 30 days from the archive root. Use sparingly.
  • Fold before prune (recommended). If wiki-fold hasn't run in the last 7 days, warn before pruning so context isn't lost.
  • Never touch the live week. Anything dated within the last retention days stays in place.
  • Skip non-date folders. Only YYYY-MM-DD/ entries are candidates. _config.json and anything else is left alone.

Inputs / flags

Flag Effect
(none) Dry run. List candidates, suggest next run. No filesystem changes.
--commit Move matching folders into wiki/.archive/YYYY-WW/.
--hard After archiving, delete archive entries older than 30 days. Requires Y/N in chat.
--retention=N Override the 7-day window. Rare — default is 7.
--skip-fold-check Don't warn about stale wiki-fold.

Workflow

  1. Compute cutoff. today = date +%Y-%m-%d (local time). cutoff = today - retention (default 7 days). Anything strictly older than the cutoff is a candidate.

Read the full file on GitHub · 160 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 160 lines · 124 tokens per session scan C c0fbcaab0afc

Subscribe to this mod's changes

wiki-prune is a skill published in the GitHub repository eliransu/digital-brain (1 stars, last pushed 3mo ago), licensed MIT. It adds 124 tokens to every session and 1,939 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

obsidian-cli

Obsidian vault integration via official CLI. Use when: capturing dev artifacts to Obsidian vault, searching vault for context, appending to daily note, managing tasks in vault. Not for: general note-taking without Obsidian (use regular files), browsing Obsidian docs (use agent-browser). Output: vault search results…

sd0xdev/sd0x-harness · 78 tokens

llm-wiki

Build and maintain an LLM-curated personal knowledge base — the "LLM Wiki" pattern from Andrej Karpathy's April 2026 gist. Use this skill whenever the user wants to ingest a source (paper, article, transcript, PDF, notes) into a persistent compounding knowledge base, ask a question against accumulated notes, lint or…

praneybehl/llm-wiki-plugin · 221 tokens

anyr

Use when reading, searching, creating, or updating Anytype documents (objects, spaces, types, properties, files, chats) from the command line with the configured anyr CLI, including JSON output patterns for scripting.

stevelr/anytype · 46 tokens

lov-kb-organize

A knowledge-base maintenance tool that checks documents, images, indexes, and internal links. It can find duplicates and organize files without automatically merging uncertain matches.

lovstudio/skills · 42 tokens

migrate

Scan the project and migrate existing documentation into OKF format. Use when the user wants to populate the knowledge base from existing docs, README, schemas, API specs, runbooks, or any structured project knowledge. Trigger on "migrate to okf", "populate the knowledge base", "scan my docs", "convert docs to okf"…

guhcostan/claude-mega-brain · 147 tokens

reduce

Extract structured knowledge from source material. Comprehensive extraction is the default — every insight that serves the domain gets extracted. For domain-relevant sources, skip rate must be below 10%. Zero extraction from a domain-relevant source is a BUG. Triggers on "/reduce", "/reduce [file]", "extract…

agenticnotetaking/arscontexta · 73 tokens