Works with the AI Agents you already use
Memory Janitor
by Scrimal
Keep your Markdown / Obsidian agent memory from rotting: single-file zero-dependency CLI that indexes, auto-crosslinks, normalizes tags, and audits 600+ nodes in under a second at zero token cost.
$9.99
Memory Janitor
Example session with this skill installed
Run a full health audit and index rebuild on my memory graph in the 'docs/nodes' folder, then save the index to the root directory.
- Read your context and instructions
- Compiled the memory janitor
I ran the full maintenance suite on your docs/nodes graph. The Janitor audited every node, wired 14 new semantic cross-links, and rebuilt the incremental index in 0.18s.
Memory Janitor Execution Report
| Command | Status | Result |
|---|---|---|
audit | PASS (exit 0) | 0 broken links, 0 orphaned nodes, all YAML schemas & section caps valid. |
crosslink | UPDATED | 14 new bidirectional semantic links wired via high-signal anchor overlap. |
index | SUCCESS | Rebuilt reverse_index.json (624 nodes indexed; 598 skipped via cache.json). |
anchors | PASS | 128 canonical anchors validated; 0 fuzzy duplicates found. |
$ python scripts/memory_janitor.py audit --nodes docs/nodes
AUDIT | nodes: 624 | errors: 0 | warnings: 0 | exit 0
// reverse_index.json (partial)
{
"forward": { "NODE_001": ["NODE_005", "NODE_012"] },
"reverse": { "NODE_005": ["NODE_001"] },
"code_index": { "src/auth/jwt.py": ["NODE_001", "PM_004"] }
}
Next Steps
- Wire
python scripts/memory_janitor.py auditinto your pre-commit hook or CI so broken links or oversized summaries fail fast (exit 2). - Run
crosslink --applyweekly as new notes accumulate to keep related architecture decisions connected.
Connects securely to your tools. The creator never sees your data.
About this skill
Markdown and Obsidian memory vaults decay fast: orphaned notes, broken [[wikilinks]], duplicate tags (auth_fix vs auth-fix), and bloated summaries silently poison your agent's recall until it starts hallucinating or missing critical context.
Memory Janitor is a drop-in, single-file maintenance engine (scripts/memory_janitor.py) that rebuilds your entire graph index, discovers missing cross-links, enforces canonical tags, and audits structural integrity in under a second—at zero LLM token cost, without requiring the full spine-memory package.
Why It Beats Manual Cleanup & LLM Refactoring
- All-in-One Maintenance CLI (
600 lines, pure stdlib): Rebuilds reverse link/anchor/code indexes (index), auto-wires safe bidirectional links (crosslink), catches tag drift (anchors), and audits node health (audit) in one pass. - Incremental
cache.json+ Atomic Writes: Skips unchanged files via(mtime_ns, size, sha256)and writes both indexes and Markdown updates atomically (tmp + os.replace) so your vault never corrupts mid-run. - Battle-Tested on 600+ Live Nodes: Handles edge cases that break naive scripts—nested subdirectories,
---delimiters inside raw log blocks,[[wikilinks]]inside YAML arrays, and Windows/Linux UTF-8 output. - CI & Pre-Commit Ready Exit Codes: Returns deterministic exit codes (
0clean,1warnings,2errors) so you can gate knowledge-base quality automatically before every commit.
What's Inside
scripts/memory_janitor.py— Standalone zero-dependency CLI (index,crosslink,anchors,audit) with incremental caching and dry-run/apply modes.references/node_schema.md— Validated Markdown + YAML node specification (adr,postmortem,gotcha,contract,dead_end) and section caps.
Requires Markdown files with YAML frontmatter; unstructured plain-text notes without frontmatter keys are skipped during indexing and audit.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python 3.10+
Zero external dependencies or network requests. Runs locally on any Markdown/YAML folder with incremental caching and atomic file writes.
Permissions
File Scopes
Read Files scans Markdown nodes; Write Files updates reverse_index.json, cache.json, and inserts cross-links when --apply is passed; Terminal / Shell runs memory_janitor.py locally.
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.