r/opencodeCLI • • 5h ago

Built a local SQLite memory layer for OpenCode CLI (0 MB idle daemon, read_file packs, diff-locked rules)

Post image

When you run OpenCode CLI across multiple providers and repos, flat AGENTS.md files or Obsidian folders start breaking down fast: fixes from one repo bleed into unrelated sessions, models occasionally overwrite rules you already verified by hand, and MCP memory servers add constant schema overhead on every turn.

I built Slipdex (v0.4, MIT) on Node 22+ built-in node:sqlite (or Bun bun:sqlite) with zero external npm dependencies and no background daemon.

How it works inside an OpenCode CLI workflow:

  • slipdex init --no-mcp wires a compact SKILL.md and AGENTS.md pack index so OpenCode reads only the matching packs/<domain>.md via read_file with zero MCP tool clutter.
  • Even on a fresh session, a tiny startup radar gives OpenCode your active context and domain pointers without dumping a giant global markdown file, and slipdex recall pulls older slips on demand via FTS5 BM25.
  • Separate local SQLite WAL vaults isolate engineering, project:<slug>, gated on-demand vaults behind short-lived leases, an optional Identity Card, and an encrypted write-only journal.
  • Human-verified notes are diff-locked at the SQLite layer: agent edits open reviewable proposals with append-only history instead of silently mutating head.
  • On-demand local Studio (slipdex ui) gives you a draggable domain graph, token-budget preview, and 1-click import from existing AGENTS.md, CLAUDE.md, Obsidian vaults, and session logs, then shuts down cleanly when idle.

GitHub (MIT): https://github.com/phosphorhouse/slipdex Browser demo (sample data, no install): https://phosphorhouse.github.io/slipdex/demo/

Quick setup: npm install -g git+https://github.com/phosphorhouse/slipdex.git && slipdex init --no-mcp

9 Upvotes

2 comments sorted by

1

u/hieuphung97 3h ago

Diff-locking verified rules at the SQLite layer is the killer feature here. Agents constantly drop negative constraints when allowed direct markdown writes. Having append-only proposals instead of silent head mutations eliminates that entire regression class.

1

u/phosphorhouse 2h ago

Exactly that failure mode. Whenever an agent rewrites a markdown rules file, never do that, constraints quietly get softened or dropped during refactor. Enforcing the lock with sqlite triggers (plus flagging conflicts against pinned rules before write) made it impossible for a session to overwrite them without leaving a reviewable diff.

Next thing I want to add is auto injecting matching locked constraints mid session whenever a long chat drifts into another domain.