Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

WithNav is configured with plain JSON files and Markdown files. Two JSON files do most of the work:

  • models.json is the catalogue. It says which gateways exist and which models they serve. It is a list of what is available, not a list of choices.
  • config.json makes the assignments. It says which model each layer and each agent uses, plus a few settings.

Keeping them apart lets you add a model to the catalogue without changing what WithNav uses.

PageWhat it covers
Gateways and modelsmodels.json, API keys, a full example.
LayersChoosing the models for Reflex, Instinct and Metacognition.
AgentsChoosing models for build, plan and the crew; custom agents.
Editor context and session overridesWhat /model, /variant, /agent and /new do.
Rules and skillsAGENTS.md, rules.md and SKILL.md files.
Import a catalogue from OpenCodeBuild models.json from an OpenCode config.

Files and paths

On Linux, the configuration directory is ~/.config/withnav/ and the data directory is ~/.local/share/withnav/.

WhereWhat
~/.config/withnav/models.jsonThe catalogue: gateways, qualified model names, API kinds, capabilities, limits and variants. A models.json in the workspace wins over it, and --models <file> wins over both.
~/.config/withnav/auth.jsonAPI keys, mode 0600. Write them with nav auth set <provider>.
~/.config/withnav/config.jsonlayers, agents, default_agent, and other settings such as tui.theme.
~/.config/withnav/agents/*.md, <project>/.withnav/agents/*.mdAgent definitions. ~/.config/opencode/agents/ is also read.
~/.config/withnav/flows/, <project>/.withnav/flows/Editor flows. See InstinctFlow. An older pipeline.toml is converted once, and the original is kept.
<project>/.withnav/intent.mdThe intent record: what you are trying to do. The metacognition layer compares your code with it.
<project>/.withnav/charts/Mermaid charts written by the Cartographe agent.
~/.agents/AGENTS.md, ~/.agents/rules.md, ~/.agents/skills/Your rules and skills. ~/.claude/ is read too. See Rules and skills.
~/.local/share/withnav/withnav.dbConversation history.
~/.local/share/withnav/withnav.jsonlDecision log.
~/.local/share/withnav/withnav.db permission tablesYour permission rules, validated skills and flows, and the history of decisions (nav permissions). See Permissions.
~/.local/share/withnav/tui.logLog of the terminal client.
~/.local/share/withnav/model-catalog/Cache of the model lists reported by your gateways.

nav doctor prints the configuration directory it actually uses.

Settings reference

These are the keys of config.json. Anything not listed is kept untouched, so several versions and clients can share the file. The Settings screens write the same file; see Using Nav.

KeyDefaultMeaning
layers.reflexnone (layer off)Model for Reflex. Must use the fim API.
layers.instinctnone (layer off)Model for Instinct. Must use the systemone API.
layers.metacognitionnone (layer off)Model for Metacognition. Must use the chat API.
default_agentbuildThe primary agent a new session starts with. See Agents.
agents.<id>.model, agents.<id>.variantnoneModel and variant of an agent. See Agents.
compaction.writermetacognitionWho writes compaction summaries: metacognition, or session for the session’s own model. If Metacognition is unavailable, the session model is used.
compaction.chunk_tokens64000Size of one rolling summary chunk, capped at half of the writer’s input budget. A positive integer.
permissions.scratch_dirsprivate runtime directory, then a shared temp oneAbsolute paths the agent may use for temporary files; they count as part of the project for your rules. [] turns it off. See Permissions.
mcp.<id>noneA stdio or Streamable HTTP MCP server whose tools Nav may call. See MCP servers.
yolofalseUnsafe. true turns off all permission control for sessions started or resumed afterwards, and their subagents: nothing is asked or checked. See Permissions.
subagents.max_concurrent4How many subagents one session may run at once. An integer from 1 to 64.
subagents.watchdog_interval_secs300How often Instinct checks that a background subagent makes progress. 0 turns it off.
agent.watchdog_interval_secs300How often Instinct checks that the main conversation makes progress. 0 turns it off. See Long turns.
skills.paths[]Extra skill directories. Relative paths resolve against the repository worktree root and rank after fixed project roots; absolute paths rank after standard user roots. Invalid, missing or escaping entries produce diagnostics without failing startup. See Rules and skills.
tui.themetide-darkTerminal colour theme: ayu-dark, ayu-light, nord-dark, nord-light, tide-dark, tide-light, moss-dark or moss-light.

Layer models apply after you restart WithNav. The other keys apply to new sessions.

An invalid value is an error, not a silent default. nav doctor names the key.

Example setup

The repository holds a complete pair of examples: models.example.json and config.example.json. Adapt the endpoints and assignments, then copy them to ~/.config/withnav/. They contain no real keys. The notes on Gateways and models explain the choices in them.