Turn your local agent history into a searchable workspace.
Spaghetti is a local-first CLI and SDK for coding-agent data. It indexes Claude Code (~/.claude) and OpenAI Codex (~/.codex) into one SQLite store so you can search conversations, browse projects and sessions, review plans/todos/subagents, and build tools on top of the same index.
Docs: https://vibecook-dev.github.io/spaghetti/ · API reference · CLI commands
╭ Spaghetti v0.5.17 ─────────────────────────────────────────────────────╮
│ │
│ ▄▀▀ █▀█ ▄▀▄ █▀▀ █ █ █▀▀ ▀█▀ ▀█▀ █ Projects 79 │
│ ▀▄▄ █▀▀ █▀█ █ █ █▀█ █▀ █ █ █ Sessions 1,247 │
│ ▄▄▀ █ █ █ ▀▀▀ ▀ ▀ ▀▀▀ ▀ ▀ ▀ Messages 86,412 │
│ Tokens 66.3M │
│ untangle your agent history ────────────────────── │
│ /search /stats /help │
│ ~/.claude + ~/.codex · 512 MB · 28ms │
│ │
╰────────────────────────────────────────────────────────────────────────╯
- Find anything fast with full-text search over multi-agent message history.
- Browse Claude and Codex side by side — agent tabs in the TUI, Agent column in lists, source-scoped sessions so the same repo never mixes agents.
- Artifacts, not just chat: projects, sessions, messages, plans, todos, memory, subagents, workflows (Claude), rollouts + token usage (Codex).
- Stay local-first with a SQLite index under
~/.spaghetti— no cloud, no accounts. - Build on top of it with
@vibecook/spaghetti-sdkand optional React exports.
npm install -g @vibecook/spaghetti
spagOr run a one-off command without installing globally:
npx @vibecook/spaghetti search "worker pool"If ~/.codex/sessions exists, Codex is auto-detected and indexed alongside Claude Code (zero config).
| Surface | Best for |
|---|---|
@vibecook/spaghetti |
Interactive TUI plus one-shot CLI commands |
@vibecook/spaghetti-sdk |
Scripts, apps, and custom tooling over the same index |
| Native Rust ingest | Faster Claude cold starts by default, with automatic TypeScript fallback |
| Docs site | Product overview, architecture, CLI & API reference |
spag # launch the multi-agent TUI
spag projects # list projects (Agent column)
spag sessions . # sessions for the current repo
spag messages . latest # latest session transcript
spag search "refactor parser"
spag plan . latest
spag todos . latest
spag doctor- Claude Code — projects/sessions under
~/.claude, messages, plans, todos, memory, subagents, workflows, teams, hooks/channels - OpenAI Codex — rollouts under
~/.codex/sessions/**, chat turns, officialtoken_countusage (tiktoken estimate when events are missing) - Grok CLI (xAI) —
~/.grok/sessions/**/chat_history.jsonl, conversational turns, turn-scoped timestamps (events.jsonl), session token aggregates (signals.json); tool I/O andupdates.jsonldeliberately skipped - One local SQLite index under
~/.spaghetti/cachewith asource_idcolumn (schema v7+)
Native Grok cold/warm + live batch ship in the Rust addon (default engine=rs). Published npm builds pick this up on the next release after these commits land; local workspace builds already include it.
Launch spag for the full-screen TUI (agent tabs when multiple sources are present), or use subcommands when you just want a fast answer in the shell.
Use the SDK when you want the same indexed data from scripts or apps:
import { createSpaghettiService, createCodexSource } from '@vibecook/spaghetti-sdk';
const api = createSpaghettiService({
// optional; CLI auto-detects Codex + Grok when their session dirs exist
additionalSources: [createCodexSource()],
});
await api.initialize();
const projects = api.getProjectList();
const sessions = api.getSessionList(projects[0].slug, {
sourceId: projects[0].sourceId, // always scope multi-source drill-downs
});
const results = api.search({ text: 'worker thread' });
await api.dispose();| Link | Contents |
|---|---|
| Product site | Overview, architecture, install |
| CLI commands | Full command reference |
| API reference | SDK methods, multi-source, live/runtime |
site/ |
Source for GitHub Pages (preview: npx serve site) |
packages/cli— published CLI packagepackages/sdk— parsing, indexing, query APIs, and React exportscrates/spaghetti-napi— native Rust ingest engine (Claude bulk path)apps/playground— Electron demo appsite— official documentation websitedocs— RFCs, design notes, and deeper implementation details
- Node.js
>=18for end users ~/.claudeand/or~/.codexfor real datapnpm+ Node.js 24 for local workspace development
MIT — James Yong