Skip to content

vibecook-dev/spaghetti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

269 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spaghetti

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.

npm version npm version License: MIT Node CI Docs

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                                  │
│                                                                        │
╰────────────────────────────────────────────────────────────────────────╯

Why people use it

  • 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-sdk and optional React exports.

Quick start

npm install -g @vibecook/spaghetti
spag

Or 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).

What you get

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

Common commands

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

What Spaghetti indexes

  • Claude Code — projects/sessions under ~/.claude, messages, plans, todos, memory, subagents, workflows, teams, hooks/channels
  • OpenAI Codex — rollouts under ~/.codex/sessions/**, chat turns, official token_count usage (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 and updates.jsonl deliberately skipped
  • One local SQLite index under ~/.spaghetti/cache with a source_id column (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.

Built for two audiences

Terminal users

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.

Tool builders

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();

Docs

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)

Repo map

Requirements

  • Node.js >=18 for end users
  • ~/.claude and/or ~/.codex for real data
  • pnpm + Node.js 24 for local workspace development

Learn more

License

MIT — James Yong

About

Local-first multi-agent explorer for Claude Code and Codex — search sessions, browse artifacts, and query your history from the terminal

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages