Skip to content

CLI Reference

Complete reference for all sfs commands.

sfs [OPTIONS] COMMAND [ARGS]...
OptionDescription
--helpShow help and exit

List captured sessions.

sfs list [OPTIONS]
OptionTypeDefaultDescription
--toolstringFilter by source tool (e.g., claude-code)
--sincestringShow sessions since time (7d, 24h, or ISO date)
--tagstringFilter by tag
--sortstringrecentSort order: recent, oldest, messages, tokens
--jsonflagfalseOutput as JSON
--quiet, -qflagfalseOnly print session IDs

Example:

Terminal window
$ sfs list --since 7d --sort tokens
Sessions (5)
┌──────────────┬─────────────┬────────┬──────────┬───────────┐
ID Tool Model Messages Title
├──────────────┼─────────────┼────────┼──────────┼───────────┤
a1b2c3d4e5f6 claude-code opus-4 23 Debug ...
└──────────────┴─────────────┴────────┴──────────┴───────────┘

Show session details.

sfs show SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix (min 4 chars)
OptionTypeDefaultDescription
--messages, -mflagfalseShow conversation messages
--cost, -cflagfalseShow cost estimate
--page-sizeint20Messages per page (with --messages)

Example:

Terminal window
$ sfs show a1b2 --cost
╭──────────── Session Details ────────────╮
Session ID: a1b2c3d4-e5f6-...
Title: Debug auth flow
Tool: claude-code 1.0.23
Model: claude-opus-4 (anthropic) │
Messages: 23
Input tokens: 34,200
Output tokens: 12,800
╰─────────────────────────────────────────╯
╭──────────── Cost Estimate ──────────────╮
Input cost: $0.5130
Output cost: $0.9600
Total: $1.4730
╰─────────────────────────────────────────╯

Resume a captured session in any supported AI tool.

sfs resume SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--projectpathTarget project path (overrides workspace)
--instringclaude-codeTarget tool: claude-code, codex, copilot, or gemini
--model, -mstringModel to use in target tool (e.g. gpt-4.1, claude-sonnet-4, gemini-2.5-pro)
--no-rules-syncflagfalseSkip preflight of the target tool’s project rules file. Per-invocation only.
--force-rulesflagfalseOverwrite an unmanaged target-tool rules file with SessionFS-managed content. One-time permission — the file becomes SessionFS-managed afterward and subsequent resumes refresh it normally.

Converts the session to the target tool’s native format and injects it into that tool’s session storage. Cursor, Cline, Roo Code, and Amp are capture-only — --in cursor (and the others) is rejected with an error. Use --in with one of the four supported resume targets instead.

Before launching the target tool, sfs resume preflights the tool’s project rules file from the current canonical SessionFS rules. Missing files are written; SessionFS-managed files are refreshed; unmanaged files are left alone with a warning on stderr unless --force-rules is passed. Preflight failures are non-fatal — resume still exits 0. See Resume-Time Rules Sync for the full policy.

--model support per tool:

  • Claude Code: passed as --model to the claude binary
  • Codex: used in session injection and codex resume --model
  • Gemini: passed as --model to the gemini binary
  • Copilot: not supported (warns, uses Copilot’s default)

If omitted, each tool uses its own default model.

Examples:

Terminal window
$ sfs resume ses_abc123 --in codex
Source session used rules v3 (sessionfs).
Current project rules are v5.
Synced codex.md from SessionFS rules v5.
Launching codex resume ...
Session resumed successfully.
CC Session ID: abc123-def456
JSONL: /Users/me/.claude/projects/.../abc123-def456.jsonl
Messages: 23

Skip preflight for a one-off resume:

Terminal window
$ sfs resume ses_abc123 --in codex --no-rules-sync

Take ownership of a hand-written codex.md:

Terminal window
$ sfs resume ses_abc123 --in codex --force-rules

Create a named checkpoint of a session’s current state.

sfs checkpoint SESSION_ID --name NAME
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--namestringrequiredCheckpoint name

Example:

Terminal window
$ sfs checkpoint a1b2 --name "before-refactor"
Checkpoint 'before-refactor' created for session a1b2c3d4e5f6.

Fork a session into a new independent session.

sfs fork SESSION_ID --name NAME [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--namestringrequiredTitle for the forked session
--from-checkpointstringFork from a named checkpoint instead of current state

Example:

Terminal window
$ sfs fork a1b2 --name "Try different approach"
Forked session created: f6e5d4c3b2a1
Title: Try different approach
Parent: a1b2c3d4e5f6

Export a session to a file.

sfs export SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--formatstringsfsExport format: sfs, markdown, claude-code
--output, -opath.Output directory

Example:

Terminal window
$ sfs export a1b2 --format markdown -o ~/exports
Exported to /Users/me/exports/a1b2c3d4-e5f6-....md

Import sessions from external sources.

sfs import [FILE] [OPTIONS]
ArgumentRequiredDescription
FILEnoFile to import (for file-based import)
OptionTypeDefaultDescription
--fromstringImport source: claude-code
--formatstringInput format (for file import)

Example:

Terminal window
# Import all Claude Code sessions
$ sfs import --from claude-code
Found 47 Claude Code session(s).
Imported 47 new session(s).

Start the SessionFS daemon in the background.

sfs daemon start [OPTIONS]
OptionTypeDefaultDescription
--configpathPath to config.toml
--log-levelstringINFOLog level: DEBUG, INFO, WARNING, ERROR

Example:

Terminal window
$ sfs daemon start
Daemon started (PID 12345).
Logs: /Users/me/.sessionfs/daemon.log

Stop the running daemon.

sfs daemon stop

Example:

Terminal window
$ sfs daemon stop
Sent SIGTERM to daemon (PID 12345).

Show daemon status and watcher health.

sfs daemon status

Example:

Terminal window
$ sfs daemon status
SessionFS Daemon Status
┌──────────────────┬────────────────────────┐
Field Value
├──────────────────┼────────────────────────┤
PID 12345
Running Yes
Sessions 47
Watcher: cc healthy (47 sessions) │
└──────────────────┴────────────────────────┘

Show daemon log output.

sfs daemon logs [OPTIONS]
OptionTypeDefaultDescription
--lines, -nint50Number of lines to show
--follow, -fflagfalseFollow log output (like tail -f)

Example:

Terminal window
$ sfs daemon logs -n 10
2026-03-20 14:30:00 sfsd INFO sfsd starting with 1 watcher(s)
2026-03-20 14:30:01 sfsd INFO sfsd running (PID 12345)

Show the current configuration.

sfs config show

Example:

Terminal window
$ sfs config show
Config: /Users/me/.sessionfs/config.toml
log_level = "INFO"
scan_interval_s = 5.0
[claude_code]
enabled = true

Set a configuration value.

sfs config set KEY VALUE
ArgumentRequiredDescription
KEYyesConfig key (dotted path, e.g., claude_code.enabled)
VALUEyesValue to set

Example:

Terminal window
$ sfs config set scan_interval_s 10
Set scan_interval_s = 10

Set or clear a session alias for easy reference.

sfs alias SESSION_ID [ALIAS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
ALIASnoAlias name (omit to clear)

Example:

Terminal window
$ sfs alias ses_a1b2 auth-debug
Alias set: auth-debug -> ses_a1b2c3d4e5f6
$ sfs show auth-debug # Now works with alias

Full-text search across all local sessions.

sfs search QUERY [OPTIONS]
ArgumentRequiredDescription
QUERYyesSearch text
OptionTypeDefaultDescription
--toolstringFilter by source tool
--cloudflagfalseSearch cloud sessions instead of local
--jsonflagfalseOutput as JSON

Example:

Terminal window
$ sfs search "rate limiting middleware"
2 results:
ses_a1b2 claude-code "...added rate limiting middleware to..."
ses_c3d4 codex "...the rate limiter should handle..."

Show a session summary — files changed, tests run, commands executed.

sfs summary SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--formatstringExport format: md for markdown

Example:

Terminal window
$ sfs summary ses_a1b2
Debug auth middleware
2.3h | 327 msgs | 28 tool calls | Claude Code
Branch: feature/auth-fix @ a1b2c3d
Files modified (3):
src/auth/middleware.py
src/auth/tokens.py
tests/test_auth.py
Commands: 34
Tests: 6 runs (5 passed, 1 failed)
Packages: pyjwt, redis

Audit a session for hallucinations using LLM-as-a-Judge.

sfs audit SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--modelstringclaude-sonnet-4Judge LLM model
--api-keystringLLM API key (or use config/env)
--providerstringauto-detectProvider: anthropic, openai, google, openrouter
--base-urlstringCustom OpenAI-compatible endpoint (LiteLLM, vLLM, Ollama)
--consensusflagfalseRun 3 passes, report where 2+ agree (3x cost)
--reportflagfalseShow existing report only
--jsonflagfalseOutput as JSON
--formatstringExport: json, markdown, csv

Example:

Terminal window
$ sfs audit ses_a1b2 --model gpt-4o --base-url https://litellm.internal/v1
Trust Score: 74%
3 contradictions | 9 unverified | 42 verified
CRITICAL test_result msg #34 "Test passes" -> exit code 1
HIGH file_existence msg #12 "Created validator.py" -> No Write call

Delete a session from the cloud, the local device, or both. Requires an explicit scope flag — there is no default.

sfs delete SESSION_ID [OPTIONS]
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix
OptionTypeDefaultDescription
--cloudflagDelete from server, keep local copy
--localflagRemove local copy, keep cloud copy
--everywhereflagDelete from both server and local
--forceflagfalseSkip confirmation prompt

If no scope flag is provided, the command prints an error and exits.

Examples:

Terminal window
# Remove from cloud only (local copy stays)
$ sfs delete ses_abc123 --cloud
Delete ses_abc123 from cloud? Local copy will be kept. [y/N] y
Deleted from cloud. Recoverable for 30 days.
# Remove from this device only
$ sfs delete ses_abc123 --local
Delete ses_abc123 from this device? Cloud copy is unaffected. [y/N] y
Removed local copy.
# Delete everywhere (recoverable for 30 days)
$ sfs delete ses_abc123 --everywhere --force
Deleted from cloud and local device. Recoverable for 30 days.

See Delete Lifecycle for full details on retention, recovery, and sync behavior.


List soft-deleted sessions in the retention window.

sfs trash

Example:

Terminal window
$ sfs trash
Trash (3 sessions -- purge after 30 days)
ID Deleted Scope Purge after
ses_abc123 2 days ago cloud 2026-05-14
ses_def456 5 days ago everywhere 2026-05-11
ses_ghi789 12 days ago everywhere 2026-04-28

Undo a soft-delete. Clears the server-side deletion flag and removes the session from the local exclusion list.

sfs restore SESSION_ID
ArgumentRequiredDescription
SESSION_IDyesSession ID or prefix

If the local copy was also removed (scope was everywhere), run sfs pull <id> afterward to re-download it.

Example:

Terminal window
$ sfs restore ses_abc123
Session restored. Run 'sfs pull ses_abc123' to re-download locally.

Push a session to the cloud.

sfs push SESSION_ID

Pull a session from the cloud.

sfs pull SESSION_ID

Pull a session from a handoff link.

sfs pull-handoff HANDOFF_ID

Example:

Terminal window
$ sfs pull-handoff hnd_x7k9
Session pulled. 47 messages.
Run: sfs resume ses_abc --in claude-code

List sessions stored on the cloud server.

sfs list-remote [OPTIONS]
OptionTypeDefaultDescription
--pageint1Page number
--page-sizeint20Results per page

Hand off a session to a teammate with email notification.

sfs handoff SESSION_ID --to EMAIL [OPTIONS]
OptionTypeDefaultDescription
--tostringrequiredRecipient email
--messagestringMessage to include in the email

Bidirectional sync and autosync management.

Run bidirectional sync — push local changes, pull remote-only sessions.

sfs sync

Set autosync mode.

sfs sync auto --mode MODE
ModeBehavior
offNo autosync (default). Manual sfs push only.
allEvery new or updated session auto-pushes to cloud.
selectiveOnly sessions in the watchlist auto-push.

Add sessions to the autosync watchlist (selective mode).

sfs sync watch SESSION_ID [SESSION_ID...]

Remove sessions from the autosync watchlist.

sfs sync unwatch SESSION_ID [SESSION_ID...]

Show all sessions in the autosync watchlist.

sfs sync watchlist

Show current autosync mode, counts, and storage usage.

sfs sync status

Manage shared project context — a single document shared across the team via MCP.

Create a project context for the current repo (matched by git remote).

sfs project init

Display the current project context with metadata.

sfs project show

Open the context document in $EDITOR. Changes upload on save.

sfs project edit

Set project context from a file.

sfs project set-context FILE

Output raw project context markdown to stdout.

sfs project get-context

Compile pending knowledge entries into the project context document.

sfs project compile

Example:

Terminal window
$ sfs project compile
Compiling pending entries...
Project context updated. 12 entries compiled.

Force a full re-compile of the project context. Resets compiled_at=NULL on all active claims and clears context_document, so the next compile pass pulls every active claim from scratch. Useful on settled projects where normal compile would be a no-op.

sfs project rebuild

Example:

Terminal window
$ sfs project rebuild
Project context reset. Run `sfs project compile` to regenerate.

List knowledge entries for this project.

sfs project entries [OPTIONS]
OptionTypeDefaultDescription
--pendingflagfalseShow only pending (uncompiled) entries
--typestringFilter by type: decision, pattern, discovery, convention, bug, dependency
--limitint20Max entries to show

Example:

Terminal window
$ sfs project entries --type decision --limit 5
┌────┬──────────┬────────────────────────────────────────┬──────────┬──────────────────┬──────────┐
ID Type Content Age Session Status
├────┼──────────┼────────────────────────────────────────┼──────────┼──────────────────┼──────────┤
42 decision HTTP + ETags only, no WebSockets 3d ago ses_a1b2c3d4e5.. compiled
38 decision Sessions are append-only 5d ago ses_f6e5d4c3b2.. pending
└────┴──────────┴────────────────────────────────────────┴──────────┴──────────────────┴──────────┘
Showing 2 of 2 entries

Ask a question about the project using the knowledge base.

sfs project ask QUESTION
ArgumentRequiredDescription
QUESTIONyesQuestion about the project

Searches knowledge entries and project context for relevant answers. Optionally saves the Q&A back to the knowledge base.

Example:

Terminal window
$ sfs project ask "How does session conflict resolution work?"
╭─ Question: How does session conflict resolution work? ─╮
╰────────────────────────────────────────────────────────╯
Matching Knowledge Entries (2):
[decision] Sessions are append-only conflict resolution appends both sides
Session: ses_a1b2 | 2026-03-15 | confidence: 95%
[pattern] Merge strategy: append both sides rather than 3-way merge
Session: ses_c3d4 | 2026-03-10 | confidence: 90%
Related Sessions:
sfs show ses_a1b2
sfs show ses_c3d4
Save this Q&A to the knowledge base? [y/N]:

List wiki pages for this project.

sfs project pages

Example:

Terminal window
$ sfs project pages
┌──────────────────┬──────────────────────────┬──────────┬───────┬─────────┬──────┐
Slug Title Type Words Entries Auto
├──────────────────┼──────────────────────────┼──────────┼───────┼─────────┼──────┤
session-format Session Format (.sfs) │ concept │ 420 │ 8 │ yes │
conflict-resolve Conflict Resolution concept 310 5 yes
daemon-arch Daemon Architecture manual 850 0 no
└──────────────────┴──────────────────────────┴──────────┴───────┴─────────┴──────┘
3 pages

View a wiki page by slug.

sfs project page SLUG
ArgumentRequiredDescription
SLUGyesPage slug

Example:

Terminal window
$ sfs project page session-format
╭──────────── Session Format (.sfs) ────────────╮
A .sfs session is a directory containing:
manifest.json, messages.jsonl, workspace.json,
tools.json. All file paths within are relative
to workspace root.
...
╰──────────── session-format (auto-generated) ──╯
Backlinks:
entry:42 (references)
entry:38 (defines)

Run health checks on the project knowledge base.

sfs project health

Reports entry counts, compilation status, staleness, and a health score.

Example:

Terminal window
$ sfs project health
Project Health: sessionfs
Context document exists (2400 words, 8 sections)
45 knowledge entries (38 compiled, 2 dismissed)
5 entries pending compilation
Last compiled: 2026-03-28
Context appears up to date
Health Score: 90%

Regenerate an auto-generated concept article from the latest knowledge entries.

sfs project regenerate SLUG
ArgumentRequiredDescription
SLUGyesPage slug to regenerate

Example:

Terminal window
$ sfs project regenerate session-format
Regenerating page 'session-format'...
Article regenerated (420 words from 8 entries).

Update project settings.

sfs project set [OPTIONS]
OptionTypeDescription
--auto-narrative / --no-auto-narrativeflagEnable or disable auto-narrative generation on sync

Example:

Terminal window
$ sfs project set --auto-narrative
auto_narrative = True

Dismiss an irrelevant knowledge entry so it is excluded from future compilations.

sfs project dismiss ENTRY_ID
ArgumentRequiredDescription
ENTRY_IDyesNumeric entry ID

Example:

Terminal window
$ sfs project dismiss 38
Entry 38 dismissed.

Manage canonical project rules and compile them into the tool-specific files each AI agent reads (CLAUDE.md, codex.md, .cursorrules, .github/copilot-instructions.md, GEMINI.md). See Rules Portability for the full reference.

Seed canonical rules for the current project. Detects the git remote, preselects enabled tools from existing rule files + recent tool usage, and optionally imports a single unmanaged rule file as the canonical seed.

sfs rules init [--local-only]
OptionTypeDefaultDescription
--local-onlyflagfalseGitignore the compiled rule files instead of committing them

Only the five v0.9.9-supported tools are preselected: claude-code, codex, cursor, copilot, gemini. The picker shows the reason for each preselection (file present, recent usage, or manual pick).

Example:

Terminal window
$ sfs rules init
Detected rule files:
CLAUDE.md (reason: file present)
.cursorrules (reason: file present)
Recent tool usage (last 90 days):
codex (reason: recent usage)
Enable these tools? [Y/n]
Seeded canonical rules for myorg/my-project.
Run 'sfs rules edit' to edit preferences, then 'sfs rules compile'.

Open the canonical static_rules document in $EDITOR.

sfs rules edit

Show current canonical version, enabled tools, knowledge/context injection config, and whether compiled outputs are in sync.

sfs rules show

Example:

Terminal window
$ sfs rules show
Project: myorg/my-project
Canonical version: 4
Enabled tools: claude-code, codex, cursor, gemini
Knowledge injection: on
Types: convention, decision
Budget: 2000 tokens
Context injection: on
Sections: overview, architecture
Budget: 2000 tokens
Compiled outputs: in sync (last compile: 2026-04-12)

Compile canonical rules into tool-specific files. Deterministic — no new version is created unless a compiled output changes by hash.

sfs rules compile [--tool TOOL] [--dry-run] [--force]
OptionTypeDefaultDescription
--toolstringCompile for a single tool only
--dry-runflagfalseShow what would be written without touching disk
--forceflagfalseOverwrite files not managed by SessionFS

Example:

Terminal window
$ sfs rules compile
Compiling canonical rules v4...
CLAUDE.md written (sha256:9a1c…)
codex.md written (sha256:4e2f…)
.cursorrules written (sha256:b7d1…)
.github/copilot-instructions.md written (sha256:c3a8…)
GEMINI.md written (sha256:5f90…)
New rules version: 5

SessionFS refuses to overwrite a rule file that is not managed (no SessionFS marker and not created by sfs rules init). Use sfs rules init to import it, or pass --force.

Push the canonical record and latest compiled version to the SessionFS API. Uses optimistic concurrency — a stale write returns 409 Conflict.

sfs rules push

Pull canonical rules from the SessionFS API. Run sfs rules compile afterwards to regenerate tool files.

sfs rules pull

Print the latest compiled rules for a tool to stdout. Reads from the local rule cache populated by sfs rules compile and sfs rules pull — never hits the network.

sfs rules emit --tool TOOL [--format hook|file]
OptionTypeDefaultDescription
--toolstringrequiredTarget tool (claude-code, codex, cursor, copilot, gemini)
--formatstringhookhook for Claude Code’s hook JSON spec, file for the plain compiled body

--format hook is the format the SessionStart hook installed by sfs hooks install consumes. --format file is useful for piping the compiled body into another tool or inspecting it from the shell. If the local cache is empty, the command prints an empty payload and exits 0 — it never breaks Claude Code startup.

Example:

Terminal window
$ sfs rules emit --tool claude-code --format hook
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "..."
}
}

Manage SessionFS hooks for tools with native hook support. v0.9.9.9 supports Claude Code only. See Hook-based injection for the full reference.

Wire the SessionFS SessionStart hook into the target tool’s settings. The hook calls sfs rules emit on every session start and pipes the compiled rules into the system prompt. Idempotent — running twice does not duplicate the entry.

sfs hooks install --for TOOL [--user|--project] [--force]
OptionTypeDefaultDescription
--forstringrequiredTarget tool (claude-code only in v0.9.9.9)
--userflagdefaultInstall at user scope (~/.claude/settings.json)
--projectflagfalseInstall at project scope (.claude/settings.json in repo root)
--forceflagfalseSkip the conflict warning when a managed CLAUDE.md already exists

Example:

Terminal window
$ sfs hooks install --for claude-code
Hook installed: ~/.claude/settings.json (SessionStart)
SessionFS will inject project rules at every Claude Code startup.

Remove the SessionFS-managed hook entry from the target tool’s settings. Idempotent — no-op if not installed.

sfs hooks uninstall --for TOOL [--user|--project] [--force]
OptionTypeDefaultDescription
--forstringrequiredTarget tool (claude-code only in v0.9.9.9)
--userflagdefaultUninstall from user scope
--projectflagfalseUninstall from project scope
--forceflagfalseSkip the confirmation prompt

