Settings
pw code reads its configuration from a global settings file in your home directory, with optional per-workspace files you can check into a project. Common settings can also be changed from inside a session with the interactive /settings menu.
Settings Files
Settings are merged from four places, in order, with later files overriding earlier ones key by key:
~/.config/pw/code.json: your global settings.<workspace>/.mcp.json: MCP servers in the cross-tool standard format.<workspace>/.agents/settings.json: project settings, typically checked in.<workspace>/.agents/settings.local.json: personal overrides for one workspace, not meant to be checked in.
All four files accept the same JSON keys. The global path honors XDG_CONFIG_HOME and is the same on macOS and Linux. A mcpServers map is replaced wholesale, not merged: the highest-precedence file that defines it supplies the entire server set. See MCP Servers.
Workspace Trust
Workspace configuration only applies after you approve it. The first time pw code starts in a workspace whose configuration files it has not seen before, it lists them and asks whether to apply them. The gate covers everything a workspace can contribute: settings files, .mcp.json MCP servers, and the .agents agent definitions and custom commands.
Your answer is remembered for that exact content: if any of the files change, you are asked again at the next launch. Until you approve, none of the workspace files apply and the session runs on your global settings alone.
Non-interactive runs never prompt. Unapproved workspace configuration is ignored with a notice on stderr, so launch pw code interactively once in a workspace you want scripts to use. Approvals are stored in your global settings file under the workspaceSettingsTrust key, which is managed automatically.
Key Reference
All keys are optional.
| Key | Type | Default | Description |
|---|---|---|---|
model | string | none | Model ID to start with (e.g. Jake.Thayne:openai/gpt-5.2). Updated automatically to the model you last used. |
allocation | string | none | Budget allocation for org: provider models. Updated to the one you last used. |
permissionMode | string | accept-edits | Startup permission mode: read-only, accept-edits, bypass-permissions, or plan. |
allowedTools | string[] | [] | Allow rules that pre-approve tool calls, e.g. "Bash(git status:*)". |
maxTurnTokens | number | 0 | Per-turn token budget; the turn stops when it is exceeded. 0 = unlimited. See Usage & Costs. |
compactAt | number | 0 | Live context size, in tokens, at which the conversation is automatically compacted. 0 = default (100,000). See Usage & Costs. |
includeCoAuthoredBy | boolean | true | Attribution on commits and pull requests the agent creates. See below. |
mcpServers | object | {} | MCP server definitions. |
autoScroll | boolean | true | Keep the transcript pinned to the bottom as output streams. |
reduceMotion | boolean | false | Disable the working-spinner animation. |
mouseClicks | boolean | false | Let mouse clicks act on the interface (select picker rows, toggle blocks, drag-select). Wheel scrolling always works. |
sessionRetentionDays | number | 0 | A positive number sweeps sessions untouched for that many days at startup; resuming a session resets its clock. 0 (the default) or a negative value keeps sessions forever. See Sessions & Resume. |
disableSubagents | boolean | false | Withhold the delegation tool entirely, so the agent cannot spawn subagents. |
subagentConcurrency | number | 0 | How many subagent tasks may run at once. 0 = default (10). |
subagentDepth | number | 0 | How deep subagents may nest. 0 or 1 = subagents cannot spawn their own subagents. |
subagentModel | string | none | Default model for delegated tasks. Empty = inherit the session's model. |
For what the subagent keys control in practice, see Subagents.
Example
{
"model": "Jake.Thayne:openai/gpt-5.2",
"permissionMode": "accept-edits",
"allowedTools": ["Bash(git status:*)", "Bash(go test:*)"],
"compactAt": 80000,
"includeCoAuthoredBy": false,
"sessionRetentionDays": 90,
"subagentConcurrency": 4,
"subagentModel": "Jake.Thayne:openai/gpt-5.2-mini",
"mcpServers": {
"docs": {
"command": "npx",
"args": ["-y", "docs-mcp-server"]
}
}
}The /settings Menu
Run /settings in an interactive session to change the most common settings without editing files. Type to filter the rows, move with the arrow keys, and press Enter to change the highlighted row; Esc closes the menu. Changes are saved to your global settings immediately.
| Row | What it does |
|---|---|
| Permission mode | Cycles read-only → accept-edits → bypass-permissions → plan. See Permissions. |
| Co-authored-by trailer | Toggles commit and pull request attribution on or off. |
| Auto-scroll | Toggles following the transcript as output streams. |
| Reduce motion | Toggles the working-spinner animation. |
| Mouse clicks | Toggles click interaction with the interface; scrolling and text selection always work. |
| Subagents | Enables or disables delegating tasks to subagents. |
| Subagent concurrency | Opens a number box for the parallel-task limit. Enter applies, Esc cancels; leaving it empty keeps the current value. |
| Subagent nesting depth | Opens a number box; 1 means subagents cannot spawn their own subagents. |
| Subagent model | Opens a model picker for the default delegated-task model. Shows (inherit session) when unset. |
| Session retention | Opens a number box for the sweep window in days; 0 keeps sessions forever. See Sessions & Resume. |
| Model | Opens the model picker to change the session's model. |
| Allocation | Opens the allocation picker (org providers). See Models & Allocations. |
Commit and PR Attribution
When includeCoAuthoredBy is enabled (the default), the agent ends every commit message it creates with an attribution line and a Co-Authored-By: pw code <noreply@parallelworks.com> trailer, and ends the pull requests it opens with the same attribution line. Turning it off with the Co-authored-by trailer row in /settings applies to the current session's future commits, not just the next launch.
Related Documentation
- pw code Overview: Feature overview and quick start
- Permissions: Permission modes and allow rules
- MCP Servers: The
mcpServerskey and.mcp.json - Subagents: Behavior behind the subagent keys
- Models & Allocations: Model IDs and budget allocations
- Sessions & Resume: Session storage and retention
- Slash Commands:
/settingsand other in-session commands