@qwen-code/qwen-code 0.18.0-preview.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/SKILL.md +1 -2
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/settings.md +20 -24
- package/bundled/qc-helper/docs/features/_meta.ts +0 -3
- package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
- package/bundled/qc-helper/docs/features/commands.md +47 -23
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +60 -0
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +234 -24
- package/chunks/{agent-SXS4NQWS.js → agent-LOTJK6AH.js} +25 -19
- package/chunks/agent-headless-TU3EPMYU.js +50 -0
- package/chunks/{anthropicContentGenerator-4QBVSFSJ.js → anthropicContentGenerator-2HBRNQ3B.js} +7 -7
- package/chunks/{askUserQuestion-NOOLRWCJ.js → askUserQuestion-OGCMIBQM.js} +45 -3
- package/chunks/{ca-WRHFBIDH.js → ca-BARBRL6N.js} +48 -1
- package/chunks/{chunk-JMLIPZUU.js → chunk-2Y5SYSD3.js} +361 -583
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-AVLOK27J.js → chunk-3HTIVKZE.js} +1 -1
- package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
- package/chunks/chunk-64WXLC72.js +98 -0
- package/chunks/{chunk-F6FLCHCS.js → chunk-6YIUGZTC.js} +1069 -211
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-ERREX2ES.js → chunk-7BCMOPIM.js} +64 -24
- package/chunks/{chunk-6VFG3EUJ.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/{chunk-F5ORN4YO.js → chunk-B7HXHOHU.js} +1 -1
- package/chunks/{chunk-5RNZ2QKF.js → chunk-BIVG75CP.js} +1 -1
- package/chunks/{chunk-MVX64PNU.js → chunk-EYENRK4D.js} +1 -1
- package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
- package/chunks/{chunk-SCHRFI7O.js → chunk-HLPLOD42.js} +1 -1
- package/chunks/{chunk-R5PDRHEF.js → chunk-HR7SV7AY.js} +68 -47
- package/chunks/{chunk-JSYEZAYV.js → chunk-IDX6COTE.js} +2 -2
- package/chunks/{chunk-6KH2Q7XN.js → chunk-IWAYOW5Q.js} +17482 -11669
- package/chunks/chunk-J5MDQKJL.js +2230 -0
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-ZW7GBCRE.js → chunk-LBP46COL.js} +1014 -163
- package/chunks/chunk-LD2XBG6Z.js +102 -0
- package/chunks/{chunk-KOA52UTF.js → chunk-LEJ42GNY.js} +14 -14
- package/chunks/{chunk-D46KOV3C.js → chunk-M6VTDSVR.js} +1 -1
- package/chunks/{chunk-SHUT5MQY.js → chunk-MFBBBTNY.js} +1 -1
- package/chunks/{chunk-PLYZAP4W.js → chunk-OHEGWO4L.js} +101 -23
- package/chunks/{chunk-NQZ33PWX.js → chunk-PL3MVCWD.js} +11 -11
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/chunk-R7ODSGTK.js +159 -0
- package/chunks/{chunk-GBEPNWYB.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/chunk-SKBPNJEW.js +45 -0
- package/chunks/{chunk-UABFCMPA.js → chunk-SNGELLWX.js} +3 -1
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-G763GDO6.js → chunk-XV4HCEVI.js} +36 -3
- package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
- package/chunks/{chunk-BBTV54KB.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/{computer-use-CT6MU6P3.js → computer-use-3RH2DOM6.js} +25 -19
- package/chunks/contextCommand-K347QT6O.js +52 -0
- package/chunks/{cron-create-PIPMXQN4.js → cron-create-YJL3KFWI.js} +3 -3
- package/chunks/{cron-delete-6Y5XIDMS.js → cron-delete-WKWSJZQA.js} +3 -3
- package/chunks/{cron-list-A4WNRUWZ.js → cron-list-B52XEXAZ.js} +3 -3
- package/chunks/{de-M5RPB2NB.js → de-YGKK2BC4.js} +48 -1
- package/chunks/{devtools-IXE4UP72.js → devtools-FM6GJPYG.js} +1 -1
- package/chunks/{dist-R2SXPG74.js → dist-4LXD6L6X.js} +2 -2
- package/chunks/{dist-TE5QKMGR.js → dist-H6ONXVLG.js} +1 -1
- package/chunks/{dist-ZMQ4TXD5.js → dist-KAZ3SEBX.js} +2 -2
- package/chunks/{dist-BXDUQ2QY.js → dist-PK7DFCAW.js} +1 -1
- package/chunks/{edit-A4YK7AIB.js → edit-KU4PJGEX.js} +26 -20
- package/chunks/{en-UMYKQAZE.js → en-DHGYHIHX.js} +77 -2
- package/chunks/{enter-worktree-VNEQINLC.js → enter-worktree-PPYIDCWI.js} +25 -19
- package/chunks/enterPlanMode-5CZDMCB4.js +158 -0
- package/chunks/{exit-worktree-AVSMXC33.js → exit-worktree-UY3CGHKC.js} +25 -19
- package/chunks/exitPlanMode-3DN4QNSG.js +703 -0
- package/chunks/{fr-MPYXXXPW.js → fr-JXBKPJKQ.js} +48 -1
- package/chunks/{geminiContentGenerator-CR2WGARL.js → geminiContentGenerator-7A6I2RWB.js} +7 -7
- package/chunks/{getMachineId-bsd-F7GNPTER.js → getMachineId-bsd-4CASPIU4.js} +1 -1
- package/chunks/{getMachineId-darwin-T73DJL27.js → getMachineId-darwin-HPQPEMZR.js} +1 -1
- package/chunks/{getMachineId-linux-MKQTFPQM.js → getMachineId-linux-AUARKYHL.js} +1 -1
- package/chunks/{getMachineId-unsupported-MUR5KOQE.js → getMachineId-unsupported-S32ZDA2T.js} +1 -1
- package/chunks/{getMachineId-win-CDYFC6ZM.js → getMachineId-win-4EFLHYIJ.js} +1 -1
- package/chunks/{glob-5V32KOG5.js → glob-OFNQSS52.js} +25 -19
- package/chunks/{grep-PUTEPBR4.js → grep-6J2MSUM5.js} +28 -19
- package/chunks/{ja-NFZ32AB3.js → ja-TGPZSP2B.js} +48 -1
- package/chunks/{keychain-token-storage-UHGOCDD6.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-34DLNYCD.js → ls-V3O6A5PT.js} +4 -4
- package/chunks/{lsp-NCDEHH3V.js → lsp-G2OCIFUA.js} +3 -3
- package/chunks/{monitor-EJBR5VCR.js → monitor-FKLHV423.js} +25 -19
- package/chunks/{notebook-edit-DZHGPP2L.js → notebook-edit-KTBYFKWG.js} +26 -20
- package/chunks/{openaiContentGenerator-4QNV3CHM.js → openaiContentGenerator-L5KSWQY7.js} +15 -14
- package/chunks/{pt-BR43FRBA.js → pt-TIBG6BIO.js} +48 -1
- package/chunks/{qwenContentGenerator-3XOCEMQO.js → qwenContentGenerator-PYOXLMBW.js} +27 -21
- package/chunks/{qwenOAuth2-KRJT35QH.js → qwenOAuth2-2KCKWDCF.js} +6 -5
- package/chunks/{read-file-VZ2SQQIX.js → read-file-JQVRK4NU.js} +11 -11
- package/chunks/ripGrep-2L4LPNAJ.js +48 -0
- package/chunks/{ru-DQCW2KHD.js → ru-JBCHCK4L.js} +48 -1
- package/chunks/{scheduler-H32DZVDV.js → scheduler-FGNXY4JQ.js} +25 -19
- package/chunks/send-message-SZFWNOCL.js +244 -0
- package/chunks/{serve-56G4B5W6.js → serve-N2IBLA3G.js} +13592 -4979
- package/chunks/{shell-Q77KNP4N.js → shell-PTEG6UX4.js} +25 -19
- package/chunks/{skill-CLWFJYBG.js → skill-X4NTK4NH.js} +64 -113
- package/chunks/{src-47L2LUOU.js → src-GLLQ3R5W.js} +307 -32
- package/chunks/{syntheticOutput-T5SWX3YF.js → syntheticOutput-IKAY5F6X.js} +4 -4
- package/chunks/task-create-MQICOJFV.js +19 -0
- package/chunks/task-list-RIHJCH32.js +151 -0
- package/chunks/{task-stop-3VHAQMYM.js → task-stop-FWZRFANS.js} +3 -3
- package/chunks/task-update-2LHPXOYM.js +408 -0
- package/chunks/team-create-2E4PF4KN.js +314 -0
- package/chunks/team-delete-DAUDQS4J.js +116 -0
- package/chunks/{todoWrite-EAGJGKO5.js → todoWrite-HTUACZES.js} +5 -5
- package/chunks/{tool-search-Q75AYDTP.js → tool-search-KTVULRES.js} +11 -11
- package/chunks/{web-fetch-SS6IKK6N.js → web-fetch-CZ7LLKPE.js} +5 -5
- package/chunks/workflow-L2ZUUDT2.js +960 -0
- package/chunks/{write-file-RENGC25N.js → write-file-ZEB2JDYH.js} +26 -20
- package/chunks/{zh-6VFXOAR5.js → zh-7H5OQC4I.js} +82 -7
- package/chunks/{zh-TW-IQZ4AD5M.js → zh-TW-P4IDHD3M.js} +79 -7
- package/cli.js +11248 -5119
- package/examples/agent/qwen-extension.json +1 -0
- package/examples/commands/qwen-extension.json +1 -0
- package/examples/context/qwen-extension.json +1 -0
- package/examples/mcp-server/qwen-extension.json +1 -0
- package/examples/skills/qwen-extension.json +1 -0
- package/examples/starter/QWEN.md +30 -0
- package/examples/starter/README.md +59 -0
- package/examples/starter/agents/diary.md +86 -0
- package/examples/starter/commands/writing/polish.md +13 -0
- package/examples/starter/example.ts +64 -0
- package/examples/starter/package.json +18 -0
- package/examples/starter/qwen-extension.json +12 -0
- package/examples/starter/skills/synonyms/SKILL.md +48 -0
- package/examples/starter/tsconfig.json +13 -0
- package/fzfWorker.js +1083 -0
- package/locales/ca.js +51 -0
- package/locales/de.js +51 -0
- package/locales/en.js +89 -2
- package/locales/fr.js +53 -2
- package/locales/ja.js +52 -2
- package/locales/pt.js +52 -2
- package/locales/ru.js +53 -2
- package/locales/zh-TW.js +90 -11
- package/locales/zh.js +94 -11
- package/package.json +3 -2
- package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
- package/chunks/contextCommand-YODJQYIV.js +0 -46
- package/chunks/exitPlanMode-5SQYVROD.js +0 -229
- package/chunks/ripGrep-SBIZCPOL.js +0 -42
- package/chunks/send-message-YYF56TS7.js +0 -151
|
@@ -60,7 +60,6 @@ Use this index to locate the right document for the user's question. Load only t
|
|
|
60
60
|
| Slash commands | `docs/features/commands.md` |
|
|
61
61
|
| Headless / non-interactive mode | `docs/features/headless.md` |
|
|
62
62
|
| LSP integration | `docs/features/lsp.md` |
|
|
63
|
-
| Checkpointing | `docs/features/checkpointing.md` |
|
|
64
63
|
| Token caching | `docs/features/token-caching.md` |
|
|
65
64
|
| Language / i18n | `docs/features/language.md` |
|
|
66
65
|
| Arena mode | `docs/features/arena.md` |
|
|
@@ -121,7 +120,7 @@ When the user asks about configuration, the primary reference is `docs/configura
|
|
|
121
120
|
| Permissions | `permissions.allow/ask/deny` | `docs/configuration/settings.md`, `docs/features/approval-mode.md` |
|
|
122
121
|
| MCP Servers | `mcpServers.*`, `mcp.*` | `docs/configuration/settings.md`, `docs/features/mcp.md` |
|
|
123
122
|
| Tool Approval | `tools.approvalMode` | `docs/configuration/settings.md`, `docs/features/approval-mode.md`, `docs/features/auto-mode.md` |
|
|
124
|
-
| Hooks | `hooks.*` | `docs/features/hooks.md`
|
|
123
|
+
| Hooks | `hooks.*` | `docs/configuration/settings.md`, `docs/features/hooks.md` |
|
|
125
124
|
| Model | `model.name`, `modelProviders` | `docs/configuration/settings.md`, `docs/configuration/model-providers.md` |
|
|
126
125
|
| General/UI | `general.*`, `ui.*`, `ide.*`, `output.*` | `docs/configuration/settings.md` |
|
|
127
126
|
| Context | `context.*` | `docs/configuration/settings.md` |
|
|
@@ -15,6 +15,7 @@ export default {
|
|
|
15
15
|
'integration-jetbrains': 'JetBrains IDEs',
|
|
16
16
|
'integration-github-action': 'GitHub Actions',
|
|
17
17
|
'qwen-serve': 'Daemon mode (qwen serve)',
|
|
18
|
+
'qwen-serve-deploy-local': 'Daemon mode — local launch templates',
|
|
18
19
|
'Code with Qwen Code': {
|
|
19
20
|
type: 'separator',
|
|
20
21
|
title: 'Code with Qwen Code', // Title is optional
|
|
@@ -86,7 +86,6 @@ Settings are organized into categories. Most settings should be placed within th
|
|
|
86
86
|
| `general.sessionRecapAwayThresholdMinutes` | number | Minutes the terminal must be blurred before an auto-recap fires on focus-in. Only used when `showSessionRecap` is enabled. | `5` |
|
|
87
87
|
| `general.gitCoAuthor.commit` | boolean | Add a Co-authored-by trailer to git commit messages AND attach a per-file AI-attribution git note (`refs/notes/ai-attribution`) for commits made through Qwen Code. Disabling skips both. | `true` |
|
|
88
88
|
| `general.gitCoAuthor.pr` | boolean | Append a Qwen Code attribution line to pull request descriptions when running `gh pr create`. | `true` |
|
|
89
|
-
| `general.checkpointing.enabled` | boolean | Enable session checkpointing for recovery. | `false` |
|
|
90
89
|
| `general.defaultFileEncoding` | string | Default encoding for new files. Use `"utf-8"` (default) for UTF-8 without BOM, or `"utf-8-bom"` for UTF-8 with BOM. Only change this if your project specifically requires BOM. | `"utf-8"` |
|
|
91
90
|
| `general.cleanupPeriodDays` | number | Days to retain `~/.qwen/file-history/` session backups used by `/rewind`. Backups older than this are removed by a background pass that runs at most once per day. `0` = minimum retention (~1 hour): keeps sessions touched in the last hour plus the currently active one. Changes take effect after restart. | `30` |
|
|
92
91
|
|
|
@@ -109,18 +108,16 @@ Settings are organized into categories. Most settings should be placed within th
|
|
|
109
108
|
| `ui.customBannerTitle` | string | Replace the default `>_ Qwen Code` title in the banner info panel. The `(vX.Y.Z)` version suffix is always appended; auth, model, and path lines are not affected. Sanitized; capped at 80 characters. | `""` |
|
|
110
109
|
| `ui.customBannerSubtitle` | string | Optional subtitle line rendered between the banner title and the auth/model line, in place of the blank spacer row. Sanitized; capped at 160 characters. Empty (default) keeps the original blank spacer. | `""` |
|
|
111
110
|
| `ui.customAsciiArt` | string \| object | Replace the QWEN ASCII logo in the banner. Accepts an inline string (used for both width tiers), `{ "path": "./brand.txt" }` (relative paths resolve against the owning settings file's directory; read once at startup with `O_NOFOLLOW` on POSIX, capped at 64 KB), or `{ "small": ..., "large": ... }` for width-aware selection. Sanitized; capped at 200 lines × 200 columns per tier. | `undefined` |
|
|
112
|
-
| `ui.hideFooter` | boolean | Hide the footer from the UI. | `false` |
|
|
113
|
-
| `ui.showMemoryUsage` | boolean | Display memory usage information in the UI. | `false` |
|
|
114
111
|
| `ui.showLineNumbers` | boolean | Show line numbers in code blocks in the CLI output. | `true` |
|
|
115
112
|
| `ui.renderMode` | string | Default Markdown display mode. Use `"render"` for rich visual previews or `"raw"` to show source-oriented Markdown by default. Toggle during a session with `Alt/Option+M`; on macOS the terminal must send Option as Meta. See [Markdown Rendering](../features/markdown-rendering). | `"render"` |
|
|
116
|
-
| `ui.showCitations` | boolean | Show citations for generated text in the chat. | `
|
|
113
|
+
| `ui.showCitations` | boolean | Show citations for generated text in the chat. | `false` |
|
|
117
114
|
| `ui.compactMode` | boolean | Hide tool output and thinking for a cleaner view. Toggle with `Ctrl+O` during a session or via the Settings dialog. Tool approval prompts are never hidden, even in compact mode. The setting persists across sessions. | `false` |
|
|
118
115
|
| `ui.shellOutputMaxLines` | number | Max number of shell output lines shown inline. Set to `0` to disable the cap and show full output. Hidden lines are surfaced via the `+N lines` indicator. Errors, `!`-prefix user-initiated commands, confirming tools, and focused embedded shells always show full output. | `5` |
|
|
119
|
-
| `enableWelcomeBack`
|
|
116
|
+
| `ui.enableWelcomeBack` | boolean | Show welcome back dialog when returning to a project with conversation history. When enabled, Qwen Code will automatically detect if you're returning to a project with a previously generated project summary (`.qwen/PROJECT_SUMMARY.md`) and show a dialog allowing you to continue your previous conversation or start fresh. If you choose **Start new chat session**, that choice is remembered for the current project until the project summary changes. This feature integrates with the `/summary` command and quit confirmation dialog. | `true` |
|
|
120
117
|
| `ui.accessibility.enableLoadingPhrases` | boolean | Enable loading phrases (disable for accessibility). | `true` |
|
|
121
118
|
| `ui.accessibility.screenReader` | boolean | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | `false` |
|
|
122
119
|
| `ui.customWittyPhrases` | array of strings | A list of custom phrases to display during loading states. When provided, the CLI will cycle through these phrases instead of the default ones. | `[]` |
|
|
123
|
-
| `ui.enableFollowupSuggestions` | boolean | Enable [followup suggestions](../features/followup-suggestions) that predict what you want to type next after the model responds. Suggestions appear as ghost text and can be accepted with Tab, Enter, or Right Arrow. | `
|
|
120
|
+
| `ui.enableFollowupSuggestions` | boolean | Enable [followup suggestions](../features/followup-suggestions) that predict what you want to type next after the model responds. Suggestions appear as ghost text and can be accepted with Tab, Enter, or Right Arrow. | `false` |
|
|
124
121
|
| `ui.enableCacheSharing` | boolean | Use cache-aware forked queries for suggestion generation. Reduces cost on providers that support prefix caching (experimental). | `true` |
|
|
125
122
|
| `ui.enableSpeculation` | boolean | Speculatively execute accepted suggestions before submission. Results appear instantly when you accept (experimental). | `false` |
|
|
126
123
|
| `experimental.emitToolUseSummaries` | boolean | Generate short LLM-based labels summarizing each tool-call batch. See [Tool-Use Summaries](../features/tool-use-summaries). Requires `fastModel` to be configured; silently skipped otherwise. Can be overridden per-session with `QWEN_CODE_EMIT_TOOL_USE_SUMMARIES=0` or `=1`. | `true` |
|
|
@@ -140,23 +137,23 @@ Settings are organized into categories. Most settings should be placed within th
|
|
|
140
137
|
|
|
141
138
|
#### model
|
|
142
139
|
|
|
143
|
-
| Setting | Type | Description
|
|
144
|
-
| -------------------------------------------------- | ------- |
|
|
145
|
-
| `model.name` | string | The Qwen model to use for conversations.
|
|
146
|
-
| `model.maxSessionTurns` | number | Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.
|
|
147
|
-
| `model.maxWallTimeSeconds` | number | Wall-clock budget for headless / unattended runs, in seconds. `-1` means unlimited. Overridable per-invocation via `--max-wall-time`, which requires a positive duration (`90`, `30s`, `5m`, `1h`, `1.5h`); the minimum is 1 second — sub-second values (`500ms`, `0.5`) are rejected as typos. Omit the flag to fall back to this setting. Aborts with exit code 55 when exceeded.
|
|
148
|
-
| `model.maxToolCalls` | number | Cumulative tool-call budget for a run (counts every executed tool, success or failure; `structured_output` under `--json-schema` is exempt). `-1` means unlimited; `0` means "no tool calls allowed". Capped at 1,000,000 to catch typos. Overridable via `--max-tool-calls`. Aborts with exit code 55 when exceeded.
|
|
149
|
-
| `model.generationConfig` | object | Advanced overrides passed to the underlying content generator. Supports request controls such as `timeout`, `maxRetries`, `enableCacheControl`, `splitToolMedia` (
|
|
150
|
-
| `model.chatCompression.contextPercentageThreshold` | number | **REMOVED.** Auto-compaction now uses a three-tier threshold ladder (warn / auto / hard) computed internally from the model's context window via the `computeThresholds()` function — no longer user-configurable. Setting this field in `settings.json` is silently ignored (no startup warning). There is currently no replacement for "disable compression entirely" — reactive overflow recovery remains the safety net at the API layer if compression itself fails. (See PR #4345 / `docs/design/auto-compaction-threshold-redesign.md` for the redesign rationale.)
|
|
151
|
-
| `model.chatCompression.maxRecentFilesToRetain` | number | Number of most-recently-touched files whose current content is restored (embedded if small, otherwise referenced by path) into history after auto-compaction. `0` restores none. Env override: `QWEN_COMPACT_MAX_RECENT_FILES`.
|
|
152
|
-
| `model.chatCompression.maxRecentImagesToRetain` | number | Number of most-recent images (tool screenshots / user pastes) restored into history after auto-compaction. `0` restores none. Env override: `QWEN_COMPACT_MAX_RECENT_IMAGES`.
|
|
153
|
-
| `model.chatCompression.enableScreenshotTrigger` | boolean | When `true`, auto-compaction also fires once the number of tool-returned images accumulated in history reaches `screenshotTriggerThreshold`, independent of token usage — aimed at computer-use sessions where frequent screenshots dilute model attention. Counts only images returned inside tool results, not user-pasted images. Env override: `QWEN_COMPACT_SCREENSHOT_TRIGGER` (`1`/`true`/`0`/`false`).
|
|
154
|
-
| `model.chatCompression.screenshotTriggerThreshold` | number | Tool-returned image count at or above which the screenshot trigger fires (only when `enableScreenshotTrigger`). Compaction resets the count — surviving images are re-embedded as top-level parts, which the trigger doesn't count — so it won't immediately re-fire. Env override: `QWEN_COMPACT_SCREENSHOT_THRESHOLD`.
|
|
155
|
-
| `model.skipNextSpeakerCheck` | boolean | Skip the next speaker check.
|
|
156
|
-
| `model.skipLoopDetection` | boolean | Disables streaming loop detection checks. Defaults to `true` (loop detection is skipped) to avoid false positives interrupting legitimate workflows. Set to `false` to re-enable streaming loop detection — useful as a guardrail in headless / non-interactive runs where stuck repetition can otherwise waste budget.
|
|
157
|
-
| `model.skipStartupContext` | boolean | Skips sending the startup workspace context (environment summary and acknowledgement) at the beginning of each session. Enable this if you prefer to provide context manually or want to save tokens on startup.
|
|
158
|
-
| `model.enableOpenAILogging` | boolean | Enables logging of OpenAI API calls for debugging and analysis. When enabled, API requests and responses are logged to JSON files.
|
|
159
|
-
| `model.openAILoggingDir` | string | Custom directory path for OpenAI API logs. If not specified, defaults to `logs/openai` in the current working directory. Supports absolute paths, relative paths (resolved from current working directory), and `~` expansion (home directory).
|
|
140
|
+
| Setting | Type | Description | Default |
|
|
141
|
+
| -------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
142
|
+
| `model.name` | string | The Qwen model to use for conversations. | `undefined` |
|
|
143
|
+
| `model.maxSessionTurns` | number | Maximum number of user/model/tool turns to keep in a session. -1 means unlimited. | `-1` |
|
|
144
|
+
| `model.maxWallTimeSeconds` | number | Wall-clock budget for headless / unattended runs, in seconds. `-1` means unlimited. Overridable per-invocation via `--max-wall-time`, which requires a positive duration (`90`, `30s`, `5m`, `1h`, `1.5h`); the minimum is 1 second — sub-second values (`500ms`, `0.5`) are rejected as typos. Omit the flag to fall back to this setting. Aborts with exit code 55 when exceeded. | `-1` |
|
|
145
|
+
| `model.maxToolCalls` | number | Cumulative tool-call budget for a run (counts every executed tool, success or failure; `structured_output` under `--json-schema` is exempt). `-1` means unlimited; `0` means "no tool calls allowed". Capped at 1,000,000 to catch typos. Overridable via `--max-tool-calls`. Aborts with exit code 55 when exceeded. | `-1` |
|
|
146
|
+
| `model.generationConfig` | object | Advanced overrides passed to the underlying content generator. Supports request controls such as `timeout`, `maxRetries`, `enableCacheControl`, `splitToolMedia` (default `true`; splits tool-returned media — including images read by the built-in read_file — into a follow-up user message instead of the spec-violating `role: "tool"` message, so strict OpenAI-compatible servers like doubao / new-api / LM Studio can see it; set `false` to restore the legacy embed-in-tool behavior), `contextWindowSize` (override model's context window size), `modalities` (override auto-detected input modalities), `customHeaders` (custom HTTP headers for API requests), and `extra_body` (additional body parameters for OpenAI-compatible API requests only), along with fine-tuning knobs under `samplingParams` (for example `temperature`, `top_p`, `max_tokens`). Leave unset to rely on provider defaults. | `undefined` |
|
|
147
|
+
| `model.chatCompression.contextPercentageThreshold` | number | **REMOVED.** Auto-compaction now uses a three-tier threshold ladder (warn / auto / hard) computed internally from the model's context window via the `computeThresholds()` function — no longer user-configurable. Setting this field in `settings.json` is silently ignored (no startup warning). There is currently no replacement for "disable compression entirely" — reactive overflow recovery remains the safety net at the API layer if compression itself fails. (See PR #4345 / `docs/design/auto-compaction-threshold-redesign.md` for the redesign rationale.) | `N/A` |
|
|
148
|
+
| `model.chatCompression.maxRecentFilesToRetain` | number | Number of most-recently-touched files whose current content is restored (embedded if small, otherwise referenced by path) into history after auto-compaction. `0` restores none. Env override: `QWEN_COMPACT_MAX_RECENT_FILES`. | `5` |
|
|
149
|
+
| `model.chatCompression.maxRecentImagesToRetain` | number | Number of most-recent images (tool screenshots / user pastes) restored into history after auto-compaction. `0` restores none. Env override: `QWEN_COMPACT_MAX_RECENT_IMAGES`. | `3` |
|
|
150
|
+
| `model.chatCompression.enableScreenshotTrigger` | boolean | When `true`, auto-compaction also fires once the number of tool-returned images accumulated in history reaches `screenshotTriggerThreshold`, independent of token usage — aimed at computer-use sessions where frequent screenshots dilute model attention. Counts only images returned inside tool results, not user-pasted images. Env override: `QWEN_COMPACT_SCREENSHOT_TRIGGER` (`1`/`true`/`0`/`false`). | `true` |
|
|
151
|
+
| `model.chatCompression.screenshotTriggerThreshold` | number | Tool-returned image count at or above which the screenshot trigger fires (only when `enableScreenshotTrigger`). Compaction resets the count — surviving images are re-embedded as top-level parts, which the trigger doesn't count — so it won't immediately re-fire. Env override: `QWEN_COMPACT_SCREENSHOT_THRESHOLD`. | `50` |
|
|
152
|
+
| `model.skipNextSpeakerCheck` | boolean | Skip the next speaker check. | `false` |
|
|
153
|
+
| `model.skipLoopDetection` | boolean | Disables streaming loop detection checks. Defaults to `true` (loop detection is skipped) to avoid false positives interrupting legitimate workflows. Set to `false` to re-enable streaming loop detection — useful as a guardrail in headless / non-interactive runs where stuck repetition can otherwise waste budget. | `true` |
|
|
154
|
+
| `model.skipStartupContext` | boolean | Skips sending the startup workspace context (environment summary and acknowledgement) at the beginning of each session. Enable this if you prefer to provide context manually or want to save tokens on startup. | `false` |
|
|
155
|
+
| `model.enableOpenAILogging` | boolean | Enables logging of OpenAI API calls for debugging and analysis. When enabled, API requests and responses are logged to JSON files. | `false` |
|
|
156
|
+
| `model.openAILoggingDir` | string | Custom directory path for OpenAI API logs. If not specified, defaults to `logs/openai` in the current working directory. Supports absolute paths, relative paths (resolved from current working directory), and `~` expansion (home directory). | `undefined` |
|
|
160
157
|
|
|
161
158
|
**Example model.generationConfig:**
|
|
162
159
|
|
|
@@ -638,7 +635,6 @@ For sandbox image selection, precedence is:
|
|
|
638
635
|
| `--telemetry-otlp-endpoint` | | Sets the OTLP endpoint for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information. |
|
|
639
636
|
| `--telemetry-otlp-protocol` | | Sets the OTLP protocol for telemetry (`grpc` or `http`). | | Defaults to `grpc`. See [telemetry](../../developers/development/telemetry) for more information. |
|
|
640
637
|
| `--telemetry-log-prompts` | | Enables logging of prompts for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information. |
|
|
641
|
-
| `--checkpointing` | | Enables [checkpointing](../features/checkpointing). | | |
|
|
642
638
|
| `--acp` | | Enables ACP mode (Agent Client Protocol). Useful for IDE/editor integrations like [Zed](../integration-zed). | | Stable. Replaces the deprecated `--experimental-acp` flag. |
|
|
643
639
|
| `--experimental-lsp` | | Enables experimental [LSP (Language Server Protocol)](../features/lsp) feature for code intelligence (go-to-definition, find references, diagnostics, etc.). | | Experimental. Requires language servers to be installed. |
|
|
644
640
|
| `--extensions` | `-e` | Specifies a list of extensions to use for the session. | Extension names | If not provided, all available extensions are used. Use the special term `qwen -e none` to disable all extensions. Example: `qwen -e my-extension -e my-other-extension` |
|
|
@@ -11,9 +11,6 @@ export default {
|
|
|
11
11
|
headless: 'Headless Mode',
|
|
12
12
|
'structured-output': 'Structured Output',
|
|
13
13
|
'dual-output': 'Dual Output',
|
|
14
|
-
checkpointing: {
|
|
15
|
-
display: 'hidden',
|
|
16
|
-
},
|
|
17
14
|
'approval-mode': 'Approval Mode',
|
|
18
15
|
'auto-mode': 'Auto Mode',
|
|
19
16
|
worktree: 'Worktrees',
|
|
@@ -94,8 +94,8 @@ How should we handle database migration?
|
|
|
94
94
|
```json
|
|
95
95
|
// .qwen/settings.json
|
|
96
96
|
{
|
|
97
|
-
"
|
|
98
|
-
"
|
|
97
|
+
"tools": {
|
|
98
|
+
"approvalMode": "plan"
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
```
|
|
@@ -157,8 +157,8 @@ You can review each proposed change and approve or reject it individually.
|
|
|
157
157
|
```bash
|
|
158
158
|
// .qwen/settings.json
|
|
159
159
|
{
|
|
160
|
-
"
|
|
161
|
-
"
|
|
160
|
+
"tools": {
|
|
161
|
+
"approvalMode": "default"
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
```
|
|
@@ -340,10 +340,8 @@ YOLO Mode grants Qwen Code the highest permissions, automatically approving all
|
|
|
340
340
|
```bash
|
|
341
341
|
// .qwen/settings.json
|
|
342
342
|
{
|
|
343
|
-
"
|
|
344
|
-
"
|
|
345
|
-
"confirmShellCommands": false,
|
|
346
|
-
"confirmFileEdits": false
|
|
343
|
+
"tools": {
|
|
344
|
+
"approvalMode": "yolo"
|
|
347
345
|
}
|
|
348
346
|
}
|
|
349
347
|
```
|
|
@@ -364,10 +362,10 @@ qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
|
|
|
364
362
|
|
|
365
363
|
### Keyboard Shortcut Switching
|
|
366
364
|
|
|
367
|
-
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the
|
|
365
|
+
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the five modes:
|
|
368
366
|
|
|
369
367
|
```
|
|
370
|
-
Ask Permissions Mode → Auto-Edit Mode →
|
|
368
|
+
Plan Mode → Ask Permissions Mode → Auto-Edit Mode → Auto Mode → YOLO Mode → Plan Mode
|
|
371
369
|
```
|
|
372
370
|
|
|
373
371
|
### Persistent Configuration
|
|
@@ -376,10 +374,8 @@ Ask Permissions Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Ask Perm
|
|
|
376
374
|
// Project-level: ./.qwen/settings.json
|
|
377
375
|
// User-level: ~/.qwen/settings.json
|
|
378
376
|
{
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
"confirmShellCommands": true,
|
|
382
|
-
"confirmFileEdits": true
|
|
377
|
+
"tools": {
|
|
378
|
+
"approvalMode": "auto-edit" // or "plan", "default", "auto", "yolo"
|
|
383
379
|
}
|
|
384
380
|
}
|
|
385
381
|
```
|
|
@@ -18,14 +18,21 @@ Slash commands are used to manage Qwen Code sessions, interface, and basic behav
|
|
|
18
18
|
|
|
19
19
|
These commands help you save, restore, and summarize work progress.
|
|
20
20
|
|
|
21
|
-
| Command
|
|
22
|
-
|
|
|
23
|
-
| `/init`
|
|
24
|
-
| `/summary`
|
|
25
|
-
| `/compress`
|
|
26
|
-
| `/
|
|
27
|
-
| `/
|
|
28
|
-
| `/
|
|
21
|
+
| Command | Description | Usage Examples |
|
|
22
|
+
| ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
23
|
+
| `/init` | Analyze current directory and create initial context file | `/init` |
|
|
24
|
+
| `/summary` | Generate project summary based on conversation history | `/summary` |
|
|
25
|
+
| `/compress` | Replace chat history with summary to save Tokens | `/compress` |
|
|
26
|
+
| `/compress-fast` | Fast compression without AI — strips old tool outputs and thinking parts | `/compress-fast` |
|
|
27
|
+
| `/resume` | Resume a previous conversation session | `/resume` |
|
|
28
|
+
| `/recap` | Generate a one-line session recap now | `/recap` |
|
|
29
|
+
| `/restore` | Revert project files to the checkpoint before a tool call ran | `/restore` (list) or `/restore <ID>` |
|
|
30
|
+
| `/delete` | Delete a previous session | `/delete` |
|
|
31
|
+
| `/branch` | Fork the current conversation into a new session | `/branch` |
|
|
32
|
+
| `/fork` | Spawn a background agent that inherits the full conversation | `/fork <directive>` |
|
|
33
|
+
| `/rewind` | Rewind conversation to a previous turn | `/rewind` or `/rollback` |
|
|
34
|
+
| `/export` | Export session history to file | `/export html`, `/export md`, `/export json`, `/export jsonl` |
|
|
35
|
+
| `/rename` | Rename or tag the current session | `/rename My Feature` or `/tag` |
|
|
29
36
|
|
|
30
37
|
### 1.2 Interface and Workspace Control
|
|
31
38
|
|
|
@@ -43,6 +50,7 @@ Commands for adjusting interface appearance and work environment.
|
|
|
43
50
|
| `/editor` | Open dialog to select supported editor | `/editor` |
|
|
44
51
|
| `/statusline` | Open interactive [status line](./status-line.md) preset dialog | `/statusline` |
|
|
45
52
|
| `/statusline <text>` | Generate a command-mode [status line](./status-line.md) via agent | `/statusline show model and git branch` |
|
|
53
|
+
| `/terminal-setup` | Configure terminal keybindings for multiline input | `/terminal-setup` |
|
|
46
54
|
|
|
47
55
|
### 1.3 Language Settings
|
|
48
56
|
|
|
@@ -71,6 +79,7 @@ Commands for managing AI tools and models.
|
|
|
71
79
|
| →`plan` | Analysis only, no execution | Secure review |
|
|
72
80
|
| →`default` | Require approval for edits | Daily use |
|
|
73
81
|
| →`auto-edit` | Automatically approve edits | Trusted environment |
|
|
82
|
+
| →`auto` | Classifier-evaluated approval | Autonomous sessions with safety guardrails |
|
|
74
83
|
| →`yolo` | Automatically approve all | Quick prototyping |
|
|
75
84
|
| `/model` | Switch model used in current session | `/model` |
|
|
76
85
|
| `/model --fast` | Set a lighter model for prompt suggestions | `/model --fast qwen3-coder-flash` |
|
|
@@ -79,6 +88,14 @@ Commands for managing AI tools and models.
|
|
|
79
88
|
| `/remember` | Save a durable memory | `/remember Prefer terse responses` |
|
|
80
89
|
| `/forget` | Remove matching entries from auto-memory | `/forget <query>` |
|
|
81
90
|
| `/dream` | Manually run auto-memory consolidation | `/dream` |
|
|
91
|
+
| `/hooks` | Manage Qwen Code hooks | `/hooks`, `/hooks list` |
|
|
92
|
+
| `/permissions` | Manage permission rules | `/permissions` |
|
|
93
|
+
| `/agents` | Manage subagents | `/agents manage`, `/agents create` |
|
|
94
|
+
| `/arena` | Manage Arena sessions | `/arena start`, `/arena status` |
|
|
95
|
+
| `/goal` | Set a goal — keep working until condition met | `/goal <condition>`, `/goal clear` |
|
|
96
|
+
| `/tasks` | List background tasks | `/tasks` |
|
|
97
|
+
| `/lsp` | Show LSP server status | `/lsp` |
|
|
98
|
+
| `/trust` | Manage folder trust settings | `/trust` |
|
|
82
99
|
|
|
83
100
|
### 1.5 Built-in Skills
|
|
84
101
|
|
|
@@ -192,7 +209,7 @@ progress; otherwise it waits for the current turn to finish and then fires).
|
|
|
192
209
|
Unlike the manual command, the auto-trigger is fully silent on failure: if
|
|
193
210
|
generation errors or there is nothing to summarize, no message is added to
|
|
194
211
|
the history. Controlled by the `general.showSessionRecap` setting
|
|
195
|
-
(default: `
|
|
212
|
+
(default: `false`); the manual `/recap` command always works regardless of
|
|
196
213
|
this setting.
|
|
197
214
|
|
|
198
215
|
**Example:**
|
|
@@ -209,8 +226,8 @@ this setting.
|
|
|
209
226
|
>
|
|
210
227
|
> Configure a fast model via `/model --fast <model>` (e.g.
|
|
211
228
|
> `qwen3-coder-flash`) to make `/recap` fast and cheap. Set
|
|
212
|
-
> `general.showSessionRecap` to `
|
|
213
|
-
>
|
|
229
|
+
> `general.showSessionRecap` to `true` to enable the auto-trigger; the
|
|
230
|
+
> manual `/recap` command always works regardless of this setting.
|
|
214
231
|
|
|
215
232
|
### 1.8 Diff Viewer (`/diff`)
|
|
216
233
|
|
|
@@ -225,7 +242,7 @@ In interactive mode, `/diff` opens a dialog with a **source picker** along the t
|
|
|
225
242
|
|
|
226
243
|
The file list displays per-file stats (lines added/removed) with tags for special states (`new`, `deleted`, `untracked`, `binary`, `truncated`, `oversized`). Press Enter on a file to view its inline diff with syntax-highlighted hunks.
|
|
227
244
|
|
|
228
|
-
Per-turn diffs require
|
|
245
|
+
Per-turn diffs require file checkpointing to be enabled (on by default in interactive mode). When file checkpointing is off, only the "Current" source is available.
|
|
229
246
|
|
|
230
247
|
**Keyboard shortcuts:**
|
|
231
248
|
|
|
@@ -268,17 +285,24 @@ In headless (`--prompt`) or non-interactive contexts, `/diff` prints a plain-tex
|
|
|
268
285
|
|
|
269
286
|
Commands for obtaining information and performing system settings.
|
|
270
287
|
|
|
271
|
-
| Command | Description
|
|
272
|
-
| --------------- |
|
|
273
|
-
| `/help` | Display help information for available commands
|
|
274
|
-
| `/status` | Display version information
|
|
275
|
-
| `/status paths` | Display current session file and log paths
|
|
276
|
-
| `/stats` |
|
|
277
|
-
| `/
|
|
278
|
-
| `/
|
|
279
|
-
| `/
|
|
280
|
-
| `/
|
|
281
|
-
| `/
|
|
288
|
+
| Command | Description | Usage Examples |
|
|
289
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
290
|
+
| `/help` | Display help information for available commands | `/help` or `/?` |
|
|
291
|
+
| `/status` | Display version information | `/status` or `/about` |
|
|
292
|
+
| `/status paths` | Display current session file and log paths | `/status paths` |
|
|
293
|
+
| `/stats` | Open interactive usage statistics dashboard with three tabs: Session (live metrics), Activity (heatmap, token trend, project ranking), and Efficiency (cache rate, tool leaderboard, model comparison). Use `tab` to switch tabs, `r` to cycle time ranges, `←→` to pan months, `esc` to close. | `/stats` |
|
|
294
|
+
| `/stats model` | Show per-model token breakdown and estimated cost | `/stats model` |
|
|
295
|
+
| `/stats tools` | Show per-tool call counts | `/stats tools` |
|
|
296
|
+
| `/settings` | Open settings editor | `/settings` |
|
|
297
|
+
| `/auth` | Change authentication method | `/auth` |
|
|
298
|
+
| `/doctor` | Run installation and environment diagnostics | `/doctor`, `/doctor memory` |
|
|
299
|
+
| `/docs` | Open full Qwen Code documentation in browser | `/docs` |
|
|
300
|
+
| `/ide` | Manage IDE integration | `/ide status`, `/ide install` |
|
|
301
|
+
| `/insight` | Generate programming insights from chat history | `/insight` |
|
|
302
|
+
| `/setup-github` | Set up GitHub Actions | `/setup-github` |
|
|
303
|
+
| `/bug` | Submit issue about Qwen Code | `/bug Button click unresponsive` |
|
|
304
|
+
| `/copy` | Copy AI output to clipboard (`/copy N` = Nth-last AI message) | `/copy` or `/copy 2` |
|
|
305
|
+
| `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |
|
|
282
306
|
|
|
283
307
|
### 1.10 Common Shortcuts
|
|
284
308
|
|
|
@@ -32,7 +32,7 @@ Suggestions are generated when all of the following conditions are met:
|
|
|
32
32
|
- There are no errors in the most recent response
|
|
33
33
|
- No confirmation dialogs are pending (e.g., shell confirmation, permissions)
|
|
34
34
|
- The approval mode is not set to `plan`
|
|
35
|
-
- The feature is enabled in settings (
|
|
35
|
+
- The feature is enabled in settings (disabled by default — set `ui.enableFollowupSuggestions` to `true` to turn it on)
|
|
36
36
|
|
|
37
37
|
Suggestions will not appear in non-interactive mode (e.g., headless/SDK mode).
|
|
38
38
|
|
|
@@ -72,7 +72,7 @@ These settings can be configured in `settings.json`:
|
|
|
72
72
|
|
|
73
73
|
| Setting | Type | Default | Description |
|
|
74
74
|
| ------------------------------ | ------- | ------- | ------------------------------------------------------------------ |
|
|
75
|
-
| `ui.enableFollowupSuggestions` | boolean | `
|
|
75
|
+
| `ui.enableFollowupSuggestions` | boolean | `false` | Enable or disable followup suggestions |
|
|
76
76
|
| `ui.enableCacheSharing` | boolean | `true` | Use cache-aware forked queries to reduce cost (experimental) |
|
|
77
77
|
| `ui.enableSpeculation` | boolean | `false` | Speculatively execute suggestions before submission (experimental) |
|
|
78
78
|
| `fastModel` | string | `""` | Model for prompt suggestions and speculative execution |
|
|
@@ -6,7 +6,7 @@ Scheduled tasks let Qwen Code re-run a prompt automatically on an interval. Use
|
|
|
6
6
|
|
|
7
7
|
Tasks are session-scoped: they live in the current Qwen Code process and are gone when you exit. Nothing is written to disk.
|
|
8
8
|
|
|
9
|
-
> **
|
|
9
|
+
> **Tip:** Scheduled tasks are enabled by default. To disable them, set `experimental.cron: false` in your [settings](../configuration/settings.md), or set `QWEN_CODE_DISABLE_CRON=1` in your environment.
|
|
10
10
|
|
|
11
11
|
## Schedule a recurring prompt with /loop
|
|
12
12
|
|
|
@@ -275,6 +275,66 @@ disallowedTools:
|
|
|
275
275
|
---
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
+
#### Claude Code Compatibility Fields
|
|
279
|
+
|
|
280
|
+
Qwen Code accepts the Claude Code 2.1.168 frontmatter fields below so you
|
|
281
|
+
can drop a CC agent file into `.qwen/agents/` and have the supported fields
|
|
282
|
+
parse identically. Optional fields with invalid values are silently dropped
|
|
283
|
+
at parse time rather than rejected — the same lenient posture CC uses.
|
|
284
|
+
|
|
285
|
+
| Field | Type | Notes |
|
|
286
|
+
| ---------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
287
|
+
| `permissionMode` | enum string | `acceptEdits`, `auto`, `bypassPermissions`, `default`, `dontAsk`, `plan`. Mapped to `approvalMode` at parse time; when both are set, the explicit `approvalMode` wins. |
|
|
288
|
+
| `maxTurns` | positive integer | Caps the agent's turn budget. Wired into `runConfig.max_turns` at runtime; when both are set, the top-level field wins. The legacy nested value is pruned from the on-disk file on save to avoid two sources of truth. |
|
|
289
|
+
| `color` | enum string | Display color. Allowlist: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` (mirrors CC's `_Y`). The legacy qwen sentinel `auto` is preserved for backward compatibility. Other values are silently dropped on parse. |
|
|
290
|
+
| `mcpServers` | record of specs | Per-agent MCP server overrides. Merged with the session-level MCP server set when the agent spawns; on key collision the agent's spec wins (matching CC's `scope: 'agent'` semantics). Malformed entries are dropped per-key with a warning rather than failing the whole agent. |
|
|
291
|
+
| `hooks` | record of arrays | Per-agent hooks. Keys are CC hook event names (`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, …); values are arrays of `{ matcher?, hooks: [...] }` definitions in the same shape as `settings.json`'s `hooks` field. Registered while the agent runs, removed when it stops. |
|
|
292
|
+
|
|
293
|
+
Example with all of the above:
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
---
|
|
297
|
+
name: rigorous-reviewer
|
|
298
|
+
description: Deep code review with a turn cap
|
|
299
|
+
permissionMode: plan
|
|
300
|
+
maxTurns: 50
|
|
301
|
+
color: cyan
|
|
302
|
+
tools:
|
|
303
|
+
- read_file
|
|
304
|
+
- grep_search
|
|
305
|
+
- glob
|
|
306
|
+
mcpServers:
|
|
307
|
+
filesystem:
|
|
308
|
+
type: stdio
|
|
309
|
+
command: node
|
|
310
|
+
args: [/usr/local/lib/mcp-fs/server.js]
|
|
311
|
+
hooks:
|
|
312
|
+
PreToolUse:
|
|
313
|
+
- matcher: Bash
|
|
314
|
+
hooks:
|
|
315
|
+
- type: command
|
|
316
|
+
command: echo "review-agent about to run a shell command"
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
You are a code reviewer. Analyze the code thoroughly and report findings
|
|
320
|
+
ordered by severity.
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
The remaining CC frontmatter fields — `effort`, `skills`, `initialPrompt`,
|
|
324
|
+
`memory`, `isolation` — are documented in the declarative-agent design doc
|
|
325
|
+
and land in follow-up PRs once the prerequisite infrastructure exists
|
|
326
|
+
(`effort` needs a model-layer parameter; `memory` needs a scoped memory
|
|
327
|
+
subsystem; `--agent` CLI flag enables `initialPrompt`; etc.).
|
|
328
|
+
|
|
329
|
+
> **`hooks` v1 limitation.** While a subagent declaring `hooks` is running,
|
|
330
|
+
> its hook entries fire for every matching event in the session, not only
|
|
331
|
+
> for that subagent's own tool calls. If two subagents with different
|
|
332
|
+
> per-agent hook sets run concurrently, both sets fire for both agents.
|
|
333
|
+
> Per-agent scope filtering at hook-firing time is left to a follow-up;
|
|
334
|
+
> for v1, prefer per-agent hooks that are safe to fire globally for the
|
|
335
|
+
> duration of the agent's run (e.g. logging) over hooks that mutate
|
|
336
|
+
> behavior.
|
|
337
|
+
|
|
278
338
|
#### Example Usage
|
|
279
339
|
|
|
280
340
|
```
|