Show which SessionFS hooks are installed across supported tools and scopes. Tools without native hook support appear as N/A.

sfs hooks status

Example:

Terminal window
$ sfs hooks status
SessionFS Hooks
───────────────
claude-code (user): INSTALLED at ~/.claude/settings.json (SessionStart)
claude-code (project): not installed
codex: N/A (no native hook system)
gemini: N/A
cursor: N/A

Manage local session storage.

Show local disk usage, session counts, and retention policy.

sfs storage

Prune old sessions to free disk space.

sfs storage prune [OPTIONS]
OptionTypeDefaultDescription
--dry-runflagfalseShow what would be pruned without deleting
--forceflagfalseSkip confirmation prompt

Restart the daemon (stop + start).

sfs daemon restart

Manage tool watchers.

List all tool watchers and their status.

sfs watcher list

Enable a tool watcher.

sfs watcher enable TOOL

Disable a tool watcher.

sfs watcher disable TOOL

Manage cloud authentication.

Authenticate with the cloud server.

sfs auth login [OPTIONS]
OptionTypeDefaultDescription
--urlstringhttps://api.sessionfs.devServer URL
--keystringAPI key

Create a new account.

sfs auth signup [OPTIONS]
OptionTypeDefaultDescription
--urlstringhttps://api.sessionfs.devServer URL

