REPL walkthrough
A narrative tour of the interactive REPL — what happens end-to-end
from scaiflux at the prompt to a turn completing, plus the knobs
you'll reach for most often. Aimed at someone who's just installed
ScaiFlux and wants to feel productive in five minutes.
For the reference surface (subcommands, flags, slash-command
catalog) see USAGE.md. For install + auth see QUICKSTART.md.
TL;DR#
scaifluxdrops you into a REPL. No subcommand needed.- If there are saved sessions in this workspace, a picker shows up
first. Pick one to resume, type
nfor a new one,qto quit. - Type anything, hit enter. The spinner shows a rotating verb
(
Foam Lancing…on Poolnoodle models) with a timer + token counter + context-usage percent in real time. - Press ESC during model thinking to cancel. Ctrl-C stays the escape hatch for running tools.
/helplists every slash command./statusand/contextshow what's currently in play./save modelpins your current model as the workspace default.
1. First launch#
1 | |
No arguments needed. ScaiFlux reads credentials from
~/.scaiflux/credentials.json (created by scaiflux login), picks
the default model from .scaiflux.json → model (or the login-time
default), and shows the startup banner:
1 2 3 4 5 6 7 8 | |
If the workspace already has sessions under .scaiflux/sessions/,
you'll see a picker before the banner instead:
1 2 3 4 5 6 7 8 9 | |
Number → resume; n → fresh session; q → exit; d 2 → delete #2
and keep picking; clear → nuke them all and start fresh.
2. A turn, in slow motion#
Type anything and hit enter:
1 | |
What you see while the model thinks:
1 | |
Reading left-to-right: animated spinner · rotating "verb"
(random from a 180-entry list, themed extras on Poolnoodle-family
models) · elapsed time · input tokens sent · context-window used.
The color of the % ctx readout goes green → yellow → red as the
window fills.
Then streaming text appears with rendered markdown, code fences syntax-highlighted, etc. If the model calls a tool, a dedicated tool spinner takes over:
1 | |
When the tool completes, it collapses to a one-line summary:
1 2 | |
Turn ends with a dimmed footer:
1 | |
↓ input tokens, ↑ output, % ctx context used, iter number of
model→tool→model round-trips, stop reason.
3. Interrupting#
Two keys, two scopes:
- ESC cancels the model while it's thinking or streaming text.
The partial response is discarded; the REPL prints
⚠ interrupted by ESC — partial response discardedand returns to the prompt. ESC is paused during tool execution so subprocess stdin isn't clobbered — a runningbashcommand keeps its terminal as expected. - Ctrl-C is the universal escape hatch, including during tools. The subprocess gets SIGINT; if you hit it at the prompt, the REPL exits cleanly.
Double-pressing ESC? First press stops the turn. Second press is just an ESC at the empty prompt (no-op).
4. Slash commands worth knowing#
Start with /help for the full catalog. The ones you'll reach for:
| Command | What it does |
|---|---|
/status |
Workspace, model, mode, session id, message count |
/context |
Context-window usage with a progress bar, message breakdown, tool count |
/model <slug> |
Switch models mid-session. Tab-completes from the catalog. Rejects unknown slugs with did-you-mean suggestions |
/mode <name> |
Switch permission mode (read-only, plan, workspace-write, danger-full-access, prompt) |
/clear |
Start a fresh session in this workspace |
/cd <path> |
Tear down runtime, rebootstrap in a new workspace, carry conversation forward |
/save <key> |
Persist current setting to .scaiflux.json. <key> ∈ model / mode / max-tokens / all. --global writes to ~/.scaiflux/settings.local.json |
/session list |
List stored sessions for this workspace |
/session delete <id> |
Remove one (refuses to delete the active session) |
/session clear |
Wipe every session for this workspace |
/memory |
Project memory and auto-memory tools |
/reveal |
Print the last tool result in full (the REPL keeps it collapsed by default) |
/banner |
Reprint the banner at the current terminal width |
| `/poolnoodle on | off |
/exit or Ctrl-D |
Leave the REPL |
5. Persisting settings#
Most REPL settings are session-scoped by default. Pin them with
/save:
1 2 3 4 5 | |
Next launch in this workspace starts on that model.
Use --global when the preference should apply across every
workspace (e.g. your default permission mode):
1 2 | |
Save order: the config hierarchy merges user-home → project → local,
later wins. So --global acts as a fallback; per-workspace saves
always override it.
6. Context management, in plain English#
Context windows fill up. ScaiFlux has a few layers between "you're fine" and "the model has no room to think":
- Pre-flight cap —
max_tokensis auto-derived from each model's context window (half the window, capped at 16 384). Override with--max-tokensor via.scaiflux.json → model_limits.<slug>.max_output_tokens. - Dynamic bound — every turn,
max_tokensgets clipped against remaining context minus a small safety margin. - Ring buffer — only the 5 most-recent tool results ride through
at full size. Older ones become short stubs (or LLM-generated
summaries if you've enabled
summarizer.auto_summarize_tool_results). - Warning injection — cross 80 % and the model gets a user-role note asking it to wrap up. Cross 95 % and the note upgrades to "stop, summarise now".
- Auto-compaction — at 100 k cumulative input tokens
(overridable via
SCAIFLUX_AUTO_COMPACT_INPUT_TOKENS), older messages are evicted. Priority-based: tool exchanges go first, user messages last.
Watch it live with the % ctx readout on the spinner + footer, and
inspect with /context any time:
1 2 3 4 5 6 | |
7. Memory#
Two kinds:
- Project memory —
SCAIFLUX.md(andAGENTS.md,.scaiflux/instructions.md) walked up from the workspace. Loaded into the system prompt each turn, capped at 4 KB per file. Edit in an editor; changes land on the next bootstrap. - Auto-memory — the model can call a
memory_writetool to save notes across conversations (~/.scaiflux/memory/<workspace-slug>/). Notes are inlined into the system prompt on each turn, capped at 12 KB total. Types:user,feedback,project,reference.
You almost never have to think about auto-memory — if you tell the model "remember I prefer pytest over unittest", it calls the tool and the preference sticks for every future session in that workspace.
8. Poolnoodle mode 🛟#
An easter egg. Toggle on:
1 2 3 4 | |
The persona stanza lands at the top of the system prompt and
anchors the voice for the rest of the session. Still the same
engineering discipline underneath — it just teases the situation
instead of answering like a dry form letter. /poolnoodle off
returns to the default voice without drama.
The banner gains a gadgets row when a gadget is active so you
can tell at a glance.
9. Leaving cleanly#
/exitor Ctrl-D at the prompt.- Session state persists automatically — every message lands on disk as it happens, so even a hard crash loses at most the in-flight model response.
- Picker on the next launch lets you resume exactly where you stopped.
Where next#
USAGE.md— full reference for subcommands, flags, and slash commands.QUICKSTART.md— first-install flow with auth setup.PHILOSOPHY.md— why ScaiFlux is shaped the way it is..scaiflux.json— the config file. The schema athttps://scaiflux.dev/schema/scaiflux.schema.jsondocuments every option your editor will autocomplete.