返回 DeepSeek-Reasonix
CLI.md
根目录 / docs / CLI.md
1 # Reasonix CLI Reference
2
3 <a href="../README.md">README</a>
4 &nbsp;·&nbsp;
5 <a href="./CLI.zh-CN.md">简体中文</a>
6 &nbsp;·&nbsp;
7 <a href="./GUIDE.md">Guide</a>
8
9 This reference covers interactive sessions, one-shot automation, session
10 resume, permission flags, and the most useful in-session commands. For provider
11 configuration, plugins, and sandbox policy, see the [Guide](./GUIDE.md).
12
13 ## Start a session
14
15 ```sh
16 reasonix
17 reasonix --model deepseek-pro
18 reasonix --effort high
19 reasonix --dir /path/to/project
20 ```
21
22 Ordinary requests always enter the executor. There is no automatic simple /
23 light / full task mode to pick. The dedicated planner runs only for an
24 explicit Plan, an approval boundary, or Goal start.
25
26 Running `reasonix` without a subcommand starts the interactive terminal UI. If
27 the selected connection has no credential, the local connection picker opens
28 instead of sending a request. History and local commands remain available while
29 authentication is incomplete.
30
31 | Flag | Purpose |
32 | --- | --- |
33 | `--model NAME` | Select a configured provider or `provider/model` reference. |
34 | `--effort LEVEL` | Override reasoning effort for this session. |
35 | `--max-steps N` | Set a one-off maximum tool-call round budget; `0` uses automatic execution. |
36 | `--dir PATH` | Change the workspace root before loading config and tools. |
37 | `--add-dir PATH` | Add another writable tool directory; repeat for multiple directories. |
38 | `-c`, `--continue` | Resume the most recent session. |
39 | `-r`, `--resume [QUERY]` | Open the session picker, or resume a matching session. |
40 | `--copy` | Continue in a writable copy of the resumed session. |
41 | `--allowed-tools RULES` | Add session-only permission allow rules. Repeatable; `--allowedTools` is an alias. |
42 | `--permission-mode MODE` | Start with a specific permission posture. |
43 | `--dangerously-skip-permissions` | Deprecated compatibility flag; migrates conservatively to `workspace-write`. Use `--permission-mode danger-full-access` for YOLO. |
44
45 Flags may appear before or after the prompt where applicable.
46
47 ## Update the native CLI
48
49 ```sh
50 reasonix upgrade # install the latest official release
51 reasonix upgrade --check # report the target without installing
52 reasonix upgrade --force # reinstall the current official release
53 ```
54
55 The updater selects only strict `vX.Y.Z` non-prerelease GitHub Releases. During
56 the 1.x compatibility period, old channel arguments and `--channel` are still
57 accepted, but resolve to the same official release and print a deprecation
58 notice. Legacy `[cli].update_channel` values are ignored and removed the next
59 time Reasonix saves the configuration. The `reasonix update` alias behaves the
60 same way.
61
62 ## Configure providers
63
64 ```sh
65 reasonix setup # manage the user-global config
66 reasonix setup --local # manage ./reasonix.toml
67 reasonix setup /path/to/config.toml
68 ```
69
70 In an interactive terminal, `reasonix setup` is a staged provider manager. It
71 lists configured providers and lets you:
72
73 - add OpenAI-compatible or Anthropic-compatible providers;
74 - edit endpoints and model lists;
75 - update API keys or test the connection and refresh models;
76 - choose the default model; and
77 - remove providers.
78
79 Choose **Save and exit** to review and confirm the pending operations. Canceling
80 discards them. Setup reloads the latest config while saving: unrelated desktop
81 or CLI changes are retained, while an overlapping change is reported as a
82 conflict instead of being overwritten.
83
84 Provider definitions contain only the `api_key_env` variable name. Key values
85 are stored in the shared Reasonix home `.env`, even with `--local`. Adding,
86 replacing, or explicitly clearing a key creates a fresh private credential slot
87 and atomically switches only the selected connection to it. Existing fixed
88 variables remain readable and migrate only when that connection is edited.
89
90 Inside the TUI, `/setup` opens the same connection flow and `/auth` is an alias.
91 The key field is masked; press `Ctrl+T` to test the draft connection, Enter to
92 save, or Escape to cancel. `/?` is an alias for `/help`. Authentication that is
93 not ready never turns ordinary input into a provider request.
94
95 ```sh
96 reasonix doctor credentials
97 reasonix doctor credentials --json
98 reasonix doctor credentials --probe
99 reasonix doctor credentials --repair --dry-run
100 reasonix doctor credentials --repair
101 ```
102
103 The default diagnostic is read-only. `--probe` tests temporary create and
104 atomic rename without replacing `.env`. Repair is limited to a current-user-
105 owned regular file inside Reasonix home; it does not take ownership, remove deny
106 rules, grant `Everyone`, follow links/reparse points, or kill a file holder.
107
108 ### Configure fee display currency
109
110 Use the user-global command to inspect or select the display currency:
111
112 ```sh
113 reasonix config currency # show the saved and resolved currency
114 reasonix config currency auto # wallet hint, then original price currency
115 reasonix config currency CNY
116 reasonix config currency USD
117 ```
118
119 `auto` remains unresolved in configuration. With one valid wallet currency it
120 can become a runtime session hint; otherwise CLI uses the original currency or
121 sorted currency buckets. Language and host locale never select a price table.
122 The preference is user-global and cannot be overridden by project
123 `reasonix.toml`; `--local` is therefore not supported. Custom prices are preserved.
124
125 In an interactive session, `/currency` shows the saved and resolved values, and
126 `/currency auto|CNY|USD` changes the preference and refreshes the current
127 runtime without discarding the conversation.
128
129 ### Configure automatic compaction
130
131 The desktop app and CLI share the user-global automatic compaction threshold.
132 Inspect the effective percentage and its source, set the global default, or add
133 a project override:
134
135 ```sh
136 reasonix config compact-ratio # show effective value and source
137 reasonix config compact-ratio 75 # set the user-global default
138 reasonix config compact-ratio --local 75 # override in ./reasonix.toml
139 ```
140
141 The editable range is 30–85%, with 80% as the built-in default. Lower values
142 compact earlier, may increase summary calls and cost, and may reduce
143 prompt-prefix cache reuse; higher values retain more context before compaction.
144 Below the threshold, complete tool results may
145 increase ordinary request cost; at pressure they are durably pruned before the
146 cache-aligned summary runs. Project `reasonix.toml` takes precedence over
147 the user config. Changes apply to new CLI sessions; an already-running session
148 keeps the threshold it loaded at startup.
149
150 ## One-shot and automation
151
152 Use `-p` / `--print` when a script needs only the final answer:
153
154 ```sh
155 reasonix -p "summarize this repository"
156 reasonix -p "summarize this repository" --output-format json
157 reasonix run "implement the TODOs in main.go"
158 reasonix run --auto "implement the TODOs in main.go"
159 echo "explain this code" | reasonix run
160 ```
161
162 `reasonix run` keeps the normal streamed terminal presentation unless `-p` or a
163 structured output format is selected. It also accepts `--model`,
164 `--max-steps`, `--effort`, `--dir`, `--add-dir`,
165 `--continue`, `--resume QUERY`, `--copy`, `--allowed-tools`, `--permission-mode`,
166 and `--auto` / `-y` (legacy aliases for `--permission-mode workspace-write`).
167
168 ### Benchmark arms
169
170 `--ablate` switches whole subsystems off so a benchmark can attribute a change
171 in success rate to one of them. It accepts a comma-separated list of `evidence`,
172 `planner`, `subagent`, `retrieval` and `compaction`, plus `none` (the default,
173 everything on) and `all`. Sub-agents inherit the parent's arm, and the arm name
174 is written to the `--metrics` file so a recorded run is self-describing.
175
176 ```sh
177 reasonix run --ablate evidence,planner --metrics run.json "fix the failing test"
178 ```
179
180 This is a measurement tool, not a tuning knob: switching a subsystem off makes
181 Reasonix worse at the work it was added for.
182
183 ### Trajectory recording
184
185 `--trajectory PATH` appends the run's full event stream — tool dispatches and
186 results with absolute start/end times, reasoning, retries, readiness and
187 recovery decisions — as one timestamped, sequenced JSONL record per event, so
188 a run can be replayed and its time attributed offline (tool execution vs. the
189 model thinking between calls). Records reuse the shared `eventwire` JSON
190 contract under an `event` key, wrapped in `schema_version`, `seq`, and `ts`
191 (unix ms). Every completed line survives a killed run. Unlike `--events-jsonl`,
192 the file contains prompts, tool arguments, and reasoning: treat it with the
193 same care as a session transcript.
194
195 ```sh
196 reasonix run --metrics run.json --trajectory run.trajectory.jsonl "fix the failing test"
197 ```
198
199 ### Turn phases
200
201 While a turn runs, the host publishes a content-free phase so a frontend can
202 say what the turn is doing. The CLI shows it on the spinner line; the desktop
203 app shows it in the composer.
204
205 These phases describe execution timing, not verification evidence. Desktop
206 check-result cards follow actual running verification tools, not phase names.
207
208 | Phase | Emitted when | `capability_phases` bucket |
209 | --- | --- | --- |
210 | `working` | the turn starts, after each tool batch returns, after model generation | `ProviderWaitMs` |
211 | `checking` | a tool batch is about to execute | `ToolExecMs` |
212 | `verifying` | an actual verification tool runs | `ToolExecMs` |
213
214 A phase is billed to its bucket when the next phase opens, so the durations in
215 `--metrics` split a turn into model wait versus tool execution without replaying
216 the run. Spans under a millisecond are dropped, and a turn that ends through an
217 error or a pause rather than an answer does not bill its last span, so the
218 buckets read as a lower bound rather than a full partition of the turn.
219
220 An approval prompt raised inside a tool batch bills to `ToolExecMs`: the batch
221 stays open from `checking` until the next `working`, and no user-wait phase is
222 emitted. `ReviewMs`, `SubagentWaitMs`, `UserWaitMs` and `CompactMs` stay zero
223 because nothing opens those phases inside a turn — `reviewing` is published only
224 at run exit, after the turn's phase clock has already closed.
225
226 ### Output formats
227
228 | Format | Behavior |
229 | --- | --- |
230 | `text` | Human-readable text. With `-p`, prints only the final answer. |
231 | `json` | Emits one final result object. |
232 | `stream-json` | Emits one shared `eventwire` JSON object per line, followed by the final result object. |
233
234 ```sh
235 reasonix -p "list the risky changes" --output-format text
236 reasonix -p "summarize the diff" --output-format json
237 reasonix run "run the tests" --output-format stream-json
238 ```
239
240 The final structured object has this shape:
241
242 ```json
243 {
244 "type": "result",
245 "subtype": "success",
246 "is_error": false,
247 "duration_ms": 123,
248 "num_turns": 1,
249 "result": "...",
250 "session_id": "...",
251 "total_cost": 0,
252 "currency": "USD",
253 "total_cost_usd": 0,
254 "usage": {
255 "input_tokens": 0,
256 "output_tokens": 0,
257 "cache_read_input_tokens": 0,
258 "cache_creation_input_tokens": 0
259 }
260 }
261 ```
262
263 `total_cost` is present only when a single `selected` display amount exists (ISO
264 code in `currency`). Prefer the structured `cost_quote` field when present: it
265 carries the original estimate, `original_totals`, occurrence-time valuations
266 (`official_table` for dual-region public prices), `cost_complete`,
267 `display_complete`, `display_status`, and `billing_mode` (`payg` or `subscription_equivalent` for
268 pay-as-you-go equivalent estimates such as MiMo Token Plan).
269
270 `total_cost_usd` remains a numeric compatibility alias when `total_cost` exists
271 and does **not** imply USD. Mixed original currencies no longer fail the run:
272 `cost_complete` remains true when usage/pricing facts are known,
273 `display_complete` is false, and `original_costs`/`original_totals` list per-ISO
274 totals so clients never invent a cross-currency sum.
275
276 Global display preference is `[billing].display_currency` (`auto|CNY|USD`);
277 legacy `[desktop].currency` still migrates. Provider list prices use each
278 entry's frozen `billing_currency` and are never rewritten by display switches.
279 Diagnose with `reasonix doctor billing`.
280
281 Execution failures use `subtype: "error_during_execution"` and
282 `is_error: true`. Structured modes keep runtime errors in JSON instead of also
283 printing a duplicate human-readable error. Authentication failures also include
284 optional `error_code`, `authentication_status`, and `recovery_actions` fields.
285 The same fields appear on the final `run_done` record from `--events-jsonl`.
286 For example, a missing key reports `missing_credential` and actions such as
287 `configure_credentials`, `select_model`, and `diagnose_credentials`; no model
288 request is made.
289
290 The completion validator has been removed. A clean model stop without tool
291 calls ends the turn directly; a response with tools continues through the tool
292 loop, and a truly empty response is retried at the frozen-request boundary.
293 Legacy `completion_validation`, `completion_evaluator_model`, and
294 `REASONIX_COMPLETION_VALIDATION_MODE` settings remain readable but are ignored
295 and are no longer emitted by the config renderer. Explicit budgets, tool-safety and protocol recovery boundaries remain active.
296 Goal completion is a model declaration; no host quality gate or independent
297 Goal evaluator runs. See [migration details](EXECUTION_MODEL_SIMPLIFICATION.md).
298
299 ### Redacted machine interfaces
300
301 Use the dedicated event flag when an automation needs lifecycle telemetry but
302 must not receive prompts, reasoning, tool arguments, tool output, or approval
303 text:
304
305 ```sh
306 reasonix run --events-jsonl "run the focused tests"
307 ```
308
309 Every line has `schema_version`, `sequence`, and `kind`; the final line is
310 `kind: "run_done"`. `--events-jsonl` is intentionally separate from the richer
311 `--output-format stream-json` contract and cannot be combined with
312 `--output-format`.
313
314 The following read-only commands expose persisted state without transcript,
315 label, command, output, path, PID, or host-name content. Here, read-only means
316 the commands do not mutate transcript, runtime, recovery, or query state. The
317 first redacted-machine invocation may initialize a private identity key in the
318 Reasonix user-state directory:
319
320 ```sh
321 reasonix session list --json [--dir SESSION_DIR | --project-root PATH]
322 reasonix session show <machine-session-id> --json [--dir SESSION_DIR | --project-root PATH]
323 reasonix session status <machine-session-id> --json [--dir SESSION_DIR | --project-root PATH]
324 reasonix session recovery [<machine-session-id>] --json [--dir SESSION_DIR | --project-root PATH]
325 reasonix task list --json [--dir SESSION_DIR | --project-root PATH] [--session MACHINE_SESSION_ID]
326 reasonix task show <task-id> --json [--dir SESSION_DIR | --project-root PATH] [--session MACHINE_SESSION_ID]
327 reasonix task monitor list --json [--dir PROJECT_DIR]
328 reasonix task monitor status <task-id> --json [--dir PROJECT_DIR]
329 reasonix task monitor events <task-id> --json|--jsonl [--dir PROJECT_DIR] [--after N] [--follow]
330 reasonix hook list --json [--project-root PATH] [--home-dir PATH]
331 reasonix hook status --json [--project-root PATH] [--home-dir PATH]
332 ```
333
334 For `session` and `task`, `--dir` explicitly selects the session storage
335 directory, while `--project-root` resolves the selected project's session
336 store. The two options cannot be combined. Without either option, Reasonix
337 selects the current project's session store.
338 For `hook`, `--dir` is an alias for `--project-root`.
339 `hook list` reports `active` or `invalid`; `invalid` means the
340 configured event cannot execute because its event, command/context source, or
341 tool-event matcher is unusable. Matchers on non-tool events are ignored.
342
343 Machine session IDs are keyed opaque hashes, not transcript file names. They
344 remain stable for the same session and Reasonix user-state directory, while a
345 different installation key produces unrelated IDs and prevents offline guesses
346 from timestamps or model labels. Preserve the private identity key when moving
347 the Reasonix state directory if automation depends on existing machine IDs.
348 Task `finished_at` is empty while a task is running, and
349 `artifact_complete=true` is emitted only for a terminal task whose persisted
350 artifact exists. A `running` record without a live session lease is reported as
351 `interrupted`; opening that session also repairs the persisted lifecycle state.
352
353 Schema compatibility rules for version 1:
354
355 - consumers must ignore unknown fields;
356 - fields are not removed or retyped within the same schema version;
357 - empty collections are encoded as `[]`;
358 - argument errors exit with status `2`, state/query errors with status `1`;
359 - machine-command errors are JSON objects with a stable `error.code`.
360
361 ## Resume sessions
362
363 ```sh
364 reasonix --continue
365 reasonix --resume
366 reasonix --resume provider-config
367 reasonix --resume <session-id>
368 reasonix --resume provider-config --copy
369 ```
370
371 - `--continue` resumes the newest saved session immediately.
372 - Bare `--resume` opens the searchable picker in an interactive terminal.
373 - `--resume QUERY` accepts an exact session ID or path, or a unique title or
374 preview substring. Missing and ambiguous matches fail with a descriptive
375 error.
376 - `--resume=true` and `--resume=false` remain accepted for compatibility.
377 - `--copy` leaves the original transcript untouched and continues in a new
378 writable session. Use it when another Reasonix process owns the original.
379
380 For one-shot runs, `reasonix run --resume QUERY "task"` accepts a session file
381 path, a session ID, or an opaque machine session ID from `--events-jsonl` /
382 `reasonix session show --json`. Session leases prevent the desktop app and CLI
383 from writing the same transcript concurrently.
384
385 ## Permissions
386
387 ```sh
388 reasonix --permission-mode read-only
389 reasonix --permission-mode workspace-write
390 reasonix --permission-mode danger-full-access
391 reasonix -p "run the focused tests" --allowed-tools "Bash(go test ./...)"
392 ```
393
394 | Preset | Behavior |
395 | --- | --- |
396 | `read-only` | Read the workspace; writes and external side effects require a scoped authorization. |
397 | `workspace-write` | Write inside the workspace and private session temporary directory. This is the default. |
398 | `danger-full-access` | Run as the current OS user without Reasonix filesystem or network sandboxing. Explicit host deny rules still apply before launch. |
399
400 Inline scripts, pipes, substitutions, and shell `-c` forms follow the same
401 preset and sandbox boundary as other commands. Syntax alone never creates an
402 approval request.
403
404 `--allowed-tools` is a session permission override, not a provider tool-schema
405 filter. Rules may be comma- or space-separated, and the flag is repeatable.
406 Configured deny rules always win over command-line allow rules.
407
408 In non-interactive runs (`reasonix run` / `-p`) there is no prompt to answer.
409 `read-only` therefore fails closed for writes and side effects unless a narrow
410 authorization was supplied at startup. `workspace-write` runs normal builds,
411 tests, pipes, and inline scripts inside the OS sandbox. `danger-full-access`
412 must be explicit and still cannot bypass configured deny rules.
413
414 ## Additional directories
415
416 ```sh
417 reasonix --add-dir ../shared
418 reasonix -p "update both projects" \
419 --add-dir ../frontend \
420 --add-dir ../backend
421 ```
422
423 Relative paths resolve from the workspace root and must already exist as
424 directories. Reasonix resolves symlinks, removes duplicates, and extends the
425 file-writer and sandboxed Bash write boundaries for the session. These additions
426 are runtime-only and are not written to configuration.
427
428 ## Interactive controls
429
430 The `/model`, `/provider`, and `/resume` commands use searchable pickers.
431 Approval prompts use the same row-selection behavior while retaining their
432 single-key shortcuts.
433
434 | Key | Action |
435 | --- | --- |
436 | `Up` / `Down`, `Ctrl+P` / `Ctrl+N` | Move through picker or approval rows. |
437 | `j` / `k` | Move while the search is empty; after search input starts, enter `j` / `k` as query text. |
438 | Type | Filter a searchable picker. |
439 | `Enter` | Select the highlighted row. |
440 | `Esc` | Cancel the current picker or approval. |
441 | `y` / `a` / `n`, number keys | Allow once, allow the displayed scope for this session, or deny. |
442 | `Shift+Tab` | Cycle Read only → Workspace write → YOLO → Plan. |
443 | `Ctrl+Y` | Toggle YOLO; the runtime permission preset is `danger-full-access`. |
444
445 The responsive footer keeps interaction state on the left and, when space
446 allows, places model and effort on the right. Its second row shows
447 available repository and session telemetry such as cache hit rate, context use,
448 compaction headroom, background jobs, and balance. `ready` means the composer is
449 idle; that slot changes when a picker, approval, image paste, shell mode, or
450 other interaction needs attention. Narrow terminals move or compact complete
451 groups instead of cutting labels in half. Visible labels follow `/language`.
452
453 Use `/theme auto|light|dark` to select the terminal background mode, or choose a
454 named accent from `/theme`. Both composer borders, the insertion cursor,
455 selection, scrollbar, and footer use the active CLI theme. See
456 [Keyboard shortcuts](./GUIDE.md#keyboard-shortcuts) for transcript navigation,
457 multiline input, rewind, and clipboard controls.
458
459 Clipboard actions are deliberately split by content type. Local transcript
460 and composer selections use the native system clipboard and report success only
461 after that write completes; SSH falls back to an explicitly labelled OSC 52
462 request. Text paste remains the terminal's bracketed-paste action (`Cmd+V` on
463 macOS and the terminal's configured shortcut elsewhere). While Reasonix owns the
464 mouse in a local session, right-click with no selection reads clipboard text
465 through the same paste path; right-click with a selection copies it. Over SSH,
466 use the terminal paste shortcut because the remote process cannot read the local
467 clipboard; `/mouse` restores the terminal's native right-click menu. Image paste
468 is application-owned: use `Ctrl+V` on macOS/Linux, `Alt+V` on Windows, or
469 `/paste-image`; the footer shows `Pasting image…` until the attachment token is
470 ready. Where the terminal forwards that shortcut instead of pasting itself, a
471 clipboard holding no image falls back to a text paste, so the key never swallows
472 plain text.
473
474 ## In-session commands
475
476 Type `/help` in an interactive session for the complete command list. Slash
477 completion, help, dispatch, and aliases are generated from the same registry, so
478 the displayed list matches the commands the TUI accepts.
479
480 | Command | Purpose |
481 | --- | --- |
482 | `/continue-checks [guidance]` | Resume the immediately preceding paused task-completion check while preserving its verified tool evidence. The command is one-shot and refuses stale cards after another user turn. |
483 | `/model` | Search configured models and switch the active model. |
484 | `/provider` | Choose a provider, then choose one of its configured models. |
485 | `/resume` | Search recent sessions and switch to one. |
486 | `/takeover` | Take over the last refused session (or a listed entry) from the resident serve: this CLI becomes the writer and remote viewers become read-only spectators until they reclaim. After a desktop reclaim it re-takes the remembered session directly; a session no runtime holds any more is simply resumed. |
487 | `/status` | Show model, effort, cache, Git, background jobs, and balance details. |
488 | `/theme [auto\|light\|dark\|style]` | View or change the CLI background mode and accent palette. |
489 | `/currency [auto\|CNY\|USD]` | View or change the user-global fee display currency and refresh the runtime. |
490 | `/paste-image` | Read a clipboard image and insert an editable attachment token. |
491 | `/mouse` | Toggle in-app mouse selection, scrollbar, and wheel handling; SSH sessions start with capture off so the terminal's native selection works. |
492 | `/effort` | View or change reasoning effort. |
493 | `/output-style` | Select an answer style. |
494 | `/verbose` | Toggle expanded reasoning display. |
495 | `/sandbox` | Inspect sandbox status. |
496 | `/goal [objective]` | Start a continuous goal, or inspect its runtime statistics. |
497 | `/goal status` | Show the active goal plus turns, requests, tokens, work time, and the last continuation reason. |
498 | `/goal pause` | Pause the running goal (keeps todos, Delivery checkpoint, and runtime history). |
499 | `/goal resume` | Resume a manually paused or genuinely blocked goal without changing a numeric quota. |
500 | `/goal clear` | End goal mode permanently. |
501 | `/docs [question]` | Show the embedded corpus identity, or search it locally and ask the configured AI to answer from version-matched evidence. |
502 | `/reasonix:docs [question]` | Preferred built-in fallback when an existing custom command or compatible plugin/skill alias owns `/docs`; if this spelling is also owned, the menu selects the next free `reasonix:`-qualified name without displacing it. |
503 | `/mcp`, `/skills`, `/hooks` | Inspect and manage extensions. |
504 | `/remember <note>` | Append a standing note to the project instruction document; `# <note>` is a shortcut. |
505 | `/memory [subcommand]` | Inspect instructions, memory provenance, recall, revisions, and recovery. |
506 | `/rewind` | Restore conversation and/or code to an earlier turn. |
507 | `/tree`, `/branch`, `/switch` | Inspect or navigate conversation branches. |
508 | `/reload` | Reload the agent runtime (extensions, tools, skills, commands, hooks, providers) while keeping the session. Queued once while a turn runs, then fail-atomic: a failed rebuild keeps the current runtime. |
509
510 Switching model or effort rebuilds the runtime while preserving the
511 active conversation, session-scoped permission overrides, additional directory
512 access, and session ownership. `/reload` uses the same fail-atomic rebuild.
513 Execution modes no longer exist: planning, verification, and review strength
514 follow task risk per turn.
515
516 `/preset`, `/work-mode`, and `/profile` remain hidden compatibility commands.
517 Recognized legacy values are accepted, report that the setting is retired, and
518 leave the session on standard execution; unknown values still return an error.
519
520 ## Session catalog diagnostics
521
522 The desktop session catalog is a disposable SQLite query projection; transcript
523 JSONL and sidecars remain authoritative. Inspect it read-only or replace only
524 the projection:
525
526 ```sh
527 reasonix doctor sessions [--json]
528 reasonix sessions reindex [--json]
529 reasonix sessions reindex --dir /path/to/sessions --dir /another/path
530 ```
531
532 Without `--dir`, reindex includes global sessions and all projects saved by the
533 desktop app. See [Session Catalog and Desktop Startup](./SESSION_CATALOG.md) for
534 failure, migration, and data-safety guarantees.
535
536 History search uses a separate disposable projection:
537
538 ```sh
539 reasonix doctor catalogs [--json]
540 reasonix catalogs reindex history [--dir PATH ...] [--json]
541 ```
542
543 See [History Search Catalog](./HISTORY_SEARCH_CATALOG.md).
544 Usage statistics use a separate disposable rollup projection:
545 reasonix catalogs reindex usage [--json]
546 See [Usage Catalog](./USAGE_CATALOG.md).
547
548 Inspect or rebuild the disposable task projection independently:
549
550 ```sh
551 reasonix doctor catalogs [--json]
552 reasonix catalogs reindex tasks [--project PATH ...] [--json]
553 ```
554
555 See [Task Catalog](./TASK_CATALOG.md) for the authoritative FileStore boundary,
556 cross-project routing, and rebuild behavior.
557
558 ### Memory diagnostics and recovery
559
560 Bare `/memory` shows all active project/global facts without hiding same-name
561 entries. Facts include their stable ID, revision, scope, type, freshness, and
562 description. Slash completion offers the available subcommands, active IDs and
563 names, and owned archive paths.
564
565 | Command | Purpose |
566 | --- | --- |
567 | `/memory instructions` | Show resolved instruction precedence, directories, imports, and diagnostics. |
568 | `/memory recall` | Explain the latest automatic recall query, hits, scores, reasons, freshness, and budget. |
569 | `/memory revisions <id-or-name>` | Show the active revision and immutable history. |
570 | `/memory restore <id-or-name> <revision>` | Restore old content as a new monotonic revision. |
571 | `/memory archived` | List archived facts and their owned paths. |
572 | `/memory recover <archive-path>` | Recover an archive as a new revision without overwriting active data. |
573
574 These commands run against the active session controller. When the session
575 lives on a remote host (`reasonix remote connect` / a desktop remote web
576 window), they use the remote memory catalog and never fall back to local
577 desktop memory. See [Context Engine v2](./SESSION_MEMORY_RETRIEVAL.md) for
578 authority, automatic recall, write confirmation, and migration behavior.
579
579 lines MARKDOWN