Show current authentication status.

sfs auth status

Start the MCP server on stdio transport.

sfs mcp serve

Tools exposed: search_sessions, get_session_context, list_recent_sessions, find_related_sessions, get_project_context, add_knowledge, update_wiki_page, list_wiki_pages, search_project_knowledge, ask_project, get_session_summary, get_audit_report.


Auto-configure SessionFS as an MCP server for an AI tool. Also injects knowledge-contribution instructions into the tool’s project config file.

sfs mcp install --for TOOL [OPTIONS]
OptionTypeDescription
--forstringTarget tool: claude-code, codex, gemini, cursor, copilot, amp, cline, roo-code
--skip-instructionsflagSkip injecting knowledge-contribution instructions into project config

Example:

Terminal window
$ sfs mcp install --for claude-code
Added SessionFS MCP server in Claude Code.
Config: /Users/me/.claude.json
Restart Claude Code to activate.
Appended knowledge instructions to CLAUDE.md
Your AI agent can now search past sessions:
"Has anyone on the team seen this error before?"
"What was the fix for the auth middleware bug?"

Remove SessionFS MCP server registration and knowledge instructions from an AI tool.

sfs mcp uninstall --for TOOL
OptionTypeDescription
--forstringTarget tool: claude-code, codex, gemini, cursor, copilot, amp, cline, roo-code

