On this page

Interactive choices are saved separately from config.json and models.json. Prefer the corresponding command or selector to changing these records manually. In particular, a remembered model is not a model definition, and an account selection record is not a credential.

Locations and ownership

LocationPurpose
<checkout>/.haskell-agent/settings.jsonCheckout approval policy, concurrent-agent limit, remembered model and provider account selections
~/.haskell-agent/settings.jsonUser-level remembered model, title-model selection and mouse-capture preference

The checkout root is the current Git working tree's top level, including a linked worktree. Outside Git it is the working directory. Paths are canonicalized. Do not copy a full-access checkout policy into an untrusted repository.

Root fields

FieldType / defaultMeaning
versionInteger / 1Written schema version. Preserve it; this loader does not enforce the same version rejection as machine configuration.
autoApproveBoolean / falsePersistent checkout approval policy, controlled by /permissions or /always-approve
mouseCaptureBoolean / trueUser terminal preference for fullscreen mouse capture
lastModelOptional model object / absentLast selected model; can inherit from the primary clone and user settings
titleModelOptional model object or supported string / absentUser-level automatic naming model; absent restores automatic selection
lastAccountsAccount object array / emptyRemembered account identity per provider; excludes secrets and quota responses
maxConcurrentAgentsOptional integer / absentProject limit below explicit CLI priority and above machine priority; use a positive value

For a new checkout settings file, this example keeps ordinary approval prompts enabled and requests a concurrency limit of three. Merge fields into an existing file rather than replacing its other preferences:

{
  "version": 1,
  "autoApprove": false,
  "maxConcurrentAgents": 3
}

Saved model objects

lastModel and an explicitly pinned titleModel use the following shape. These values are normally written by the model picker:

FieldRule
providerRequired supported provider identifier
modelRequired nonblank local model identifier
connectionDefaults to provider identifier; must be nonblank
transportModelDefaults to model; records the wire identifier
dialectDefaults to the provider's legacy dialect; explicit values must be recognized and compatible

Do not paste a models.json entry here: that schema uses id and configuration metadata instead. Use /model NAME to select a catalog entry. Use /title-model NAME to pin naming, or /title-model --auto to clear it. The special title string apple-foundationmodel selects supported on-device Apple naming; ordinary catalog models use the object form.

Model inheritance and worktrees

  1. An existing checkout lastModel wins.
  2. If absent, use the primary clone's remembered model.
  3. If still absent, use the user-level remembered model.

Only this model preference is filled in by that inheritance procedure. It does not merge primary-clone auto-approval or account arrays into a worktree. A top-level interactive model switch writes the checkout, primary clone when different, and user preference. Startup, resume, and delegated/session-local switches are not that persistence event. Explicit launch/session choices still determine the current invocation.

To forget an inherited model completely, stop affected sessions and remove only lastModel from each applicable settings location. Removing it from the worktree alone may simply reveal the primary-clone preference. Choosing another model interactively is usually simpler.

Account selection records

Field in lastAccountsRule
providerRequired recognized provider identifier
selectionIdRequired nonblank credential-source selection identifier
accountIdString, default empty; provider account identity

The successful choice replaces the remembered entry for that provider. Never put a token in either identifier. To reset a preference, stop the session and remove that provider's entry, preserving the others. This neither disconnects the account nor revokes its provider token. Use the login interface to manage credentials separately.

Malformed files and recovery

A missing, unreadable, or invalid settings file yields defaults. Within an otherwise decodable file, malformed or obsolete model selections are discarded independently, and invalid account entries are removed from the decoded list. This is intentionally different from the explicit machine-configuration errors.

  1. Stop sessions that could save preferences while you repair the file.
  2. Keep a private backup and inspect the exact checkout/user location.
  3. Correct one field or restore the backup; do not delete credential stores.
  4. Restart, inspect /permissions and /session-info, then verify the intended model with a small task.

If a remembered choice vanished, inspect JSON types and the separate model catalog before assuming a provider account was deleted. If a model reappears, check inheritance rather than repeatedly removing the wrong file.