clean

clean is a command for coding agents from Michael-OvO/obsidian-knowledge-agent. It costs 18 tokens per session (234 once invoked), scanned A, original, MIT.

A command for tidying a notes vault and synchronising its changes with Git, a tool that records file history. It reviews changes, commits note updates, asks before clearing processed Inbox items, and pushes when a remote is available.

In plain words
What is it for?
Reviewing vault changes, committing notes, separating learned-state changes, clearing processed Inbox material with approval, and pushing commits to a Git remote.
Why use it?
It gathers routine cleanup and version-control work into one controlled process while protecting configuration files and unapproved deletions.

Command

Part of the obsidian-knowledge plugin — 1 skill, 12 commands, 2 hooks shipped together

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.

agentmods
npx agentmods add commands/michael-ovo/obsidian-knowledge-agent/clean
Clone the repo
git clone --depth 1 https://github.com/Michael-OvO/obsidian-knowledge-agent

Or install obsidian-knowledge, the plugin that ships this one along with the rest of its 1 skill, 12 commands, 2 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 clean

README.md
[![agentmods](https://agentmods.dev/badge/commands/michael-ovo/obsidian-knowledge-agent/clean.svg)](https://agentmods.dev/commands/michael-ovo/obsidian-knowledge-agent/clean)
Your own site
<a href="https://agentmods.dev/commands/michael-ovo/obsidian-knowledge-agent/clean"><img src="https://agentmods.dev/badge/commands/michael-ovo/obsidian-knowledge-agent/clean.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 234 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00018 $0.00234
Opus 5 $0.00009 $0.00117
Sonnet 5 $0.00004 $0.00047
Haiku 4.5 $0.00002 $0.00023

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

Security

Grade A, and why

clean scanned grade A with 0 findings 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/obsidian-knowledge/commands/clean.md · 17 lines

What it actually says

Tidy up and sync the vault to git. Respect every boundary — never touch .obsidian/, never delete without approval.

  1. Survey. Run git --no-pager status and group the changes (new notes, edits, learned-state changes) into a short summary.
  2. Commit. Stage and commit the note changes with $ARGUMENTS as the message, or a clear inferred one (e.g. notes: add 3 ML notes, fix links). Keep any pending learned-rule changes as a separate chore(learn): commit — see /obsidian-knowledge:evolve.
  3. Inbox. If Inbox/ still holds material that has already been processed, offer to clear it (move, archive, or delete) — only with my explicit approval.
  4. Push if a remote exists and I haven't said otherwise. Report what was committed and pushed.
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. 5d ago First seen · 17 lines · 18 tokens per session scan A f86be9538a1c

Subscribe to this mod's changes

clean is a command published in the GitHub repository Michael-OvO/obsidian-knowledge-agent (207 stars, last pushed 2mo ago), licensed MIT. It adds 18 tokens to every session and 234 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.