Example:

Terminal window
$ sfs mcp uninstall --for cursor
Removed SessionFS MCP server from Cursor.
Restart Cursor to apply.
Removed knowledge instructions from .cursorrules

Rebuild the full-text search index from all local sessions.

sfs mcp index

Example:

Terminal window
$ sfs mcp index
Search index rebuilt: 47 sessions indexed.

Interactive setup wizard for SessionFS. Detects installed AI coding tools, writes configuration, optionally sets up cloud sync, and starts the daemon.

sfs init

Detects: Claude Code, Cursor, Codex, Gemini CLI, Copilot, Amp, Cline, Roo Code.

Example:

Terminal window
$ sfs init
SessionFS Setup
Scanning for AI coding tools...
Claude Code detected (~/.claude)
Cursor detected (~/Library/Application Support/Cursor)
Gemini CLI detected (~/.gemini)
Codex not found
Found 3 tools. Track all? [Y/n]: y
Cloud sync lets you access sessions from any machine and share with teammates.
Set up cloud sync now? [y/N]: n
Start the SessionFS daemon now? [Y/n]: y
Daemon started! Watching 3 tools.
Sessions stored in: /Users/me/.sessionfs/sessions
Next steps:
sfs list View captured sessions
sfs show <id> Inspect a session
sfs resume <id> Resume in any tool
sfs search "query" Search past sessions

