Works with the AI Agents you already use

    Memory Janitor

    by Scrimal

    1

    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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Memory Janitor

    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

    CommandStatusResult
    auditPASS (exit 0)0 broken links, 0 orphaned nodes, all YAML schemas & section caps valid.
    crosslinkUPDATED14 new bidirectional semantic links wired via high-signal anchor overlap.
    indexSUCCESSRebuilt reverse_index.json (624 nodes indexed; 598 skipped via cache.json).
    anchorsPASS128 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

    1. Wire python scripts/memory_janitor.py audit into your pre-commit hook or CI so broken links or oversized summaries fail fast (exit 2).
    2. Run crosslink --apply weekly 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 (0 clean, 1 warnings, 2 errors) so you can gate knowledge-base quality automatically before every commit.

    What's Inside

    1. scripts/memory_janitor.py — Standalone zero-dependency CLI (index, crosslink, anchors, audit) with incremental caching and dry-run/apply modes.
    2. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    nodes/**
    raw/**
    scripts/**
    references/**

    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.

    Listed4 days ago
    Updated2 days ago

    What's inside

    Frequently Asked Questions

    The Memory Janitor prevents 'graph drift'—the accumulation of dead links, broken YAML, and duplicate tags that degrade RAG performance—by using deterministic Python logic instead of expensive LLM tokens.

    The tool is built on Python 3 using only the standard library, making it compatible with any AI agent environment or CI/CD pipeline that supports Python, including local setups and cloud instances.

    No, this is a zero-dependency script that processes Markdown files and YAML frontmatter directly, meaning you don't need to install external libraries like 'spine_memory' or heavy NLP packages.

    You receive SKILL.md (the vault hygiene workflow), scripts/memory_janitor.py (a standalone zero-dependency CLI supporting index, crosslink, anchors, and audit with incremental caching and exit codes 0/1/2), and references/node_schema.md (the validated YAML + section schema specification).

    Because it uses deterministic logic based on anchor overlaps and constellation matching, it runs locally on your files without making any API calls to OpenAI or other providers.

    The script requires your knowledge base to be stored as Markdown files with YAML frontmatter; it cannot audit unstructured text files or proprietary database formats without conversion.

    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.