Docs menu

How sessions work

Every fAI session is a git branch. The branch model is what makes sessions conflict-free, resumable, and auditable.

The three branches

journal/<session-name> - the active session branch.

When you open a session named "auth-refactor", fAI creates journal/auth-refactor. Everything captured during that session lives on this branch. Your AI conversations, file diffs, terminal activity - all committed here as it happens.

pending - the sealed session queue.

When a session seals (fAI does this automatically every few minutes), the journal/ branch merges into pending. This is the staging area for synthesis: sessions that have closed but haven't yet been synthesized into project knowledge.

kept - the canonical knowledge branch.

After synthesis runs, the synthesized knowledge is committed to kept. Every new session inherits from kept - it's the clean, distilled record of everything your workbench has learned.

(Archived sessions move to archived/<session-name> - they're preserved but out of the active flow.)

The lifecycle in sequence

Open session
  → creates journal/session-name

Work (captures stream in continuously)
  → commits to journal/session-name

Seal session
  → journal/session-name merges to pending

Synthesis runs (triggered by ProposalThreshold)
  → pending synthesized by sub-vault agents
  → kept updated with new knowledge
  → next session opens from kept

Two simultaneous sessions

Two people can work on the same project simultaneously without conflict because they each have their own journal/ branch:

Person A: journal/auth-refactor
Person B: journal/dashboard-redesign

No merge conflicts during work. When A seals, their knowledge goes to pending → kept. When B seals next, they inherit A's knowledge from kept automatically.

Why git?

Git gives you everything for free:

  • Full history of every capture
  • Conflict-free parallel sessions
  • Rollback to any point in your workbench's history
  • Portable: clone your workbench, carry it anywhere

Your workbench is just a git repo. Open it, read it, push it anywhere.

The session folders on disk

fAI keeps your sessions in two folders under ~/.fai. They hold different things on purpose.

~/.fai/sessions: what synthesis writes

This folder is the session vault. It's a git working tree, checked out on the kept branch, and its git data sits in ~/.fai/sessions/.vault. Each session gets a folder named by its session id:

FileWhat it holds
<session-id>/FAI-SESSION.mdThe brief your AI reads for this session
<session-id>/work-state.mdThe session's working state, carried from one synthesis to the next
<session-id>/$seal-manifest.jsonThe open loops, their status, and a quality score
<session-id>/$state.jsonThe checks that let fAI skip a synthesis when nothing has changed
<session-id>/$agent-state.jsonWhat lets the synthesis agent pick up its last conversation
<session-id>/loop-context/Notes on single open loops

At the top of the folder:

FileWhat it holds
OPEN-LOOPS.mdEvery open loop, across all sessions, in one listing
loops/One JSON file per loop, plus loops/index.json
$state.jsonSynthesis metrics: the quality score, loop counts, and LastSeal
CLAUDE.md, AGENTS.mdA short guide to this folder, for an AI that opens it
.recalls/The local search index fAI recalls from

Each time fAI updates this tree, it resets it to the kept branch and removes every file git doesn't track, apart from .vault and .recalls. Don't keep your own files here.

~/.fai/config/session: what a running session needs

This folder also has one folder per session id, and it holds the session's running state:

FileWhat it holds
<session-id>/metadata.jsonThe session id, its label, when it started, its folders, and its state
<session-id>/.lockThe fAI processes that have the session open
<session-id>/mcp-servers.jsonWhat fAI installed for the session, so it can remove it when the session ends

Capture bookkeeping sits beside it in ~/.fai/config/captures/<session-id>/ (capture-hashes.json, capture-positions.json and capture-times.json).

These files live outside ~/.fai/sessions so the reset above can't remove them. The session picker lists a session from its metadata.json.

Reading $seal-manifest.json

The name sounds final, but the file isn't. A seal is a checkpoint, and a session seals many times while it's open. fAI rewrites $seal-manifest.json each time it synthesizes the session, so on a live session the file's timestamp shows the latest synthesis, not the end of the session. When nothing has changed since the last synthesis, fAI skips it and the file stays as it was.

Inside it:

  • openLoops: the loops fAI is tracking, closed ones included
  • openLoopCount, closedCount, deferredCount, escalatedCount: counts by status
  • sealQuality: a score from 0 to 1 for how fully the synthesis accounted for the loops and filled in its summary
  • currentState and whatWasLearned: the synthesis's summary of where the session stands

On fathym.com: fAI →

On this page