# Configuration claude-react-web reads its server-side configuration from a JSON file at startup. A complete example is provided in [`config.example.json`](./config.example.json). ## Location | Path | Purpose | | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `~/.claude-react-web/config.json` | Default config location | | `--state-dir ` CLI flag | Override the entire state directory; `config.json` is read from there | | `--config ` CLI flag | Read/write `config.json` at an explicit path (leading `~` expands to the home dir); wins over `--state-dir` for the config file only | The file is optional — if missing or malformed, built-in defaults are used silently. ## Fields ### `modelList` | | | | ------- | ----------------------------------------------------------------------------------------------- | | Type | `string[]` | | Default | `["anthropic/claude-sonnet-4-20250514", "claude-opus-4-20250514", "claude-haiku-3-5-20241022"]` | Available models for new sessions, shown as a dropdown in the UI. The **first entry** becomes the default model for new sessions. ```json { "modelList": ["anthropic/claude-sonnet-4-20250514", "claude-opus-4-20250514", "claude-haiku-3-5-20241022"] } ``` The CLI `--model` flag takes priority over the first entry when launching. --- ### `modelContextWindows` | | | | ------- | -------------------------------- | | Type | `Record` | | Default | unset (no per-model overrides) | Optional native-provider context-window overrides on each entry of `profiles[]`. Keys must exactly match the full model id sent by that profile, including any vendor prefix; values must be positive safe integers. Overrides never leak into another profile, even when both use the same model id. ```json { "profiles": [{ "id": "gateway-a", "name": "Gateway A", "baseUrl": "https://gateway.example", "modelList": ["vendor/model-x"], "modelContextWindows": { "vendor/model-x": 512000 } }] } ``` For an exact `{profile, baseUrl, model}` route, an override wins. Otherwise native queries the Anthropic Messages-compatible model endpoint for a positive `max_input_tokens`; confirmed values may be larger or smaller than 200K. Missing, unsupported, invalid, or failed discovery falls back to 200K without blocking message sends. Other response fields and other protocols are not interpreted as context capacity. Web import treats this mapping as route configuration. A source mapping replaces the target mapping wholesale. If the source imports `modelList` or `baseUrl` without a mapping, the target's old mapping is cleared so it cannot apply to the new route; importing neither routing field leaves it unchanged. A legacy top-level `modelContextWindows` migrates into `profiles[0]` on first load. --- ### `modelCapabilities` | | | | ------- | -------------------------------------------------- | | Type | `Record` | | Default | unset (shipped catalog, then the fail-soft default) | Optional per-route capability declarations on each entry of `profiles[]`. Keys must exactly match the full model id sent by that profile — a gateway prefix makes it a **different route** (`ppio/pa/claude-opus-4-8` is not `claude-opus-4-8`), because only the operator knows what that endpoint actually serves. Declarations never leak into another profile. ```json { "profiles": [{ "id": "gateway-a", "name": "Gateway A", "baseUrl": "https://gateway.example", "modelList": ["tongyi/qwen4-max"], "modelCapabilities": { "tongyi/qwen4-max": { "thinking": true, "effort": ["low", "medium", "high"] } } }] } ``` Resolution for one route is, in order: 1. the profile declaration above (field by field — a declaration that only sets `thinking` inherits the rest from step 2); 2. the shipped catalog (`shared/model-capability.ts`): a static, exact-id table of the Claude routes this app ships and documents, so the default `modelList` keeps its thinking/effort/fast-mode chips without any config; 3. the route default: `thinking: false`, `effort: []`, `fastMode: false`. The fail-soft default is deliberate: an undeclared route on a gateway is far more likely to reject an unexpected `thinking` field (400, which kills the turn) than to ignore it, while a hidden chip is a one-line config fix. Declaring `"thinking": true` is what makes a non-Claude reasoning route reachable. Fields: `thinking` (boolean — `true` accepts a thinking config, `false` is an explicit opt-out), `effort` (subset of `low | medium | high | xhigh | max`; a pinned level outside the list is omitted at request-build time rather than sent as a 400), `fastMode` (boolean; Anthropic-specific). An empty `{}` is a valid "supports nothing" declaration. Coercion is load-time and never blocks startup: a malformed entry (non-object, unknown field such as a misspelled `thinkingg`, wrong type, invalid effort level) is dropped with a warning and the rest of the mapping survives — the same discipline as `modelContextWindows`. Extra model ids that are not in `modelList` are legal (declare before you add). Web import does **not** transfer this mapping: a declaration describes one route's wire behavior on one endpoint, and the importing machine's gateway is not that endpoint. (Context windows are a model fact and do travel; capabilities are a route fact and do not.) #### Editing from Settings Settings → Providers edits this map through the profile routes, so the file contract above holds for hand-edited `config.json` too: - **Read.** `GET /profiles` projects `modelCapabilities` on each profile (a copy, not the live object). The key is absent when nothing is declared — the wire never synthesizes `{}`. The editor derives per-field display values from it at render time (`declared` / `catalog` / `default`), so an inherited field shows what it inherits (`Inherit (on)`), not a blank. - **Write is whole-map.** `PUT /profiles/:id` replaces the entire mapping; there is no per-key patch. `"modelCapabilities": null` deletes it ("Restore defaults"). Fields the user leaves on `Inherit` are omitted from the payload, and deleting a model from `modelList` deletes its declaration with it (renaming migrates it, and a collision keeps the new id with a notice). - **Semantic errors are refused, not dropped.** A payload that fails validation returns `400 {error, issues: [{model, field?, reason, detail?}]}` with `reason` one of `not-an-object`, `empty-model-id`, `unknown-field`, `thinking-not-boolean`, `fastMode-not-boolean`, `effort-not-array`, `invalid-effort`. Nothing is written: the profile write throws before the atomic write, so a refused save leaves the file byte-identical. (Load-time coercion stays warn-and-drop — a hand-edited file must still boot.) The rules live once, in `shared/model-capability.ts` (`declarationIssues`), so the editor can mark the offending field from its draft without waiting for the round trip; the `PUT` refusal is still what decides whether anything was stored, and the mark disappears as soon as the offending control is corrected. - **Success receipt separates "saved" from "in effect".** `PUT` answers `{ok, profile?, apply: {changed, pending}}`. `changed` is true only when the stored declaration map actually differs; `pending` lists the sessions that would still resolve the *old* capabilities — computed per session by comparing `resolveModelCapabilities(spawnProfile, model)` with the new profile on the same model, so a session that never uses a route you edited is not "behind", and a declaration that repeats the catalog's own values is not a change. Managing to save is not the same as having applied: a session takes capability snapshots at spawn and keeps them, because its chips and its wire request must agree. `POST /profiles/:id/restart-sessions` with `{sessionIds}` answers `{ok, restarted, busy, skipped, pending}`: a session mid-turn goes to `busy` (the restart returns without respawning it, so it is not counted as applied), an unknown or unloaded id goes to `skipped`, and `pending` is recomputed afterwards — a busy session is still in it, so the same action can be retried after the turn instead of quietly claiming success. - **Template copies are filtered.** Creating a profile from another profile or from the stock template copies declarations only for models that survived into the new `modelList`; a declaration for a route the new profile does not serve is not carried over. - **Orphans survive.** Keys outside `modelList` are legal and preserved across load and save ("declare before you add"). The editor lists them separately with *Add to model list* / *Remove*, keeps the block visible even when the profile serves no models, and prints a refusal reason under the row (an orphan has no editor controls to mark). A declaration tells the app how to shape the request; it does not promise the endpoint accepts it. A gateway that rejects an unexpected field answers 400 at request time, which is why the fail-soft default above exists. --- ### `recapModel` | | | | ------- | ---------------------------------------------- | | Type | `string` | | Default | `""` (unset — the session's aux model is used) | Model used to generate AI session summaries (recaps). **Empty means "use the session's aux model"**: a session with an active Model Group uses that group's **haiku** slot (the same cheap tier the CLI routes its own internal queries to; a group that leaves the haiku slot empty collapses all tiers to its `Main` model), and a session without a group uses its own model. Set it to a specific model to override that for every session — the value must be one the profile's provider actually serves, because a third-party gateway rejects an unknown model id at request time (a 401, not a config error). Per-profile, and the credentials follow the model: recaps, compact summaries, commit messages and the classifier all authenticate against the **session's** profile — the one that session is pinned to, or the active profile when it has no pin — never a different one. A session pinned elsewhere therefore spends its own credential, exactly like its agent turns do. (Switching the active profile therefore changes where an _unpinned_ session's aux calls authenticate, matching the fact that a running unpinned session keeps its spawn-time credentials until it is restarted.) Per-profile: this field lives on each entry of `profiles[]` (a top-level `recapModel` is migrated into `profiles[0]` on first load and is no longer written). ```json { "recapModel": "" } ``` --- ### `maxUploadBytes` | | | | ------- | ------------------ | | Type | `number` (bytes) | | Default | `26214400` (25 MB) | Maximum file upload size. Files larger than this are rejected before upload. Must be a positive integer. ```json { "maxUploadBytes": 26214400 } ``` --- ### `commitMessageModel` | | | | ------- | ---------------------------------------------- | | Type | `string` | | Default | `""` (unset — the session's aux model is used) | Model used by the AI commit-message generator in the GitPanel "This session" view. Empty means "use the session's aux model" — the session's Model Group haiku slot when it has an active group (see `recapModel` for the empty-haiku-slot caveat), else the session's own model. Point it at a stronger model (e.g. an Opus build) if you want higher-quality messages at higher cost. Per-profile, like `recapModel`; an empty value plus a session that has no model at all falls back to a locally-derived `chore:` message rather than an error. ```json { "commitMessageModel": "" } ``` --- ### `autoClassifierModel` | | | | ------- | ---------------------------------------------- | | Type | `string` | | Default | `""` (unset — the session's aux model is used) | Model used by the `auto` permission-mode security classifier, which judges each tool call that isn't on the safe-allowlist. Empty means "use the session's aux model" — the session's Model Group haiku slot when it has an active group (see `recapModel` for the empty-haiku-slot caveat), else the session's own model. Unlike `recapModel` / `commitMessageModel` this one is **global, not per-profile** (no profile carries it). The classifier must answer within `autoClassifierTimeout` ms or it fails closed to the human permission prompt, so pin this to a small fast model when the session's model is a large/slow one. There is no UI for it; set it via `config.json` or `npx claude-react-web config set autoClassifierModel ` (use `null` to clear it back to unset). ```json { "autoClassifierModel": "" } ``` --- ### `smallFastModel` | | | | ------- | ------------------------------------------------------ | | Type | `string` | | Default | `""` (unset — the hook resolver's Haiku-class default) | Model used by the native provider's `prompt` and `agent` hook evaluators — the single no-tool verdict round that judges a hook condition. Empty means "unset": the resolver falls back to its Haiku-class default (`claude-haiku-5-5`), except an `agent` hook on a gateway transport with no small-fast configured falls back to the session's own model. A per-hook `model` field always wins over this value. Like `autoClassifierModel` it is **global, not per-profile**, and it is never the session main model by default. There is no UI for it; set it via `config.json` or `npx claude-react-web config set smallFastModel ` (use `null` to clear it back to unset). ```json { "smallFastModel": "" } ``` --- ### `claudeHooksPath` | | | | ------- | ---------------------------------------------- | | Type | `string` (path) | | Default | `""` (unset — no settings-file hooks bridge) | Opt-in bridge for Claude Code settings-file hooks on the native provider. Set it to an **explicit** path — a `.claude/settings.json` (its `hooks` key is read) or a bare `hooks.json` map. There is no auto-discovery: unset means the file is never read. The config loads **once at session spawn** (no live reload); only `command` hooks on events with a native trigger are bridged (other types/events are skipped with a logged warning), one invalid matcher regex refuses the whole file, and an unreadable file starts the session hookless. Precedence sits between the session's own hooks config and plugin hooks. Set it via `config.json` or `npx claude-react-web config set claudeHooksPath ` (use `null` to clear). ```json { "claudeHooksPath": "" } ``` --- ### `historyCap` | | | | ------- | ------------------- | | Type | `number` (messages) | | Default | `500` | Maximum number of messages kept in memory per session. When the cap is reached, the oldest messages are discarded from the in-memory ring buffer. This does **not** affect the full conversation the provider appends to its per-session log under the state dir (`native-sessions/`) — the complete history is always available for resume. ```json { "historyCap": 500 } ``` Must be a positive integer. Higher values use more memory but allow the UI to scroll back further without re-fetching. --- ### `subagentHistoryCap` | | | | ------- | ------------------- | | Type | `number` (messages) | | Default | `300` | Maximum number of **subagent frames** (messages with `parent_tool_use_id` set — subagent tool hops plus the text/thinking frames forwarded when `forwardSubagentText` is on) kept in memory per session. These live in a separate ring from `historyCap`, so a long subagent turn can only evict older subagent frames — it can never push main-thread messages out of the replay window. ```json { "subagentHistoryCap": 300 } ``` Must be a positive integer. Boot-time only (requires a server restart); not writable via the runtime config API. Like `historyCap`, this only bounds the in-memory replay surface — disk history is unaffected. --- ### `forwardSubagentText` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Forward subagent text/thinking blocks into the message stream (the provider's `forwardSubagentText` option) so the client's SubagentOverlay can render the full nested transcript — thinking, text, and tool calls interleaved — instead of only tool cards. ```json { "forwardSubagentText": true } ``` Spawn-time only: the flag is applied when each session spawns, so flipping it requires a server restart and only affects sessions created afterward (existing sessions keep their spawn-time behavior until re-resumed). It is a spawn option, not a flag-settings key, so it cannot be toggled at runtime through the settings panel. --- ### `workingStuckMs` | | | | ------- | ----------------------- | | Type | `number` (milliseconds) | | Default | `3600000` (1 hour) | How long a session may stay in the "working" state with no provider activity before it is considered stuck and auto-interrupted. Set to `0` to disable the watchdog entirely. ```json { "workingStuckMs": 3600000 } ``` Must be a non-negative integer. --- ### `nativeAutoCompact` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Enable the **native provider's** in-place auto-compact. When an idle native session's context crosses the auto-compact window, the host summarizes the conversation and resets the model history in place (same session id; the log gains an append-only `session/compact` boundary). Native is the only provider, so this flag governs every session. ```json { "nativeAutoCompact": false } ``` Read at trigger time, so a restart is not required. --- ### `nativeAutoCompactRatio` | | | | ------- | -------- | | Type | `number` | | Default | `0.9` | Fraction used by the native provider's default auto-compact threshold. Native reserves its request output cap and returns `min(floor(maxTokens × ratio), maxTokens - 16384)`; when no positive proactive threshold is viable it returns `autoCompactThreshold: 0` and skips proactive compaction. An explicit session `autoCompactWindow` wins over the provider threshold. The direct `totalTokens >= maxTokens × ratio` manager calculation is only a compatibility fallback for old cached snapshots whose threshold is `undefined`; a provider threshold of `0` must not fall back to this ratio. ```json { "nativeAutoCompactRatio": 0.9 } ``` Must be greater than `0`; values above `1` are clamped to `1`. A value of `0` (or any non-positive number) is ignored and the default `0.9` applies. --- ### `nativeDefaultContextWindow` | | | | ------- | --------- | | Type | `number` | | Default | `1000000` | Context window (tokens) the **native provider** assumes when a model route has neither a `profiles[].modelContextWindows` override nor a successful endpoint discovery (`GET {baseUrl}/v1/models/{model}` → `max_input_tokens`). Gateways that do not implement the Models API — so every route falls back — are the main case: set this to the capacity your gateway actually serves. A guess by construction, which is why it is a config field rather than a buried constant; per-model `modelContextWindows` overrides remain the precise escape hatch. ```json { "nativeDefaultContextWindow": 1000000 } ``` Must be a positive safe integer; anything else is ignored and the default applies. Read live (config reload-safe). The fallback is an over-estimate for routes that are genuinely smaller AND fail discovery (a gateway without the Models API, or a transient discovery timeout): proactive compaction is skipped until the API rejects an over-window request. Set this to the capacity your gateway actually serves, and use per-model `modelContextWindows` overrides for mixed-capacity deployments. --- ### `nativeDreamAfterMs` | | | | ------- | ---------- | | Type | `number` | | Default | `86400000` | Minimum milliseconds since a cwd's last dream consolidation before the **native provider's** auto-dream may fire again. Dream is per-cwd: at turn end the provider checks that at least this much time has passed since that cwd's last consolidation AND that at least `nativeDreamSessionCount` same-cwd native sessions were touched since then. Completion timestamps persist in `/native-memory/dream-state.json`; the running lock is process-local, so a restart resets it and the next qualifying window retries. ```json { "nativeDreamAfterMs": 86400000 } ``` Must be a finite number `>= 0`; fractional values are rounded. Anything else is ignored and the default applies. `0` means elapsed time never blocks a dream (the session-count threshold still applies). Read live (config reload-safe). The per-session `autoDreamEnabled` memory switch is the master gate; the `claude` provider does not read this field. --- ### `nativeDreamSessionCount` | | | | ------- | -------- | | Type | `number` | | Default | `5` | Minimum number of same-cwd native sessions touched since that cwd's last dream consolidation before auto-dream fires. Together with `nativeDreamAfterMs` this is the trigger threshold checked at turn end; a dream consolidates only that cwd's own memory directory. ```json { "nativeDreamSessionCount": 5 } ``` Must be a positive safe integer; anything else is ignored and the default applies. Read live (config reload-safe). The `claude` provider does not read this field. --- ### `nativeAttachmentFidelity` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Preserve structured file occurrences in the native provider instead of reducing new sends to handle text before the provider sees them. Native logs migrate from header v1 to v2 on the first structured attachment; the physical filename remains `session.v1.jsonl` for storage compatibility. Older servers reject v2 explicitly, while this server continues to read legacy v1 handles without inventing missing digests. ```json { "nativeAttachmentFidelity": false } ``` Set this to `false` only when legacy handle input is required for new native sends. Existing v2 history and its persisted model form are not rewritten by the switch. Canonical history stores attachment references, never PDF base64. Each model request projects a handle or a verified native PDF document. The browser receives public id/name/size/digest blocks without registry paths, server-only model-form metadata, or document base64. Native `AttachmentRead` verifies the current log reference, registry entry, path containment, size and digest before returning bounded text or a PDF result. Eligible PDFs are limited to **20 MiB** each. Their encoded documents are capped at **28,000,000 base64 characters per model-history partition**, and a user message's image plus newly assigned PDF data observes the same 28,000,000-character combined cap. Duplicate or over-budget occurrences remain handles. Manual and automatic compact hydrate at most **65,536 raw bytes per text attachment** and **262,144 raw bytes per compact request**, with explicit truncation or omission markers. A missing or tampered alias fails only the operation that needs its bytes; history remains readable. Restore the verified alias and retry the turn to project it again. A gateway document/API failure is returned as the real error rather than silently converting the occurrence to a handle. `nativePdfDocuments: false` affects only new occurrences, so it cannot repair an already persisted `pdf-document` for a gateway that cannot accept it; use `/clear` or a new session for that recovery. Upload deletion returns `409` while any live, dormant, forked or compact-handoff native log still references the upload, or while an in-flight send holds its deletion lease. This prevents compact and later reads from losing their verified bytes. --- ### `nativePdfDocuments` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Allow eligible new native PDF occurrences to use native `document` blocks after magic-byte, registry, digest, size and budget checks. This setting is effective only while `nativeAttachmentFidelity` is enabled and does not affect ordinary text attachments or images. ```json { "nativePdfDocuments": false } ``` The switch is read when a new occurrence is persisted. It never rewrites an existing handle or document, and later tool rounds, resume and fork retain the original history prefix. --- ### `maxGroupPanels` | | | | ------- | -------- | | Type | `number` | | Default | `3` | Maximum number of sessions a group may contain, and therefore the maximum number of side-by-side chat panels opened when that group is activated. The main grid is group-centric: it always shows either a single ungrouped session or the members of one group, so this one value governs both. Must be in the range 2–5. ```json { "maxGroupPanels": 5 } ``` Values outside the 2–5 range are clamped. This replaced the previous per-browser UI selector; the value is now server-controlled and shared by all clients. Legacy `config.json` files that set `maxOpenPanels` are still read — `maxGroupPanels` wins when both are present. --- ### `authToken` | | | | ------- | ---------------------- | | Type | `string` | | Default | _(none — must be set)_ | Anthropic credential sent with every API request as an `Authorization: Bearer ` header. Works against both the official API and Anthropic-compatible proxies. The server warns at startup when this is unset, and API calls fail until it is configured. Can also be filled in from the in-app settings panel. ```json { "authToken": "sk-ant-..." } ``` --- ### `baseUrl` | | | | ------- | ----------------------------- | | Type | `string` | | Default | `"https://api.anthropic.com"` | API endpoint the server talks to. Override to point at a proxy or relay. Any trailing slash is stripped during load. ```json { "baseUrl": "https://api.anthropic.com" } ``` --- ### `accessToken` | | | | ------- | -------- | | Type | `string` | | Default | _(none)_ | Shared **web access** token (distinct from `authToken` above). When set, every visitor must supply it once via `/?token=` before the UI loads. Auto-generated and enforced when the server binds to a non-loopback host. Pin a stable value here to keep the same token across restarts. > Note: this field is read at startup but is intentionally **not** rewritable from the in-app settings UI. ```json { "accessToken": "my-shared-secret" } ``` --- ### `logToFile` | | | | ------- | --------- | | Type | `boolean` | | Default | `false` | When `true`, server logs are written to a file under `/logs/` in addition to stdout. ```json { "logToFile": true } ``` The runtime log level and scope filter are controlled separately via the `LOG_LEVEL` / `LOG_SCOPES` env vars or `PUT /api/log`, and persisted as `logLevel` / `logScopes`. --- ### `updateCheckRegistry` | | | | ------- | ------------------------------ | | Type | `string` | | Default | `"https://registry.npmjs.org"` | npm registry URL the update checker probes for new releases. Set to an empty string to disable the update check entirely (the banner stays hidden and the About tab shows "disabled"). Override to point at a private registry. ```json { "updateCheckRegistry": "https://registry.npmjs.org" } ``` --- ### `updateCheckIntervalMs` | | | | ------- | ------------------ | | Type | `number` | | Default | `43200000` (12 h) | Milliseconds between periodic update probes. One value drives both channels: the web host's npm-registry scheduler and the desktop app's release-feed check. Set to `0` to disable periodic checking — the startup probe and manual "Check now" still work. Nonzero values below 60000 are clamped to 60000 by the scheduler. Failed probes back off exponentially (×2, capped at 4× the interval) with ±20% jitter; the next deadline is armed when the previous probe settles. ```json { "updateCheckIntervalMs": 43200000 } ``` --- ### `allowSensitivePathEdits` | | | | ------- | --------- | | Type | `boolean` | | Default | `false` | When `true`, `acceptEdits` and `bypassPermissions` modes also auto-approve edits and commands targeting "sensitive" config paths (`.git/`, `.claude/`, `.vscode/`, `.idea/`, and shell/git config files such as `.bashrc`, `.gitconfig`) that otherwise still prompt even in those modes. Off (default) preserves the safe behavior. This only relaxes the sensitive-path safety check — it does **not** affect: - `ExitPlanMode` (plan review) or `AskUserQuestion` — these always prompt regardless of mode. - The `dontAsk` lockdown mode. - The `auto` mode classifier path (sensitive paths there still go to the classifier). - The "path must be inside the session cwd" requirement in `acceptEdits` — out-of-cwd edits still prompt. ```json { "allowSensitivePathEdits": true } ``` --- ### `appToolsGit` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Global default for injecting the first-party `git-tools` in-process MCP server (status, log, stage, commit, branch, stash, …) into sessions. The agent can then call `mcp__git-tools__*` tools directly; writes go through the session's normal permission flow. Per-session overrides (`POST /sessions/:id/app-tools`, or the "Let Claude use git tools" toggle in the MCP settings tab) take priority — sessions without an override inherit this value. Prefer the structured `firstPartyTools["git-tools"].enabled` form for new configs — this boolean is the legacy surface and is folded into that key on load. Configs that still use the pre-rename `firstPartyTools.apptools` key are migrated to `git-tools` automatically. Set to `false` to stop injecting git tools by default: ```json { "appToolsGit": false } ``` --- ### `maxOutputTokens` | | | | ------- | ----------------- | | Type | `number` (tokens) | | Default | `128000` | Legacy knob from the removed CLI provider (it used to set `CLAUDE_CODE_MAX_OUTPUT_TOKENS`). The native turn loop does **not** read it — it uses its own default max output tokens — so the field is currently inert for agent turns. Wiring it into the native request is open work. Raise it when the model's own output ceiling allows (current-generation models support up to 128K output); a value above what the model supports gains nothing. The value also feeds the auto-compact threshold formula (`window − min(maxOutputTokens, 20000) − 13000`). **Spawn-time only.** The env var is built per spawn — existing sessions pick up a change on their next spawn (resume / restart / new session). ```json { "maxOutputTokens": 128000 } ``` --- ### `fileSnapshots` | | | | ------- | --------- | | Type | `boolean` | | Default | `true` | Enable the shadow-repo snapshot sidecar that powers offline file rewind. When enabled, each session captures a lightweight git snapshot at every user message, allowing files to be restored to any prior message state even after the session has gone dormant or been terminated. When disabled, `GET /sessions/:id/file-snapshots` reports `available: false` with reason `disabled`. Sessions started outside a git repository are never snapshotted regardless of this flag (they report `available: false` with reason `not-git`). **Boot-time only.** Although this field is listed in `WRITABLE_CONFIG_KEYS` (so the settings panel and `config set` can write it to `config.json`), the running `SnapshotService` reads it once at construction. A written change takes effect on the next server restart; existing sessions keep their spawn-time behavior. ```json { "fileSnapshots": true } ``` --- ### `fileSnapshotsMaxUntrackedBytes` | | | | ------- | ---------------- | | Type | `number` (bytes) | | Default | `2097152` (2 MB) | Per-file size limit applied **only to untracked files** during each snapshot capture. An untracked file whose byte size exceeds this value is excluded from the snapshot (the file stays in the working directory untouched). Tracked (git-indexed) files are always captured regardless of size. Ignored files are also excluded (via `check-ignore` against the source repo rules). **Boot-time only.** Same restart requirement as `fileSnapshots` above. ```json { "fileSnapshotsMaxUntrackedBytes": 5242880 } ``` Must be a positive integer. --- ### `autoStart` | | | | ------- | --------- | | Type | `boolean` | | Default | `false` | Daemon auto-start **desired state**. Managed by `POST /api/daemon/enable|disable` and the `claude-react-web daemon install|uninstall` commands, which also perform the OS-level registration (the actual state). Setting it directly (PUT /config) records intent only and does NOT register or unregister anything — a mismatch is surfaced as `drift` by `GET /api/daemon/status`. --- ## Priority order Configuration values are resolved in this order (highest priority first): 1. **CLI flags** — `--model`, etc. 2. **`config.json`** — the file described above 3. **Built-in defaults** — hardcoded in `server/config.ts` ## Terminal commands Running `claude-react-web ` manages config without the browser — single-shot, headless, and scriptable (`--json` for structured output, `--yes` to confirm destructive verbs, `--state-dir ` to target a non-default state dir): - `claude-react-web mcp …` — list / add / update / remove / enable / disable / test global MCP servers (`mcp-config.json`) - `claude-react-web marketplace …` — add / list / remove agent-plugin marketplaces (`marketplaces.json`) - `claude-react-web app-plugin …` — manage App Plugin marketplaces and installed App Plugins (`app-plugins/`) - `claude-react-web config get|set` — read (tokens masked) / update writable keys of `config.json` - `claude-react-web sessions list|delete` — persisted session management - `claude-react-web daemon install|uninstall|status|start|stop` — daemon auto-start management (see below) - `claude-react-web doctor` — local environment checks (exit 0 when healthy) - `claude-react-web update` — npm-registry update check ### Daemon auto-start ```bash claude-react-web daemon install # register OS auto-start + start the daemon now claude-react-web daemon status # registration + daemon/server state (works offline) claude-react-web daemon stop # stop the supervised server (daemon keeps running) claude-react-web daemon start # start the daemon now claude-react-web daemon uninstall # unregister auto-start AND stop daemon + server ``` `daemon install` is NOT the same as the settings-panel toggle: install and the panel toggle map to enable/disable, which only register/unregister the OS entry. `uninstall` additionally stops the running daemon and server. Logs land in `/daemon/daemon.log` (daemon) and `/daemon/server.log` (supervised server). `config set` only accepts the writable keys listed under `WRITABLE_CONFIG_KEYS` in `server/config.ts` (the same set the in-app settings panel can change); `authToken` / `accessToken` are never writable from the command line — edit `config.json` for those. Run `claude-react-web --help` for flags. ## Client-side settings (localStorage) Some UI layout and behavior constants are stored in the browser's `localStorage` instead of `config.json`. These are per-browser and don't require a server restart: | Key | Default | Description | | ------------------------------------- | ------- | --------------------------------------------- | | `claude-react-web:sidebar-min-px` | `180` | Sidebar minimum width (px) | | `claude-react-web:sidebar-max-px` | `480` | Sidebar maximum width (px) | | `claude-react-web:panel-min-ratio` | `0.15` | Minimum panel width as a fraction of viewport | | `claude-react-web:follow-debounce-ms` | `150` | Auto-scroll debounce delay (ms) | | `claude-react-web:recent-models-cap` | `10` | Max recent models remembered | | `claude-react-web:recent-cwds-cap` | `10` | Max recent working directories remembered | To change these, open browser DevTools → Application → Local Storage and edit the values directly. All values are clamped to safe ranges at runtime.