Skip to Content
SynapseX CLISessions and usage

Sessions, usage stats and portability

This page shows you what the SynapseX CLI has stored locally and how to move it around. At the end you will be able to answer three questions on your own machine: what did the agent cost me, how do I carry a session to another laptop, and what is actually in the local store when something looks wrong.

Everything here reads local files. None of it requires being signed in.

List and delete sessions

synapsex-code session list synapsex-code session delete SESSION_ID

session list accepts --max-count <n> to limit it to the N most recent sessions, and --format table|json (default table) when a script has to read it.

The session ids it prints are exactly what run -s SESSION_ID expects; see Code with the SynapseX terminal agent.

See what the agent cost you

synapsex-code stats

This renders two tables: OVERVIEW, a summary of your recorded activity, and COST & TOKENS, the token and cost figures behind it.

FlagWhat it does
--days <n>Only the last N days (default: all time)
--tools <n>Show N tools (default: all)
--models [n]Show model statistics — hidden by default; pass a number for the top N
--project [name]Filter by project; an empty string means the current project
# What did this project cost me in the last week, broken down by model? synapsex-code stats --days 7 --models --project ""

Move a session to another machine

Export it, copy the file, import it:

# On the first machine synapsex-code export SESSION_ID --sanitize > session.json # On the second machine synapsex-code import session.json

--sanitize redacts sensitive transcript and file data from the export — use it whenever the file is going to leave your machine or into a ticket.

import accepts either a path to a JSON file or a share URL.

Export without --sanitize writes the full transcript, including whatever file contents the session touched. Check the file before you attach it to anything.

Inspect the local database directly

The CLI stores sessions and statistics in a local SQLite database. Find it:

synapsex-code db path
/Users/you/.local/share/synapsexCode/synapsexCode.db

Query it. With no query you get an interactive sqlite3 shell; with a query you get the result, tsv by default or json on request:

# What tables does the local store actually have? synapsex-code db "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name" --format json

Start there when a number in stats looks wrong: the table list tells you what exists, and you can then read the rows yourself rather than guessing.

Remember a Lab session per project

synapsex-code lab open # create a session and make it this project's active one synapsex-code lab open SESSION_ID # attach an existing session to this directory

lab open records the session id for the current directory, so later lab commands in that directory do not need --session. Each repository remembers its own session, which is what lets you jump between projects without re-specifying ids.

The per-project record stores only a session id, never a token. It lives in ~/.local/state/synapsexCode/lab-sessions.json. Your credentials stay in auth.json — see CLI configuration.

Full flag list

Every session, stats, export, import and db flag: CLI commands.