docs · getting started

from install to first query.

flex compiles every Claude Code session into one local SQLite file. Install it, run flex init, and ask anything. No cloud, no API key.

01 install

One binary, no runtime dependencies. Install with the script, or grab a release.

install
# homebrew
$ brew install flex
# or curl
$ curl -fsSL https://flex.dev/install.sh | sh
$ flex --version
flex 0.4.0 (alpha)

flex needs read access to your Claude Code session logs. It never writes to them — it reads, indexes, and stores the result in its own file.

02 flex init

flex init scans your Claude Code history, compiles every session into chunks, computes embeddings and the knowledge graph, and writes one SQLite file to ~/.flex/cells/.

~/.flex
$ flex init
scanning ~/.claude/projects ...
indexed 4,547 sessions · 275,310 chunks
graph importance + relationships precomputed
ready ~/.flex/cells/claude_code.db
background worker

After the first run, a background worker watches for new sessions and keeps the cell current within seconds. You never run flex init twice.

03 your first query

Ask in plain language. flex hands Claude the database schema, and Claude assembles the answer in a few targeted queries — reading the schema before it writes a single one.

flex ask
$ flex ask "when did I add the retry logic to the worker?"
# 01 reads the schema
# 02 finds the file across renames
# 03 pulls every session that touched it
# 04 searches for the why
# 05 surfaces the original prompt
→ session 2026-05-12 · worker.ts · "add exponential backoff"

Scope a single repo, or search across all of them:

scope
$ flex ask --repo core-api "what replaced the old auth middleware?"
$ flex ask "every place I touched rate limiting"

04 what it stores

Everything lives in one SQLite file: structured tables, vector embeddings, and a precomputed graph. Plain tables you can query yourself with sqlite3.

sessions
one row per Claude Code session: repo, timestamps, summary.
chunks
turns and tool calls, split into retrievable units with embeddings.
files
file lineage across renames — every path a file has lived at.
graph
importance + relationships, so each query is weighted by what matters.

inspect it directly

sqlite3
$ ls ~/.flex/cells/
claude_code.db
$ sqlite3 claude_code.db "SELECT COUNT(*) FROM sessions"
4547

05 staying local

flex runs entirely on your machine. The cell is a file you own — back it up, move it, delete it, open it in any SQLite tool.

  • no cloud — nothing is uploaded; the index lives in ~/.flex.
  • no API key — no account, no sign-in to read your own history.
  • no vendor — open SQLite, no proprietary format to be locked into.
  • no rate limits — query as often as you like; it's local I/O.

For embeddings, point flex at any provider you already use, or run a local model — your choice. Read the schema reference and configuration in the full docs, coming with the beta.

one command. no API keys.