warren
Runs coding agents on compute you control, handling isolation, recovery, spend and Git delivery so you don't manage terminal sessions by hand. Also files and dispatches GitHub issues from a backlog.
jayminwest/mulch is a plugin for structured expertise management in AI agent workflows, so agents keep what they learn between sessions. Agents write learnings with ml record and read them back with ml query, which suits agent-memory work.
$ bun install -g @os-eco/mulch-cli
Structured expertise management for AI agent workflows.
Agents start every session from zero. The pattern your agent discovered yesterday is forgotten today. Mulch fixes this: agents call ml record to write learnings, and ml query to read them. Expertise compounds across sessions, domains, and teammates.
Mulch is a passive layer. It does not contain an LLM. Agents use Mulch — Mulch does not use agents.
bun install -g @os-eco/mulch-cli
Or try without installing:
npx @os-eco/mulch-cli --help
git clone https://github.com/jayminwest/mulch
cd mulch
bun install
bun link # Makes 'ml' available globally
bun test # Run all tests
bun run lint # Biome check
bun run typecheck # tsc --noEmit
ml init # Create .mulch/ in your project
ml add database # Add a domain
ml record database --type convention "Use WAL mode for SQLite"
ml record database --type failure \
--description "VACUUM inside a transaction causes silent corruption" \
--resolution "Always run VACUUM outside transaction boundaries"
ml query database # See accumulated expertise
ml prime # Record index for agent injection (one line per record)
ml show mx-abc123 # Full body of one record from the index
ml prime database # Index for one domain only
ml prime --files src/foo.ts # Prime only records relevant to specific files
ml prime --files src/foo.ts --budget 500 --records-only # Editor-hook shape: record lines only
ml prime --manifest # Per-domain counts instead of records
ml prime --full --all # Full record bodies, skip auto-context-scope
ml prime emits an index by default: one line per record (id, type, summary truncated to ~100 chars, file/dir anchors, ★ confirmations), grouped by domain, failures first, then by confirmations and recency. The --budget <tokens> cap (default 4000, estimated as chars/4) drops the lowest-ranked lines first; with --files / --context, failures anchored to those paths are always kept and other anchored records rank ahead of unanchored ones. Records named in a live record's supersedes are hidden (ml show <id> still reaches them). Stale records (see ml stale) rank last within their tier and are marked (stale?). --full restores full record bodies; --records-only drops the project contract, quick reference, and session-close footer for hook injection. prime.default_mode: manifest in .mulch/mulch.config.yaml still switches the unscoped default to a per-domain count table.
In full mode, ml prime auto-context-scopes to the agent's working set by default: git status for changed/untracked files, plus the active-work resolver chain (current branch, in-progress seeds, current GH PR, branch-parsed linear/bead IDs) matched against each record's evidence.{seeds,gh,linear,bead}. Universal records (no files / dir_anchors / tracker-anchored evidence) are always emitted. The stderr line prime: scoped to N of M records based on …; run with --all for the full corpus reports the scoping ratio so the agent sees what got dropped. Pass --all to opt out and emit the full corpus; pass an explicit --files, positional domain, --domain, or --context to scope on different signals. Auto-scope is skipped under --json (machine consumers expect deterministic output) and outside a git repo.
Every command supports --json for structured output. Global flags: -v/--version, -q/--quiet, --verbose, --timing. ANSI colors respect NO_COLOR.
| Command | Description |
|---|---|
ml init | Initialize .mulch/ in the current project |
ml add <domain> | Add a new expertise domain |
ml record <domain> --type <type> | Record an expertise record (--tags, --force, --relates-to, --supersedes, --batch, --stdin, --dry-run, --evidence-bead) |
ml edit <domain> <id> | Edit an existing record by ID or 1-based index |
ml delete <domain> [id] | Delete records by ID, --records <ids>, or --all-except <ids> (--dry-run) |
ml delete-domain <domain> | Remove a domain from config and delete its expertise JSONL file (--yes, --dry-run) |
ml move <domain> <id> <target> | Transfer a record to another domain, preserving ID and cross-references (--force, --dry-run) |
ml query [domain] | Query expertise (--all, --classification, --file, --outcome-status, --sort-by-score, --format filters) |
ml prime [domains...] | Output AI-optimized expertise context (--manifest, --full, --all, --budget, --no-limit, --context, --files, --exclude-domain, --export, --dry-run, --records-only) |
ml show <ids...> | Print full record bodies by ID across all domains (--json) |
ml stale [domains...] | List records that look stale: anchors changed in 5+ commits since the evidence commit, missing anchors, or past shelf life with no confirmations (--json) |
ml search [query] | Search records across domains with BM25 ranking (--domain, --type, --tag, --classification, --file, --sort-by-score, --no-boost, --format) |
ml rank [domain] | Rank records by confirmation-frequency score, highest first (--type, --limit, --min-score, --json) — pure score ranking with no text query, useful for context-constrained consumers |
ml compact [domain] | Analyze compaction candidates or apply a compaction (--analyze, --auto, --apply, --dry-run, --min-group, --max-records) |
ml diff [ref] | Show expertise changes between git refs (ml diff HEAD~3, ml diff main..feature) |
ml config <subcommand> | Inspect and edit .mulch/mulch.config.yaml (schema, show [--path <p>], set <path> <value>, unset <path>) — atomic, schema-validated writes for warren and other config-UI consumers |
ml status | Show expertise freshness and counts (--json for health metrics; flags rotting domains where the newest record exceeds the observational shelf life) |
ml audit | Audit corpus health — floater rate, per-tracker evidence coverage (seeds/gh/linear/bead), convention rule-density, per-domain mix, tracker-citation status (--ci, --suggest, --domain, --ignore-domains) |
ml validate | Schema validation across all files |
ml doctor | Run health checks on expertise records (--fix to auto-fix) |
ml setup [provider] | Install provider-specific hooks (built-ins: claude, cursor, codex — or any name discovered via .mulch/recipes/ or mulch-recipe-*; --list shows everything) |
ml hook | Claude Code PreToolUse handler installed by ml setup claude (reads hook JSON on stdin) |
ml onboard | Generate AGENTS.md/CLAUDE.md snippet |
ml prune | Soft-archive stale tactical/observational records to .mulch/archive/, plus tier-demote records superseded by another live record (--hard for true delete, --aggressive to collapse superseded records straight to archive, --dry-run) |
ml archive <domain> [id] | Soft-archive a specific record without waiting for ml prune (--records for bulk, --reason required, --dry-run) — symmetric to ml restore |
ml restore <id> | Restore a soft-archived record back to live expertise |
ml ready | Show recently added or updated records (--since, --domain, --limit) |
ml sync | Validate, stage, and commit .mulch/ changes |
ml outcome <domain> <id> | Append an outcome to a record (--status, --duration, --agent, --notes), or view outcomes |
ml upgrade | Upgrade mulch to the latest version (--check for dry run) |
ml learn | Show changed files and suggest domains for recording learnings |
ml completions <shell> | Output shell completion script (bash, zsh, fish) |
All record-rendering commands (ml prime, ml query, ml search) accept a global --format <markdown|compact|xml|plain> flag that selects the output formatter. xml is Claude-optimized; plain is the spawn-injection contract — clean structured prose (per-domain sections, bulleted records, no decorative title, no Session Close trailer) suitable for concatenation into another tool's system prompt; compact emits the one-line-per-record index (default for ml prime); markdown emits the full, sectioned layout. Per-command --format flags (e.g. ml query --format ids) take precedence over the global flag.
ml --format xml prime testing # XML expertise tree (Claude-friendly)
ml --format plain prime testing # plain text for system-prompt injection
ml --format compact query testing # compact one-liners
ml prime --full # alias for --format markdown
ml prime --compact # alias for --format compact
--dry-run)ml prime --dry-run emits a JSON summary of which records would be primed (id, type, domain, per-record token estimate) and how the result fits within --budget, without rendering record content. Useful for editor previews and orchestrators that want to show "would prime: N records, K tokens" before actually shelling out for the full output. Composes with --domain, --files, --budget, --no-limit, --exclude-domain. pre-prime hooks are skipped (preview must not trigger Slack posts or digest-then-confirm confirmations). When combined with --format plain the format is ignored and JSON is returned.
ml prime --dry-run # preview default prime
ml prime --dry-run --domain cli --budget 8000 # scoped preview against a specific budget
ml prime --dry-run --files src/foo.ts # what would prime --files emit?
{
"wouldPrime": [
{ "id": "mx-94901b", "type": "convention", "domain": "cli", "tokens": 240 }
],
"totalTokens": 240,
"budgetUsed": 0.03,
"budgetTotal": 8000
}
budgetUsed and budgetTotal are null when invoked with --no-limit.
Mulch stores expertise as typed JSONL records in .mulch/expertise/<domain>.jsonl — one file per domain, one record per line. Six record types (convention, pattern, failure, decision, reference, guide) with three classification tiers (foundational, tactical, observational) govern shelf life and pruning. Advisory file locks and atomic writes ensure safe concurrent access from multiple agents. Schema validation (via Ajv) enforces type-specific required fields. See CLAUDE.md for full technical details.
1. ml init → Creates .mulch/ with domain JSONL files
2. Agent reads expertise → Grounded in everything the project has learned
3. Agent does work → Normal task execution
4. Agent records insights → Before finishing, writes learnings back to .mulch/
5. git push → Teammates' agents get smarter too
The critical insight: step 4 is agent-driven. Before completing a task, the agent reviews its work for insights worth preserving and calls ml record. Mulch provides the schema and file structure so those learnings land in a consistent, queryable format.
.mulch/Runs coding agents on compute you control, handling isolation, recovery, spend and Git delivery so you don't manage terminal sessions by hand. Also files and dispatches GitHub issues from a backlog.
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Gives Claude Code long-term memory through Hindsight. It recalls relevant past context before answering, retains durable facts as the agent learns them, and reflects over stored memory.
Local-first memory for Claude Code. It stores conversations verbatim in a private palace you can search before answering about past work, people, projects, or decisions, with optional shared-brain hub setup.
Gives Claude Code a private memory that stays on your machine. It stores past conversations word for word, so you can ask what was decided, what happened before, or who was involved and get the original context back. It can also hand tasks to other agents.
Install it with the command on its page. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it