How sessions work
Sessions are the mechanism that lets you build on a prior search instead of starting over. This page explains the model behind them so you can use sessions confidently and understand what to expect.The two-layer model
Sessions have two layers:- A UUID — a server-side identifier that Landbase uses to associate your requests with a conversation thread. This is what actually persists state.
- A label — a short, human-readable alias you assign (e.g.
uk-saas,acme-research). This lives in~/.landbase/sessions.jsonon your machine.
uk-saas in ~/.landbase/sessions.json, finds the UUID that was assigned when you first used that label, and sends the UUID to the API. The Landbase backend sees the UUID and understands this request is a continuation of the prior conversation.
If you use a label for the first time, the server creates a new session UUID and the CLI saves the label → UUID mapping locally.
What state persists server-side
The server keeps track of:- The query history for the session — what you asked before
- The audience context — the companies or people the prior query produced
- Refinement history — what filters you applied in follow-up queries
Labels are local; UUIDs are global
Your labels are stored in~/.landbase/sessions.json on your machine only. If you run the same label on a different machine, it will create a new session (a new UUID). The label-to-UUID mapping does not sync across machines.
If you want to continue a session on a different machine, you can pass the raw UUID directly:
session_id field.
Sessions in Claude Code
When you run landbase-cli through Claude Code, the environment variableCLAUDE_CODE_SESSION_ID is automatically set. The CLI records this alongside your session label for telemetry purposes. From a usage perspective, sessions work identically — pass --session=<label> in Claude Code tool calls just as you would in the terminal.
Session lifetime
Sessions do not expire based on a fixed clock. A session remains accessible as long as the underlying data is retained on the Landbase backend. In practice, sessions from recent runs (the past several months) are reliably accessible. If a session UUID is no longer found on the backend, the next request using that label will start a fresh session, and the CLI will update~/.landbase/sessions.json with the new UUID.
Inspecting sessions
To see what happened in a session:Related
- How to use sessions — practical guide with examples
- runs reference — full reference for the
runscommand

