@rohirik/ltm-core
v2.1.1
Published
Shared LTM storage engine — path-agnostic SQLite core used by Claude Code, OpenCode, and Pi adapters
Maintainers
Readme
@rohirik/ltm-core
Shared LTM storage engine and CLI installer for Claude Code, OpenCode, and Pi.
Install
bunx @rohirik/ltm-core # auto-detect Claude Code, OpenCode, Pi
bunx @rohirik/ltm-core --claude # Claude Code only
bunx @rohirik/ltm-core --opencode
bunx @rohirik/ltm-core --pi
bunx @rohirik/ltm-core --dry-run --claude # preview without writingThe installer auto-detects which agents are installed on your machine and patches their config files to register the LTM plugin. All installs are idempotent — safe to run multiple times.
What it configures
Claude Code (~/.claude/settings.json)
- Adds the
ltmMCP server entry (bunx @rohirik/ltm-core mcp-serve) - Wires three lifecycle hooks:
SessionStart,PreCompact,PostEditCheck
OpenCode (opencode.json)
- Adds
@rohirik/opencode-ltm@latestto thepluginarray
Pi (~/.pi/config.toml or ~/pi.toml)
- Appends an
[[extensions]]block withpackage = "@rohirik/pi-ltm"
Shared database
All agents share a single SQLite database:
~/.claude/plugins/data/ltm-ltm/ltm.dbCLI flags
| Flag | Description |
|------|-------------|
| --claude | Install into Claude Code only |
| --opencode | Install into OpenCode only |
| --pi | Install into Pi only |
| --dry-run | Preview what would be written without making changes |
| --help, -h | Show help |
If no target flags are given, agents are auto-detected by probing well-known config directories.
Programmatic API
import { installClaude, installOpenCode, installPi, detectAgents } from "@rohirik/ltm-core/cli";
const detected = detectAgents(); // { claude: true, opencode: false, pi: false }
const result = await installClaude({ dryRun: true });
// result: { target: "claude", status: "installed" | "skipped" | "error", detail?: string }License
MIT