Run 8 health checks with auto-repair. Checks store directory, session count, index integrity, index freshness, daemon status, API reachability, authentication, and config permissions. Automatically repairs corrupted indexes.

sfs doctor

Example:

Terminal window
$ sfs doctor
SessionFS Health Check
┌─────────────────────┬────────┬──────────────────────────┐
Check Status Detail
├─────────────────────┼────────┼──────────────────────────┤
Store directory /Users/me/.sessionfs
Sessions directory 47 session(s) on disk
Session index 47 indexed
Index freshness in sync
Daemon running (PID 12345) │
API server reachable (https://...) │
Authentication me@example.com (team) │
Config permissions permissions OK (0o600) │
└─────────────────────┴────────┴──────────────────────────┘

Scan local sessions for secrets and PHI. SessionFS ships with 22 secret patterns (API keys, access tokens, private keys, database URLs) and 14 PHI patterns (SSN, phone, credit card, medical IDs).

sfs dlp scan [SESSION_ID ...] [--mode MODE] [--format FORMAT]
OptionDescription
--mode warn|redact|blockAction on findings (default: warn)
--format json|textOutput format (default: text)
--verboseShow matched substrings
Terminal window
$ sfs dlp scan ses_abc123
2 findings in ses_abc123:
[HIGH] AWS access key in messages.jsonl:142
[MEDIUM] Email address in messages.jsonl:89

View or update the organization DLP policy. Applies server-side to all org members on sync.

sfs dlp policy [--get|--set-mode MODE|--enable|--disable]
OptionDescription
--getShow current policy
--set-mode warn|redact|blockUpdate the policy mode
--enableEnable DLP scanning
--disableDisable DLP scanning

When set to block, uploads containing detected secrets/PHI are rejected. When set to redact, findings are automatically redacted before storage.


Run local security checks: config file permissions, API key exposure in shell configs, dependency vulnerabilities (via pip-audit), and stale sessions.

sfs security scan

Example:

Terminal window
$ sfs security scan
Security Scan Results
────────────────────────────────────────
Config permissions: OK (0o600)
API key exposure: No keys found in shell configs
Dependencies: No vulnerabilities found
Stale sessions: No stale sessions
All checks passed.

Auto-fix security issues where safe to do so. Fixes config permissions, upgrades vulnerable packages (with confirmation), and warns about issues requiring manual action.

sfs security fix [OPTIONS]
OptionTypeDefaultDescription
--yes, -yflagfalseSkip confirmation prompts

Example:

Terminal window
$ sfs security fix
Security Fix
────────────────────────────────────────
Fixed config permissions: 0o644 -> 0o600
Vulnerable packages with available fixes:
- cryptography>=44.0.0
Upgrade these packages? [y/N]: y
Upgraded 1 packages
Fixed 2 issue(s).

Re-extract metadata for all cloud sessions (admin only).

sfs admin reindex