@sema-ai/core 1.277.0 → 1.278.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/LICENSE +97 -21
- package/NOTICE.md +1 -1
- package/README.md +2 -5
- package/README.new.md +150 -0
- package/README.zh-CN.new.md +145 -0
- package/dist/bench/metrics.js +1 -1
- package/dist/bench/metrics.js.map +1 -1
- package/dist/core/cache-break-detector.js +0 -0
- package/dist/core/cache-break-detector.js.map +1 -1
- package/dist/core/tools.d.ts.map +1 -1
- package/dist/core/tools.js +3 -1
- package/dist/core/tools.js.map +1 -1
- package/dist/engine/execution-env/node-execution-env.d.ts.map +1 -1
- package/dist/engine/execution-env/node-execution-env.js +8 -0
- package/dist/engine/execution-env/node-execution-env.js.map +1 -1
- package/dist/engine/harness/types.d.ts +9 -1
- package/dist/engine/harness/types.d.ts.map +1 -1
- package/dist/engine/harness/types.js.map +1 -1
- package/dist/tools/fs/index.d.ts.map +1 -1
- package/dist/tools/fs/index.js +94 -3
- package/dist/tools/fs/index.js.map +1 -1
- package/dist/tools/gitea-issue.d.ts +1 -1
- package/dist/tools/gitea-issue.d.ts.map +1 -1
- package/package.json +2 -7
- package/CHANGELOG.md +0 -5455
- package/docs/A1-ATTRIBUTION-ROUND1-2026-07-09.md +0 -181
- package/docs/AB-ORACLE-GATE-VERDICT-2026-07-10.md +0 -100
- package/docs/ANCHOR-GAP-INVENTORY-2026-07-09.md +0 -143
- package/docs/ARCHITECTURE.md +0 -125
- package/docs/BUGHUNT-2026-07-05-NIGHT.md +0 -98
- package/docs/BUILD.md +0 -63
- package/docs/CANCEL-ASYNC-ATTRIBUTION-2026-07-09.md +0 -98
- package/docs/CC-198-VS-201-DRIFT-2026-07-09.md +0 -70
- package/docs/CC-BASELINE-FAKE-ZERO-AUDIT-2026-07-09.md +0 -51
- package/docs/CC-DRIFT-198-206-AGENT-TYPES-2026-07-10.md +0 -82
- package/docs/CC-DRIFT-198-206-CHANGELOG-2026-07-10.md +0 -82
- package/docs/CC-DRIFT-198-206-REMINDERS-2026-07-10.md +0 -96
- package/docs/CC-DRIFT-198-206-ROADMAP-2026-07-10.md +0 -110
- package/docs/CC-DRIFT-198-206-TOOL-INVENTORY-2026-07-10.md +0 -53
- package/docs/CC-DRIFT-198-206-USAGE-CONSTANTS-2026-07-10.md +0 -64
- package/docs/CC-DRIFT-198-206-WORKFLOW-2026-07-10.md +0 -83
- package/docs/CC-PARITY-CHECKLIST.md +0 -220
- package/docs/CC-PARITY-DEEP-SWEEP-2026-07-07.md +0 -149
- package/docs/CC-SUBAGENT-PROMPT-STUDY-2026-07-09.md +0 -219
- package/docs/CC-TASK-REMINDER-CADENCE-STUDY-2026-07-09.md +0 -396
- package/docs/CC-TOOL-PARITY-SWEEP-2026-07.md +0 -56
- package/docs/CC-TOOL-PROMPT-DEEP-DIFF-2026-07-08.md +0 -274
- package/docs/CC-TOOLSURFACE-DEEP-DIVE-2026-07-07.md +0 -197
- package/docs/CC206-OBSERVER-ANCHORS-2026-07-11.md +0 -463
- package/docs/CC207-CORE-SWEEP-BACKLOG-2026-07-12.md +0 -155
- package/docs/CENTER-CONTROL-PLANE-SEAM.md +0 -86
- package/docs/CLEANUP-CONTRACT-ANCHOR-2026-07-09.md +0 -83
- package/docs/COLD-START-RSI-2026-07-09.md +0 -72
- package/docs/COMPACTION-LIVE-AUDIT-2026-07-09.md +0 -114
- package/docs/CONTEXT-lifecycle-extension-points-and-stop-attribution.md +0 -71
- package/docs/COREWARS-POLYGLOT-TRIAGE-2026-07-09.md +0 -85
- package/docs/DEADTARGET-OVERFULL-HBOX-2026-07-10.md +0 -92
- package/docs/DEADTARGET-PATH-TRACING-REVERSE-2026-07-10.md +0 -87
- package/docs/DEADTARGET-WINNING-AVG-COREWARS-2026-07-10.md +0 -96
- package/docs/DEEPSEEK-API-LIMITS-PROBE-2026-07-09.md +0 -118
- package/docs/DESIGN-140-MOCK-VERIFY-2026-07-11.md +0 -79
- package/docs/DESIGN-140-VERIFICATION-2026-07-11.md +0 -43
- package/docs/DESIGN-DRAFT-workflow-collab-2026-07-11.md +0 -56
- package/docs/DESIGN-ORACLE-GROUNDING-GATE-2026-07-10.md +0 -167
- package/docs/DESIGN-TFRAG-RECONCILE-SCAFFOLD-2026-07-09.md +0 -102
- package/docs/EXP-PA2-PE-DESIGN-2026-07-11.md +0 -220
- package/docs/EXT-DOGFOOD-2026-07-12.md +0 -50
- package/docs/FINAL-VERIFY-SURFACE-AUDIT-2026-07-09.md +0 -44
- package/docs/FRAG-RECON-INVESTIGATION-2026-07-09.md +0 -183
- package/docs/HANDOFF.md +0 -121
- package/docs/KNOWN-ISSUES.md +0 -96
- package/docs/LEGW-WINDOW-TAX-2026-07-10.md +0 -82
- package/docs/LIVE-PROBE-BATCH-2026-07-11.md +0 -207
- package/docs/M2-CERT-ATTRIBUTION-2026-07-10.md +0 -61
- package/docs/M25-LEG-VARIANCE-ATTRIBUTION-2026-07-10.md +0 -81
- package/docs/MAILMAN-TIMEOUT-ATTRIBUTION-2026-07-10.md +0 -88
- package/docs/MEMORY-BACKEND-DIALECT-NOTES.md +0 -69
- package/docs/MTEB-ESCAPE-HATCH-ATTRIBUTION-2026-07-09.md +0 -57
- package/docs/MTEB-LEADERBOARD-ATTRIBUTION-2026-07-10.md +0 -134
- package/docs/ORACLE-GATE-NEGATIVE-SAMPLE-2026-07-11.md +0 -28
- package/docs/PARITY-CONTEXT-TRANSACTIONS-2026-07-10.md +0 -67
- package/docs/PARITY-PROGRESS-MATRIX-2026-07-10.md +0 -37
- package/docs/PARITY-SPOT-AGENT-TYPES-2026-07-10.md +0 -70
- package/docs/PARITY-SPOT-REMINDERS-2026-07-10.md +0 -144
- package/docs/PARITY-SPOT-TOOL-INVENTORY-2026-07-10.md +0 -61
- package/docs/PARITY-SPOT-USAGE-CONSTANTS-2026-07-10.md +0 -95
- package/docs/PARITY-SPOT-WORKFLOW-2026-07-10.md +0 -93
- package/docs/PASSWORD-RECOVERY-PANEL-VERDICT-2026-07-10.md +0 -62
- package/docs/R8-R9-FINALIZE-COORDINATION-2026-07-09.md +0 -124
- package/docs/REPL-CODE-MODE-EVALUATION-2026-07-10.md +0 -187
- package/docs/REPORT-1249-TARGETED.md +0 -48
- package/docs/RESEARCH-3P-MEMORY-SWAP-2026-07-12.md +0 -273
- package/docs/ROADMAP.md +0 -111
- package/docs/RSI-CLOUD-DEPLOY-2026-07-06.md +0 -289
- package/docs/RSI-PROCESS-AI-COLDSTART-2026-07-11.md +0 -68
- package/docs/S18-THOROUGHNESS-AUDIT-2026-07-09.md +0 -113
- package/docs/SERVICE-INTEGRATION-GUIDE.md +0 -298
- package/docs/SUBAGENT-STREAM-RESILIENCE-PARITY-2026-07-10.md +0 -118
- package/docs/SWEBENCH-PRO-RECON-2026-07-11.md +0 -31
- package/docs/TB-EFFICIENCY-TELEMETRY-2026-07-08.md +0 -114
- package/docs/TB-FAILURE-AUTOPSY-2026-07-05-RERUN.md +0 -67
- package/docs/TB-FAIRNESS-AUDIT-2026-07-08.md +0 -141
- package/docs/TB-FULL-1257-2026-07-08.md +0 -77
- package/docs/TB-LEG-GAP-ATTRIBUTION-1261-1263-2026-07-11.md +0 -154
- package/docs/TB-REGRESSION-DAEMON-KILL-2026-07-08.md +0 -58
- package/docs/TB-RSI-CROSSCHECK-2026-07-06.md +0 -68
- package/docs/TB-RSI-LEDGER.md +0 -30
- package/docs/TB-STABLE-SET-2026-07-08.md +0 -127
- package/docs/TB21-RECON-2026-07-11.md +0 -28
- package/docs/TEST-DESIGN-BATCH-1-2-3.md +0 -97
- package/docs/THIRD-PARTY-INTEGRATION.md +0 -45
- package/docs/TOKEN-ESTIMATE-CALIBRATION-LIVE-2026-07-09.md +0 -102
- package/docs/audit-2026-06-10-/347/254/254/344/272/214/350/275/256-/347/251/272/347/231/275/345/214/272/344/270/216/345/277/230/346/216/245/347/272/277.md +0 -147
- package/docs/audit-2026-06-10-/350/256/241/347/256/227bug/346/211/253/346/217/217.md +0 -163
- package/docs/audit-2026-06-11-/344/277/256/345/244/215/345/244/215/345/256/241/344/270/216/345/233/236/345/275/222/344/270/223/346/211/253.md +0 -95
- package/docs/audit-2026-06-12-design71-P1/346/275/234/344/274/217/351/235/242/350/243/201/345/206/263/344/270/216/345/220/236/351/224/231/345/256/241/350/256/241.md +0 -45
- package/docs/audit-2026-06-12-/345/205/254/345/274/200/346/227/213/351/222/256/346/264/273/346/200/247/344/270/216vendored/346/255/273/350/267/257.md +0 -63
- package/docs/audit-2026-06-15/ADDENDUM-second-pass.md +0 -88
- package/docs/audit-2026-06-15/ARCHITECTURE-AND-ROADMAP.md +0 -187
- package/docs/audit-2026-06-15/DOC-CORRECTIONS.md +0 -105
- package/docs/audit-2026-06-15/INDEX.md +0 -49
- package/docs/audit-2026-06-15/ORCHESTRATION-STATUS.md +0 -98
- package/docs/audit-2026-06-15/PRODUCTION-ISSUES.md +0 -189
- package/docs/audit-2026-06-15/REFERENCES-literature.md +0 -139
- package/docs/audit-2026-06-15/VENDOR-REFACTOR-PLAN.md +0 -96
- package/docs/cc-probe-198/README.md +0 -72
- package/docs/cc-probe-198/STABILITY-AUDIT.md +0 -118
- package/docs/cc-probe-198/live-schema-monitor-worktree-2026-07-09.json +0 -56
- package/docs/cc-probe-198/mount-variants.json +0 -536
- package/docs/cc-probe-198/plan-mode-run.json +0 -1
- package/docs/cc-probe-198/probe-bash-bg.json +0 -224
- package/docs/cc-probe-198/probe-edit-mismatch.json +0 -120
- package/docs/cc-probe-198/probe-read-missing.json +0 -62
- package/docs/cc-probe-198/probe-search-empty.json +0 -127
- package/docs/cc-probe-198/probe-task-family.json +0 -227
- package/docs/cc-probe-198/probes.status +0 -6
- package/docs/cc-probe-198/raw-capture-interactive.json +0 -948
- package/docs/cc-probe-198/raw-capture-print.json +0 -787
- package/docs/cc-probe-198/raw-capture2-interactive.json +0 -948
- package/docs/cc-probe-198/raw-capture2-print.json +0 -787
- package/docs/cc-probe-198/system-prompt.txt +0 -135
- package/docs/cc-probe-198/tools-array.json +0 -962
- package/docs/durability-boundary.md +0 -63
- package/docs/fix-2026-06-10-/350/256/241/347/256/227bug/344/277/256/345/244/215-search/346/211/271.md +0 -75
- package/docs/fix-2026-06-11-/347/254/254/344/272/214/350/275/256-/344/277/256/345/244/215-search/346/211/271.md +0 -62
- package/docs/parity-sweep/REPORT-DYNAMIC.md +0 -97
- package/docs/parity-sweep/REPORT-STATIC-GGB.md +0 -127
- package/docs/parity-sweep/REPORT-STATIC-RWE.md +0 -133
- package/docs/vendor-history.md +0 -385
- package/docs/vendored-upstream-diff-2026-07.md +0 -83
|
@@ -1,962 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cc_version": "2.1.198",
|
|
3
|
-
"model": "deepseek-v4-pro",
|
|
4
|
-
"captured": "2026-07-08",
|
|
5
|
-
"endpoint": "api.deepseek.com/anthropic (via local capture proxy)",
|
|
6
|
-
"n_tools_interactive": 27,
|
|
7
|
-
"n_tools_print_mode": 24,
|
|
8
|
-
"interactive_only": [
|
|
9
|
-
"AskUserQuestion",
|
|
10
|
-
"EnterPlanMode",
|
|
11
|
-
"ExitPlanMode"
|
|
12
|
-
],
|
|
13
|
-
"tools": [
|
|
14
|
-
{
|
|
15
|
-
"name": "Agent",
|
|
16
|
-
"description": "Launch a new agent to handle complex, multi-step tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types are listed in <system-reminder> messages in the conversation.\n\nWhen using the Agent tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.\n\n## When to use\n\nReach for this when the task matches an available agent type, when you have independent work to run in parallel, or when answering would mean reading across several files — delegate it and you keep the conclusion, not the file dumps. For a single-fact lookup where you already know the file, symbol, or value, search directly. Once you've delegated a search, don't also run it yourself — wait for the result.\n\n- The agent's final message is returned to you as the tool result; it is not shown to the user — relay what matters.\n- Use SendMessage with the agent's ID or name to continue a previously spawned agent with its context intact; a new Agent call starts fresh.\n- Each agent type's model, reasoning effort, and tools come from its definition (`.claude/agents/*.md` frontmatter or SDK `agents`).\n- `isolation: \"worktree\"` gives the agent its own git worktree (auto-cleaned if unchanged).\n- Subagents run in the background by default; you'll be notified when one completes. Pass `run_in_background: false` for a synchronous run when you need the result before continuing.",
|
|
17
|
-
"input_schema": {
|
|
18
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
19
|
-
"type": "object",
|
|
20
|
-
"properties": {
|
|
21
|
-
"description": {
|
|
22
|
-
"description": "A short (3-5 word) description of the task",
|
|
23
|
-
"type": "string"
|
|
24
|
-
},
|
|
25
|
-
"prompt": {
|
|
26
|
-
"description": "The task for the agent to perform",
|
|
27
|
-
"type": "string"
|
|
28
|
-
},
|
|
29
|
-
"subagent_type": {
|
|
30
|
-
"description": "The type of specialized agent to use for this task",
|
|
31
|
-
"type": "string"
|
|
32
|
-
},
|
|
33
|
-
"model": {
|
|
34
|
-
"description": "Optional model override for this agent. Takes precedence over the agent definition's model frontmatter. If omitted, uses the agent definition's model, or inherits from the parent. Ignored for subagent_type: \"fork\" — forks always inherit the parent model.",
|
|
35
|
-
"type": "string",
|
|
36
|
-
"enum": [
|
|
37
|
-
"sonnet",
|
|
38
|
-
"opus",
|
|
39
|
-
"haiku",
|
|
40
|
-
"fable"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"run_in_background": {
|
|
44
|
-
"description": "Agents run in the background by default; you will be notified when one completes. Set to false to run this agent synchronously when you need its result before continuing.",
|
|
45
|
-
"type": "boolean"
|
|
46
|
-
},
|
|
47
|
-
"isolation": {
|
|
48
|
-
"description": "Isolation mode. \"worktree\" creates a temporary git worktree so the agent works on an isolated copy of the repo. \"remote\" launches the agent in a remote cloud environment (always runs in background; availability is gated).",
|
|
49
|
-
"type": "string",
|
|
50
|
-
"enum": [
|
|
51
|
-
"worktree",
|
|
52
|
-
"remote"
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": [
|
|
57
|
-
"description",
|
|
58
|
-
"prompt"
|
|
59
|
-
],
|
|
60
|
-
"additionalProperties": false
|
|
61
|
-
},
|
|
62
|
-
"_mount": "both"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"name": "AskUserQuestion",
|
|
66
|
-
"description": "Use this tool only when you are blocked on a decision that is genuinely the user's to make: one you cannot resolve from the request, the code, or sensible defaults.\n\nUsage notes:\n- Users will always be able to select \"Other\" to provide custom text input\n- Use multiSelect: true to allow multiple answers to be selected for a question\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label\n\nPlan mode note: To switch into plan mode, use EnterPlanMode (not this tool). Once in plan mode, use this tool to clarify requirements or choose between approaches BEFORE finalizing your plan. Do NOT use this tool to ask \"Is my plan ready?\", \"Should I proceed?\", or otherwise reference \"the plan\" in questions — the user cannot see the plan until you call ExitPlanMode for approval.\n\nReserve this for decisions where the user's answer changes what you do next — not for choices with a conventional default or facts you can verify in the codebase yourself. In those cases pick the obvious option, mention it in your response, and proceed.\n\nPreview feature:\nUse the optional `preview` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).\n",
|
|
67
|
-
"input_schema": {
|
|
68
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
69
|
-
"type": "object",
|
|
70
|
-
"properties": {
|
|
71
|
-
"questions": {
|
|
72
|
-
"description": "Questions to ask the user (1-4 questions)",
|
|
73
|
-
"minItems": 1,
|
|
74
|
-
"maxItems": 4,
|
|
75
|
-
"type": "array",
|
|
76
|
-
"items": {
|
|
77
|
-
"type": "object",
|
|
78
|
-
"properties": {
|
|
79
|
-
"question": {
|
|
80
|
-
"description": "The complete question to ask the user. Should be clear, specific, and end with a question mark. Example: \"Which library should we use for date formatting?\" If multiSelect is true, phrase it accordingly, e.g. \"Which features do you want to enable?\"",
|
|
81
|
-
"type": "string"
|
|
82
|
-
},
|
|
83
|
-
"header": {
|
|
84
|
-
"description": "Very short label displayed as a chip/tag (max 12 chars). Examples: \"Auth method\", \"Library\", \"Approach\".",
|
|
85
|
-
"type": "string"
|
|
86
|
-
},
|
|
87
|
-
"options": {
|
|
88
|
-
"description": "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically.",
|
|
89
|
-
"minItems": 2,
|
|
90
|
-
"maxItems": 4,
|
|
91
|
-
"type": "array",
|
|
92
|
-
"items": {
|
|
93
|
-
"type": "object",
|
|
94
|
-
"properties": {
|
|
95
|
-
"label": {
|
|
96
|
-
"description": "The display text for this option that the user will see and select. Should be concise (1-5 words) and clearly describe the choice.",
|
|
97
|
-
"type": "string"
|
|
98
|
-
},
|
|
99
|
-
"description": {
|
|
100
|
-
"description": "Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.",
|
|
101
|
-
"type": "string"
|
|
102
|
-
},
|
|
103
|
-
"preview": {
|
|
104
|
-
"description": "Optional preview content rendered when this option is focused. Use for mockups, code snippets, or visual comparisons that help users compare options. See the tool description for the expected content format.",
|
|
105
|
-
"type": "string"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"required": [
|
|
109
|
-
"label",
|
|
110
|
-
"description"
|
|
111
|
-
],
|
|
112
|
-
"additionalProperties": false
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"multiSelect": {
|
|
116
|
-
"description": "Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.",
|
|
117
|
-
"default": false,
|
|
118
|
-
"type": "boolean"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"required": [
|
|
122
|
-
"question",
|
|
123
|
-
"header",
|
|
124
|
-
"options",
|
|
125
|
-
"multiSelect"
|
|
126
|
-
],
|
|
127
|
-
"additionalProperties": false
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"answers": {
|
|
131
|
-
"description": "User answers collected by the permission component",
|
|
132
|
-
"type": "object",
|
|
133
|
-
"propertyNames": {
|
|
134
|
-
"type": "string"
|
|
135
|
-
},
|
|
136
|
-
"additionalProperties": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"annotations": {
|
|
141
|
-
"description": "Optional per-question annotations from the user (e.g., notes on preview selections). Keyed by question text.",
|
|
142
|
-
"type": "object",
|
|
143
|
-
"propertyNames": {
|
|
144
|
-
"type": "string"
|
|
145
|
-
},
|
|
146
|
-
"additionalProperties": {
|
|
147
|
-
"type": "object",
|
|
148
|
-
"properties": {
|
|
149
|
-
"preview": {
|
|
150
|
-
"description": "The preview content of the selected option, if the question used previews.",
|
|
151
|
-
"type": "string"
|
|
152
|
-
},
|
|
153
|
-
"notes": {
|
|
154
|
-
"description": "Free-text notes the user added to their selection.",
|
|
155
|
-
"type": "string"
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"additionalProperties": false
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"metadata": {
|
|
162
|
-
"description": "Optional metadata for tracking and analytics purposes. Not displayed to user.",
|
|
163
|
-
"type": "object",
|
|
164
|
-
"properties": {
|
|
165
|
-
"source": {
|
|
166
|
-
"description": "Optional identifier for the source of this question (e.g., \"remember\" for /remember command). Used for analytics tracking.",
|
|
167
|
-
"type": "string"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"additionalProperties": false
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"required": [
|
|
174
|
-
"questions"
|
|
175
|
-
],
|
|
176
|
-
"additionalProperties": false
|
|
177
|
-
},
|
|
178
|
-
"_mount": "interactive-only"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"name": "Bash",
|
|
182
|
-
"description": "Executes a bash command and returns its output.\n\n- Working directory persists between calls, but prefer absolute paths — `cd` in a compound command can trigger a permission prompt. Shell state (env vars, functions) does not persist; the shell is initialized from the user's profile.\n- IMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user.\n- `timeout` is in milliseconds: default 120000, max 600000.\n- `run_in_background` runs the command detached: it keeps running across turns and re-invokes you when it exits. No `&` needed.\n\n# Git\n- Interactive flags (`-i`, e.g. `git rebase -i`, `git add -i`) are not supported in this environment.\n- Use the `gh` CLI for GitHub operations (PRs, issues, API).\n- Commit or push only when the user asks. If on the default branch, branch first.\n- End git commit messages with:\nCo-Authored-By: Claude <noreply@anthropic.com>\n- End PR bodies with:\n🤖 Generated with [Claude Code](https://claude.com/claude-code)",
|
|
183
|
-
"input_schema": {
|
|
184
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
185
|
-
"type": "object",
|
|
186
|
-
"properties": {
|
|
187
|
-
"command": {
|
|
188
|
-
"description": "The command to execute",
|
|
189
|
-
"type": "string"
|
|
190
|
-
},
|
|
191
|
-
"timeout": {
|
|
192
|
-
"description": "Optional timeout in milliseconds (max 600000)",
|
|
193
|
-
"type": "number"
|
|
194
|
-
},
|
|
195
|
-
"description": {
|
|
196
|
-
"description": "Clear, concise description of what this command does in active voice. Never use words like \"complex\" or \"risk\" in the description - just describe what it does.\n\nFor simple commands (git, npm, standard CLI tools), keep it brief (5-10 words):\n- ls → \"List files in current directory\"\n- git status → \"Show working tree status\"\n- npm install → \"Install package dependencies\"\n\nFor commands that are harder to parse at a glance (piped commands, obscure flags, etc.), add enough context to clarify what it does:\n- find . -name \"*.tmp\" -exec rm {} \\; → \"Find and delete all .tmp files recursively\"\n- git reset --hard origin/main → \"Discard all local changes and match remote main\"\n- curl -s url | jq '.data[]' → \"Fetch JSON from URL and extract data array elements\"",
|
|
197
|
-
"type": "string"
|
|
198
|
-
},
|
|
199
|
-
"run_in_background": {
|
|
200
|
-
"description": "Set to true to run this command in the background.",
|
|
201
|
-
"type": "boolean"
|
|
202
|
-
},
|
|
203
|
-
"dangerouslyDisableSandbox": {
|
|
204
|
-
"description": "Set this to true to dangerously override sandbox mode and run commands without sandboxing.",
|
|
205
|
-
"type": "boolean"
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
"required": [
|
|
209
|
-
"command"
|
|
210
|
-
],
|
|
211
|
-
"additionalProperties": false
|
|
212
|
-
},
|
|
213
|
-
"_mount": "both"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"name": "CronCreate",
|
|
217
|
-
"description": "Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.\n\nUses standard 5-field cron in the user's local timezone: minute hour day-of-month month day-of-week. \"0 9 * * *\" means 9am local — no timezone conversion needed.\n\n## One-shot tasks (recurring: false)\n\nFor \"remind me at X\" or \"at <time>, do Y\" requests — fire once then auto-delete.\nPin minute/hour/day-of-month/month to specific values:\n \"remind me at 2:30pm today to check the deploy\" → cron: \"30 14 <today_dom> <today_month> *\", recurring: false\n \"tomorrow morning, run the smoke test\" → cron: \"57 8 <tomorrow_dom> <tomorrow_month> *\", recurring: false\n\n## Recurring jobs (recurring: true, the default)\n\nFor \"every N minutes\" / \"every hour\" / \"weekdays at 9am\" requests:\n \"*/5 * * * *\" (every 5 min), \"0 * * * *\" (hourly), \"0 9 * * 1-5\" (weekdays at 9am local)\n\n## Avoid the :00 and :30 minute marks when the task allows it\n\nEvery user who asks for \"9am\" gets `0 9`, and every user who asks for \"hourly\" gets `0 *` — which means requests from across the planet land on the API at the same instant. When the user's request is approximate, pick a minute that is NOT 0 or 30:\n \"every morning around 9\" → \"57 8 * * *\" or \"3 9 * * *\" (not \"0 9 * * *\")\n \"hourly\" → \"7 * * * *\" (not \"0 * * * *\")\n \"in an hour or so, remind me to...\" → pick whatever minute you land on, don't round\n\nOnly use minute 0 or 30 when the user names that exact time and clearly means it (\"at 9:00 sharp\", \"at half past\", coordinating with a meeting). When in doubt, nudge a few minutes early or late — the user will not notice, and the fleet will.\n\n## Durability\n\nBy default (durable: false) the job lives only in this Claude session — nothing is written to disk, and the job is gone when Claude exits. Pass durable: true to write to .claude/scheduled_tasks.json so the job survives restarts. Only use durable: true when the user explicitly asks for the task to persist (\"keep doing this every day\", \"set this up permanently\"). Most \"remind me in 5 minutes\" / \"check back in an hour\" requests should stay session-only.\n\n## Runtime behavior\n\nJobs only fire while the REPL is idle (not mid-query). Durable jobs persist to .claude/scheduled_tasks.json and survive session restarts — on next launch they resume automatically. One-shot durable tasks that were missed while the REPL was closed are surfaced for catch-up. Session-only jobs die with the process. The scheduler adds a small deterministic jitter on top of whatever you pick: recurring tasks fire up to 10% of their period late (max 15 min); one-shot tasks landing on :00 or :30 fire up to 90 s early. Picking an off-minute is still the bigger lever.\n\nRecurring tasks auto-expire after 7 days — they fire one final time, then are deleted. This bounds session lifetime. Tell the user about the 7-day limit when scheduling recurring jobs.\n\nReturns a job ID you can pass to CronDelete.",
|
|
218
|
-
"input_schema": {
|
|
219
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
220
|
-
"type": "object",
|
|
221
|
-
"properties": {
|
|
222
|
-
"cron": {
|
|
223
|
-
"description": "Standard 5-field cron expression in local time: \"M H DoM Mon DoW\" (e.g. \"*/5 * * * *\" = every 5 minutes, \"30 14 28 2 *\" = Feb 28 at 2:30pm local once).",
|
|
224
|
-
"type": "string"
|
|
225
|
-
},
|
|
226
|
-
"prompt": {
|
|
227
|
-
"description": "The prompt to enqueue at each fire time.",
|
|
228
|
-
"type": "string"
|
|
229
|
-
},
|
|
230
|
-
"recurring": {
|
|
231
|
-
"description": "true (default) = fire on every cron match until deleted or auto-expired after 7 days. false = fire once at the next match, then auto-delete. Use false for \"remind me at X\" one-shot requests with pinned minute/hour/dom/month.",
|
|
232
|
-
"type": "boolean"
|
|
233
|
-
},
|
|
234
|
-
"durable": {
|
|
235
|
-
"description": "true = persist to .claude/scheduled_tasks.json and survive restarts. false (default) = in-memory only, dies when this Claude session ends. Use true only when the user asks the task to survive across sessions.",
|
|
236
|
-
"type": "boolean"
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
"required": [
|
|
240
|
-
"cron",
|
|
241
|
-
"prompt"
|
|
242
|
-
],
|
|
243
|
-
"additionalProperties": false
|
|
244
|
-
},
|
|
245
|
-
"_mount": "both"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"name": "CronDelete",
|
|
249
|
-
"description": "Cancel a cron job previously scheduled with CronCreate. Removes it from .claude/scheduled_tasks.json (durable jobs) or the in-memory session store (session-only jobs).",
|
|
250
|
-
"input_schema": {
|
|
251
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
252
|
-
"type": "object",
|
|
253
|
-
"properties": {
|
|
254
|
-
"id": {
|
|
255
|
-
"description": "Job ID returned by CronCreate.",
|
|
256
|
-
"type": "string"
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
"required": [
|
|
260
|
-
"id"
|
|
261
|
-
],
|
|
262
|
-
"additionalProperties": false
|
|
263
|
-
},
|
|
264
|
-
"_mount": "both"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "CronList",
|
|
268
|
-
"description": "List all cron jobs scheduled via CronCreate, both durable (.claude/scheduled_tasks.json) and session-only.",
|
|
269
|
-
"input_schema": {
|
|
270
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
271
|
-
"type": "object",
|
|
272
|
-
"properties": {},
|
|
273
|
-
"additionalProperties": false
|
|
274
|
-
},
|
|
275
|
-
"_mount": "both"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
"name": "Edit",
|
|
279
|
-
"description": "Performs exact string replacement in a file.\n\n- You must Read the file in this conversation before editing, or the call will fail.\n- `old_string` must match the file exactly, including indentation, and be unique — the edit fails otherwise. Strip the Read line prefix (line number + tab) before matching.\n- `replace_all: true` replaces every occurrence instead.",
|
|
280
|
-
"input_schema": {
|
|
281
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
282
|
-
"type": "object",
|
|
283
|
-
"properties": {
|
|
284
|
-
"file_path": {
|
|
285
|
-
"description": "The absolute path to the file to modify",
|
|
286
|
-
"type": "string"
|
|
287
|
-
},
|
|
288
|
-
"old_string": {
|
|
289
|
-
"description": "The text to replace",
|
|
290
|
-
"type": "string"
|
|
291
|
-
},
|
|
292
|
-
"new_string": {
|
|
293
|
-
"description": "The text to replace it with (must be different from old_string)",
|
|
294
|
-
"type": "string"
|
|
295
|
-
},
|
|
296
|
-
"replace_all": {
|
|
297
|
-
"description": "Replace all occurrences of old_string (default false)",
|
|
298
|
-
"default": false,
|
|
299
|
-
"type": "boolean"
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
"required": [
|
|
303
|
-
"file_path",
|
|
304
|
-
"old_string",
|
|
305
|
-
"new_string"
|
|
306
|
-
],
|
|
307
|
-
"additionalProperties": false
|
|
308
|
-
},
|
|
309
|
-
"_mount": "both"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"name": "EnterPlanMode",
|
|
313
|
-
"description": "Use this tool proactively when you're about to start a non-trivial implementation task. Getting user sign-off on your approach before writing code prevents wasted effort and ensures alignment. This tool transitions you into plan mode where you can explore the codebase and design an implementation approach for user approval.\n\n## When to Use This Tool\n\n**Prefer using EnterPlanMode** for implementation tasks unless they're simple. Use it when ANY of these conditions apply:\n\n1. **New Feature Implementation**: Adding meaningful new functionality\n - Example: \"Add a logout button\" - where should it go? What should happen on click?\n - Example: \"Add form validation\" - what rules? What error messages?\n\n2. **Multiple Valid Approaches**: The task can be solved in several different ways\n - Example: \"Add caching to the API\" - could use Redis, in-memory, file-based, etc.\n - Example: \"Improve performance\" - many optimization strategies possible\n\n3. **Code Modifications**: Changes that affect existing behavior or structure\n - Example: \"Update the login flow\" - what exactly should change?\n - Example: \"Refactor this component\" - what's the target architecture?\n\n4. **Architectural Decisions**: The task requires choosing between patterns or technologies\n - Example: \"Add real-time updates\" - WebSockets vs SSE vs polling\n - Example: \"Implement state management\" - Redux vs Context vs custom solution\n\n5. **Multi-File Changes**: The task will likely touch more than 2-3 files\n - Example: \"Refactor the authentication system\"\n - Example: \"Add a new API endpoint with tests\"\n\n6. **Unclear Requirements**: You need to explore before understanding the full scope\n - Example: \"Make the app faster\" - need to profile and identify bottlenecks\n - Example: \"Fix the bug in checkout\" - need to investigate root cause\n\n7. **User Preferences Matter**: The implementation could reasonably go multiple ways\n - If you would use AskUserQuestion to clarify the approach, use EnterPlanMode instead\n - Plan mode lets you explore first, then present options with context\n\n## When NOT to Use This Tool\n\nOnly skip EnterPlanMode for simple tasks:\n- Single-line or few-line fixes (typos, obvious bugs, small tweaks)\n- Adding a single function with clear requirements\n- Tasks where the user has given very specific, detailed instructions\n- Pure research/exploration tasks (use the Agent tool instead)\n\n## What Happens in Plan Mode\n\nIn plan mode, you'll:\n1. Thoroughly explore the codebase using `find`/Glob, `grep`/Grep, and Read\n2. Understand existing patterns and architecture\n3. Design an implementation approach\n4. Present your plan to the user for approval\n5. Use AskUserQuestion if you need to clarify approaches\n6. Exit plan mode with ExitPlanMode when ready to implement\n\n## Examples\n\n### GOOD - Use EnterPlanMode:\nUser: \"Add user authentication to the app\"\n- Requires architectural decisions (session vs JWT, where to store tokens, middleware structure)\n\nUser: \"Optimize the database queries\"\n- Multiple approaches possible, need to profile first, significant impact\n\nUser: \"Implement dark mode\"\n- Architectural decision on theme system, affects many components\n\nUser: \"Add a delete button to the user profile\"\n- Seems simple but involves: where to place it, confirmation dialog, API call, error handling, state updates\n\nUser: \"Update the error handling in the API\"\n- Affects multiple files, user should approve the approach\n\n### BAD - Don't use EnterPlanMode:\nUser: \"Fix the typo in the README\"\n- Straightforward, no planning needed\n\nUser: \"Add a console.log to debug this function\"\n- Simple, obvious implementation\n\nUser: \"What files handle routing?\"\n- Research task, not implementation planning\n\n## Important Notes\n\n- This tool REQUIRES user approval - they must consent to entering plan mode\n- If unsure whether to use it, err on the side of planning - it's better to get alignment upfront than to redo work\n- Users appreciate being consulted before significant changes are made to their codebase\n",
|
|
314
|
-
"input_schema": {
|
|
315
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
316
|
-
"type": "object",
|
|
317
|
-
"properties": {},
|
|
318
|
-
"additionalProperties": false
|
|
319
|
-
},
|
|
320
|
-
"_mount": "interactive-only"
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"name": "EnterWorktree",
|
|
324
|
-
"description": "Use this tool ONLY when explicitly instructed to work in a worktree — either by the user directly, or by project instructions (CLAUDE.md / memory). This tool creates an isolated git worktree and switches the current session into it.\n\n## When to Use\n\n- The user explicitly says \"worktree\" (e.g., \"start a worktree\", \"work in a worktree\", \"create a worktree\", \"use a worktree\")\n- CLAUDE.md or memory instructions direct you to work in a worktree for the current task\n\n## When NOT to Use\n\n- The user asks to create a branch, switch branches, or work on a different branch — use git commands instead\n- The user asks to fix a bug or work on a feature — use normal git workflow unless worktrees are explicitly requested by the user or project instructions\n- Never use this tool unless \"worktree\" is explicitly mentioned by the user or in CLAUDE.md / memory instructions\n\n## Requirements\n\n- Must be in a git repository, OR have WorktreeCreate/WorktreeRemove hooks configured in settings.json\n- Must not already be in a worktree session when creating a new worktree (`name`); switching into another existing worktree via `path` is allowed\n\n## Behavior\n\n- In a git repository: creates a new git worktree inside `.claude/worktrees/` on a new branch. The base ref is governed by the `worktree.baseRef` setting: `fresh` (default) branches from origin/<default-branch>; `head` branches from your current local HEAD\n- Outside a git repository: delegates to WorktreeCreate/WorktreeRemove hooks for VCS-agnostic isolation\n- Switches the session's working directory to the new worktree\n- Use ExitWorktree to leave the worktree mid-session (keep or remove). On session exit, if still in the worktree, the user will be prompted to keep or remove it\n\n## Entering an existing worktree\n\nPass `path` instead of `name` to switch the session into a worktree that already exists (e.g., one you just created with `git worktree add`). The path must appear in `git worktree list` for the current repository — paths that are not registered worktrees of this repo are rejected. ExitWorktree will not remove a worktree entered this way; use `action: \"keep\"` to return to the original directory.\n\nSwitching with `path` also works when the session is already in a worktree (the previous worktree is left on disk, untouched, and only the new one is tracked for exit-time cleanup), and from agents whose working directory was pinned at launch (subagent isolation or explicit cwd). In both cases the target must be a worktree under `.claude/worktrees/` of the same repository, and from a pinned agent the switch only affects this agent, not the parent session. After a further switch, previously-visited worktrees are no longer writable — re-issue EnterWorktree with `path` to return to one.\n\n## Parameters\n\n- `name` (optional): A name for a new worktree. If neither `name` nor `path` is provided, a random name is generated.\n- `path` (optional): Path to an existing worktree of the current repository to enter instead of creating one. Mutually exclusive with `name`.\n",
|
|
325
|
-
"input_schema": {
|
|
326
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
327
|
-
"type": "object",
|
|
328
|
-
"properties": {
|
|
329
|
-
"name": {
|
|
330
|
-
"description": "Optional name for a new worktree. Each \"/\"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided. Mutually exclusive with `path`.",
|
|
331
|
-
"type": "string"
|
|
332
|
-
},
|
|
333
|
-
"path": {
|
|
334
|
-
"description": "Path to an existing worktree of the current repository to switch into instead of creating a new one. Must appear in `git worktree list` for the current repo. Mutually exclusive with `name`.",
|
|
335
|
-
"type": "string"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
"additionalProperties": false
|
|
339
|
-
},
|
|
340
|
-
"_mount": "both"
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"name": "ExitPlanMode",
|
|
344
|
-
"description": "Use this tool when you are in plan mode and have finished writing your plan to the plan file and are ready for user approval.\n\n## How This Tool Works\n- You should have already written your plan to the plan file specified in the plan mode system message\n- This tool does NOT take the plan content as a parameter - it will read the plan from the file you wrote\n- This tool simply signals that you're done planning and ready for the user to review and approve\n- The user will see the contents of your plan file when they review it\n\n## When to Use This Tool\nIMPORTANT: Only use this tool when the task requires planning the implementation steps of a task that requires writing code. For research tasks where you're gathering information, searching files, reading files or in general trying to understand the codebase - do NOT use this tool.\n\n## Before Using This Tool\nEnsure your plan is complete and unambiguous:\n- If you have unresolved questions about requirements or approach, use AskUserQuestion first (in earlier phases)\n- Once your plan is finalized, use THIS tool to request approval\n\n**Important:** Do NOT use AskUserQuestion to ask \"Is this plan okay?\" or \"Should I proceed?\" - that's exactly what THIS tool does. ExitPlanMode inherently requests user approval of your plan.\n\n## Examples\n\n1. Initial task: \"Search for and understand the implementation of vim mode in the codebase\" - Do not use the exit plan mode tool because you are not planning the implementation steps of a task.\n2. Initial task: \"Help me implement yank mode for vim\" - Use the exit plan mode tool after you have finished planning the implementation steps of the task.\n3. Initial task: \"Add a new feature to handle user authentication\" - If unsure about auth method (OAuth, JWT, etc.), use AskUserQuestion first, then use exit plan mode tool after clarifying the approach.\n",
|
|
345
|
-
"input_schema": {
|
|
346
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
347
|
-
"type": "object",
|
|
348
|
-
"properties": {
|
|
349
|
-
"allowedPrompts": {
|
|
350
|
-
"description": "Prompt-based permissions needed to implement the plan. These describe categories of actions rather than specific commands.",
|
|
351
|
-
"type": "array",
|
|
352
|
-
"items": {
|
|
353
|
-
"type": "object",
|
|
354
|
-
"properties": {
|
|
355
|
-
"tool": {
|
|
356
|
-
"description": "The tool this prompt applies to",
|
|
357
|
-
"type": "string",
|
|
358
|
-
"enum": [
|
|
359
|
-
"Bash"
|
|
360
|
-
]
|
|
361
|
-
},
|
|
362
|
-
"prompt": {
|
|
363
|
-
"description": "Semantic description of the action, e.g. \"run tests\", \"install dependencies\"",
|
|
364
|
-
"type": "string"
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
"required": [
|
|
368
|
-
"tool",
|
|
369
|
-
"prompt"
|
|
370
|
-
],
|
|
371
|
-
"additionalProperties": false
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
"additionalProperties": {}
|
|
376
|
-
},
|
|
377
|
-
"_mount": "interactive-only"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
"name": "ExitWorktree",
|
|
381
|
-
"description": "Exit a worktree session created by EnterWorktree and return the session to the original working directory.\n\n## Scope\n\nThis tool ONLY operates on worktrees created by EnterWorktree in this session. It will NOT touch:\n- Worktrees you created manually with `git worktree add`\n- Worktrees from a previous session (even if created by EnterWorktree then)\n- The directory you're in if EnterWorktree was never called\n\nIf called outside an EnterWorktree session, the tool is a **no-op**: it reports that no worktree session is active and takes no action. Filesystem state is unchanged.\n\n## When to Use\n\n- The user explicitly asks to \"exit the worktree\", \"leave the worktree\", \"go back\", or otherwise end the worktree session\n- Do NOT call this proactively — only when the user asks\n\n## Parameters\n\n- `action` (required): `\"keep\"` or `\"remove\"`\n - `\"keep\"` — leave the worktree directory and branch intact on disk. Use this if the user wants to come back to the work later, or if there are changes to preserve.\n - `\"remove\"` — delete the worktree directory and its branch. Use this for a clean exit when the work is done or abandoned.\n- `discard_changes` (optional, default false): only meaningful with `action: \"remove\"`. If the worktree has uncommitted files or commits not on the original branch, the tool will REFUSE to remove it unless this is set to `true`. If the tool returns an error listing changes, confirm with the user before re-invoking with `discard_changes: true`.\n\n## Behavior\n\n- Restores the session's working directory to where it was before EnterWorktree\n- Clears CWD-dependent caches (system prompt sections, memory files, plans directory) so the session state reflects the original directory\n- If a tmux session was attached to the worktree: killed on `remove`, left running on `keep` (its name is returned so the user can reattach)\n- Once exited, EnterWorktree can be called again to create a fresh worktree\n",
|
|
382
|
-
"input_schema": {
|
|
383
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
384
|
-
"type": "object",
|
|
385
|
-
"properties": {
|
|
386
|
-
"action": {
|
|
387
|
-
"description": "\"keep\" leaves the worktree and branch on disk; \"remove\" deletes both.",
|
|
388
|
-
"type": "string",
|
|
389
|
-
"enum": [
|
|
390
|
-
"keep",
|
|
391
|
-
"remove"
|
|
392
|
-
]
|
|
393
|
-
},
|
|
394
|
-
"discard_changes": {
|
|
395
|
-
"description": "Required true when action is \"remove\" and the worktree has uncommitted files or unmerged commits. The tool will refuse and list them otherwise.",
|
|
396
|
-
"type": "boolean"
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
"required": [
|
|
400
|
-
"action"
|
|
401
|
-
],
|
|
402
|
-
"additionalProperties": false
|
|
403
|
-
},
|
|
404
|
-
"_mount": "both"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
"name": "NotebookEdit",
|
|
408
|
-
"description": "Replaces, inserts, or deletes a single cell in a Jupyter notebook (.ipynb file).\n\nUsage:\n- You must use the Read tool on the notebook in this conversation before editing — this tool will fail otherwise.\n- `notebook_path` must be an absolute path.\n- `cell_id` is the `id` attribute shown in the Read tool's `<cell id=\"...\">` output. It is required for `replace` and `delete`.\n- `edit_mode` defaults to `replace`. Use `insert` to add a new cell after the cell with the given `cell_id` (or at the beginning of the notebook if `cell_id` is omitted) — `cell_type` is required when inserting. Use `delete` to remove the cell.",
|
|
409
|
-
"input_schema": {
|
|
410
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
411
|
-
"type": "object",
|
|
412
|
-
"properties": {
|
|
413
|
-
"notebook_path": {
|
|
414
|
-
"description": "The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)",
|
|
415
|
-
"type": "string"
|
|
416
|
-
},
|
|
417
|
-
"cell_id": {
|
|
418
|
-
"description": "The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified.",
|
|
419
|
-
"type": "string"
|
|
420
|
-
},
|
|
421
|
-
"new_source": {
|
|
422
|
-
"description": "The new source for the cell",
|
|
423
|
-
"type": "string"
|
|
424
|
-
},
|
|
425
|
-
"cell_type": {
|
|
426
|
-
"description": "The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required.",
|
|
427
|
-
"type": "string",
|
|
428
|
-
"enum": [
|
|
429
|
-
"code",
|
|
430
|
-
"markdown"
|
|
431
|
-
]
|
|
432
|
-
},
|
|
433
|
-
"edit_mode": {
|
|
434
|
-
"description": "The type of edit to make (replace, insert, delete). Defaults to replace.",
|
|
435
|
-
"type": "string",
|
|
436
|
-
"enum": [
|
|
437
|
-
"replace",
|
|
438
|
-
"insert",
|
|
439
|
-
"delete"
|
|
440
|
-
]
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
"required": [
|
|
444
|
-
"notebook_path",
|
|
445
|
-
"new_source"
|
|
446
|
-
],
|
|
447
|
-
"additionalProperties": false
|
|
448
|
-
},
|
|
449
|
-
"_mount": "both"
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
"name": "Read",
|
|
453
|
-
"description": "Reads a file from the local filesystem.\n\n- `file_path` must be an absolute path.\n- Reads up to 2000 lines by default.\n- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters\n- Results are returned using cat -n format, with line numbers starting at 1\n- Reads images (PNG, JPG, …) and presents them visually. Reads PDFs via the `pages` parameter (e.g. \"1-5\", max 20 pages/request; required for PDFs over 10 pages). Reads Jupyter notebooks (.ipynb) as cells with outputs.\n- Reading a directory, a missing file, or an empty file returns an error or system reminder rather than content.\n- Do NOT re-read a file you just edited to verify — Edit/Write would have errored if the change failed, and the harness tracks file state for you.",
|
|
454
|
-
"input_schema": {
|
|
455
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
456
|
-
"type": "object",
|
|
457
|
-
"properties": {
|
|
458
|
-
"file_path": {
|
|
459
|
-
"description": "The absolute path to the file to read",
|
|
460
|
-
"type": "string"
|
|
461
|
-
},
|
|
462
|
-
"offset": {
|
|
463
|
-
"description": "The line number to start reading from. Only provide if the file is too large to read at once",
|
|
464
|
-
"type": "integer",
|
|
465
|
-
"minimum": 0,
|
|
466
|
-
"maximum": 9007199254740991
|
|
467
|
-
},
|
|
468
|
-
"limit": {
|
|
469
|
-
"description": "The number of lines to read. Only provide if the file is too large to read at once.",
|
|
470
|
-
"type": "integer",
|
|
471
|
-
"exclusiveMinimum": 0,
|
|
472
|
-
"maximum": 9007199254740991
|
|
473
|
-
},
|
|
474
|
-
"pages": {
|
|
475
|
-
"description": "Page range for PDF files (e.g., \"1-5\", \"3\", \"10-20\"). Only applicable to PDF files. Maximum 20 pages per request.",
|
|
476
|
-
"type": "string"
|
|
477
|
-
}
|
|
478
|
-
},
|
|
479
|
-
"required": [
|
|
480
|
-
"file_path"
|
|
481
|
-
],
|
|
482
|
-
"additionalProperties": false
|
|
483
|
-
},
|
|
484
|
-
"_mount": "both"
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
"name": "ReportFindings",
|
|
488
|
-
"description": "Report code-review findings as a typed list so the host UI can render them. Use this only when the active code-review instructions tell you to report findings with this tool; otherwise follow whatever output format those instructions specify. When reporting a review's results, call it once with the verified findings ranked most-severe first (empty array if nothing survived verification) and do not also print the findings as text. When re-reporting after applying fixes (only if the apply instructions ask for it), set `outcome` on each finding to what actually happened.",
|
|
489
|
-
"input_schema": {
|
|
490
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
491
|
-
"type": "object",
|
|
492
|
-
"properties": {
|
|
493
|
-
"level": {
|
|
494
|
-
"description": "Effort level the review ran at",
|
|
495
|
-
"type": "string",
|
|
496
|
-
"enum": [
|
|
497
|
-
"low",
|
|
498
|
-
"medium",
|
|
499
|
-
"high",
|
|
500
|
-
"xhigh",
|
|
501
|
-
"max"
|
|
502
|
-
]
|
|
503
|
-
},
|
|
504
|
-
"findings": {
|
|
505
|
-
"description": "Verified findings, most-severe first; empty if none survived",
|
|
506
|
-
"maxItems": 32,
|
|
507
|
-
"type": "array",
|
|
508
|
-
"items": {
|
|
509
|
-
"type": "object",
|
|
510
|
-
"properties": {
|
|
511
|
-
"file": {
|
|
512
|
-
"description": "Repo-relative path of the file the finding is in",
|
|
513
|
-
"type": "string"
|
|
514
|
-
},
|
|
515
|
-
"line": {
|
|
516
|
-
"description": "1-indexed line the finding anchors to",
|
|
517
|
-
"type": "integer",
|
|
518
|
-
"minimum": -9007199254740991,
|
|
519
|
-
"maximum": 9007199254740991
|
|
520
|
-
},
|
|
521
|
-
"summary": {
|
|
522
|
-
"description": "One-sentence statement of the defect",
|
|
523
|
-
"type": "string"
|
|
524
|
-
},
|
|
525
|
-
"failure_scenario": {
|
|
526
|
-
"description": "Concrete inputs/state → wrong output/crash",
|
|
527
|
-
"type": "string"
|
|
528
|
-
},
|
|
529
|
-
"verdict": {
|
|
530
|
-
"description": "Set when a verify pass ran; absent on inline-only reviews",
|
|
531
|
-
"type": "string",
|
|
532
|
-
"enum": [
|
|
533
|
-
"CONFIRMED",
|
|
534
|
-
"PLAUSIBLE"
|
|
535
|
-
]
|
|
536
|
-
},
|
|
537
|
-
"outcome": {
|
|
538
|
-
"description": "Set ONLY when re-reporting after applying fixes: what happened to this finding",
|
|
539
|
-
"type": "string",
|
|
540
|
-
"enum": [
|
|
541
|
-
"fixed",
|
|
542
|
-
"skipped",
|
|
543
|
-
"no_change_needed"
|
|
544
|
-
]
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
"required": [
|
|
548
|
-
"file",
|
|
549
|
-
"summary",
|
|
550
|
-
"failure_scenario"
|
|
551
|
-
],
|
|
552
|
-
"additionalProperties": false
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
},
|
|
556
|
-
"required": [
|
|
557
|
-
"findings"
|
|
558
|
-
],
|
|
559
|
-
"additionalProperties": false
|
|
560
|
-
},
|
|
561
|
-
"_mount": "both"
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
"name": "ScheduleWakeup",
|
|
565
|
-
"description": "Schedule when to resume work in /loop dynamic mode — the user invoked /loop without an interval, asking you to self-pace iterations of a specific task.\n\nDo NOT schedule a short-interval wakeup to poll for background work you started — when harness-tracked work finishes, you are re-invoked automatically, so polling is wasted. Instead schedule a long fallback (1200s+) so the loop survives if the work hangs or never notifies. The exception is external work the harness cannot track (a CI run, a deploy, a remote queue) — there, pick a delay matched to how fast that state actually changes.\n\nPass the same /loop prompt back via `prompt` each turn so the next firing repeats the task. For an autonomous /loop (no user prompt), pass the literal sentinel `<<autonomous-loop-dynamic>>` as `prompt` instead — the runtime resolves it back to the autonomous-loop instructions at fire time. (There is a similar `<<autonomous-loop>>` sentinel for CronCreate-based autonomous loops; do not confuse the two — ScheduleWakeup always uses the `-dynamic` variant.) Omit the call to end the loop.\n\n## Picking delaySeconds\n\nThe Anthropic prompt cache has a 5-minute TTL. Sleeping past 300 seconds means the next wake-up reads your full conversation context uncached — slower and more expensive. So the natural breakpoints:\n\n- **Under 5 minutes (60s–270s)**: cache stays warm. Right for actively polling external state the harness can't notify you about — a CI run, a deploy, a remote queue.\n- **5 minutes to 1 hour (300s–3600s)**: pay the cache miss. Right when there's no point checking sooner — waiting on something that takes minutes to change, genuinely idle, or as the long fallback heartbeat when something else is the primary wake signal.\n\n**Don't pick 300s.** It's the worst-of-both: you pay the cache miss without amortizing it. If you're tempted to \"wait 5 minutes,\" either drop to 270s (stay in cache) or commit to 1200s+ (one cache miss buys a much longer wait). Don't think in round-number minutes — think in cache windows.\n\nFor idle ticks with no specific signal to watch, default to **1200s–1800s** (20–30 min). The loop checks back, you don't burn cache 12× per hour for nothing, and the user can always interrupt if they need you sooner.\n\nThink about what you're actually waiting for, not just \"how long should I sleep.\" If you're polling a CI run that takes ~8 minutes, sleeping 60s burns the cache 8 times before it finishes — sleep ~270s twice instead.\n\nThe runtime clamps to [60, 3600], so you don't need to clamp yourself.\n\n## The reason field\n\nOne short sentence on what you chose and why. Goes to telemetry and is shown back to the user. \"watching CI run\" beats \"waiting.\" The user reads this to understand what you're doing without having to predict your cadence in advance — make it specific.\n",
|
|
566
|
-
"input_schema": {
|
|
567
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
568
|
-
"type": "object",
|
|
569
|
-
"properties": {
|
|
570
|
-
"delaySeconds": {
|
|
571
|
-
"description": "Seconds from now to wake up. Clamped to [60, 3600] by the runtime.",
|
|
572
|
-
"type": "number"
|
|
573
|
-
},
|
|
574
|
-
"reason": {
|
|
575
|
-
"description": "One short sentence explaining the chosen delay. Goes to telemetry and is shown to the user. Be specific.",
|
|
576
|
-
"type": "string"
|
|
577
|
-
},
|
|
578
|
-
"prompt": {
|
|
579
|
-
"description": "The /loop input to fire on wake-up. Pass the same /loop input verbatim each turn so the next firing re-enters the skill and continues the loop. For autonomous /loop (no user prompt), pass the literal sentinel `<<autonomous-loop-dynamic>>` instead (the dynamic-pacing variant, not the CronCreate-mode `<<autonomous-loop>>`).",
|
|
580
|
-
"type": "string"
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
"required": [
|
|
584
|
-
"delaySeconds",
|
|
585
|
-
"reason",
|
|
586
|
-
"prompt"
|
|
587
|
-
],
|
|
588
|
-
"additionalProperties": false
|
|
589
|
-
},
|
|
590
|
-
"_mount": "both"
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
"name": "SendMessage",
|
|
594
|
-
"description": "# SendMessage\n\nSend a message to another agent.\n\n```json\n{\"to\": \"researcher\", \"summary\": \"assign task 1\", \"message\": \"start on task #1\"}\n```\n\n| `to` | |\n|---|---|\n| `\"researcher\"` | Teammate by name |\n| `\"main\"` | The main conversation (background subagents only) |\n\nYour plain text output is NOT visible to other agents — to communicate, you MUST call this tool. Messages from teammates are delivered automatically; you don't check an inbox. Refer to active teammates by name; to resume a completed background agent, use the `agentId` (format `a...-...`) from its spawn result. When relaying, don't quote the original — it's already rendered to the user.",
|
|
595
|
-
"input_schema": {
|
|
596
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
597
|
-
"type": "object",
|
|
598
|
-
"properties": {
|
|
599
|
-
"to": {
|
|
600
|
-
"description": "Recipient: teammate name",
|
|
601
|
-
"type": "string"
|
|
602
|
-
},
|
|
603
|
-
"summary": {
|
|
604
|
-
"description": "A 5-10 word summary shown as a preview in the UI (required when message is a string)",
|
|
605
|
-
"type": "string",
|
|
606
|
-
"maxLength": 200
|
|
607
|
-
},
|
|
608
|
-
"message": {
|
|
609
|
-
"description": "Plain text message content",
|
|
610
|
-
"type": "string"
|
|
611
|
-
}
|
|
612
|
-
},
|
|
613
|
-
"required": [
|
|
614
|
-
"to",
|
|
615
|
-
"message"
|
|
616
|
-
],
|
|
617
|
-
"additionalProperties": false
|
|
618
|
-
},
|
|
619
|
-
"_mount": "both"
|
|
620
|
-
},
|
|
621
|
-
{
|
|
622
|
-
"name": "Skill",
|
|
623
|
-
"description": "Execute a skill within the main conversation\n\nWhen users ask you to perform tasks, check if any of the available skills match. Skills provide specialized capabilities and domain knowledge.\n\nWhen users reference a \"slash command\" or \"/<something>\", they are referring to a skill. Use this tool to invoke it.\n\nHow to invoke:\n- Set `skill` to the exact name of an available skill (no leading slash). For plugin-namespaced skills use the fully qualified `plugin:skill` form.\n- Set `args` to pass optional arguments.\n- Some skills are scoped to a directory: their name is prefixed with the directory (e.g. `apps/web:deploy`) and their description says which directory they apply to. When a skill name has both a scoped and an unscoped variant, pick by the files you are working on: if the files are under a variant's directory, invoke that variant (most specific directory wins); otherwise invoke the unscoped one.\n\nImportant:\n- Available skills are listed in system-reminder messages in the conversation\n- Only invoke a skill that appears in that list, or one the user explicitly typed as `/<name>` in their message. Never guess or invent a skill name from training data; otherwise do not call this tool\n- When a skill matches the user's request, this is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task\n- NEVER mention a skill without actually calling this tool\n- Do not invoke a skill that is already running\n- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)\n- If you see a <command-name> tag in the current conversation turn, the skill has ALREADY been loaded - follow the instructions directly instead of calling this tool again\n",
|
|
624
|
-
"input_schema": {
|
|
625
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
626
|
-
"type": "object",
|
|
627
|
-
"properties": {
|
|
628
|
-
"skill": {
|
|
629
|
-
"description": "The name of a skill from the available-skills list. Do not guess names.",
|
|
630
|
-
"type": "string"
|
|
631
|
-
},
|
|
632
|
-
"args": {
|
|
633
|
-
"description": "Optional arguments for the skill",
|
|
634
|
-
"type": "string"
|
|
635
|
-
}
|
|
636
|
-
},
|
|
637
|
-
"required": [
|
|
638
|
-
"skill"
|
|
639
|
-
],
|
|
640
|
-
"additionalProperties": false
|
|
641
|
-
},
|
|
642
|
-
"_mount": "both"
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
"name": "TaskCreate",
|
|
646
|
-
"description": "Use this tool to create a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\nIt also helps the user understand the progress of the task and overall progress of their requests.\n\n## When to Use This Tool\n\nUse this tool proactively in these scenarios:\n\n- Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n- Plan mode - When using plan mode, create a task list to track the work\n- User explicitly requests todo list - When the user directly asks you to use the todo list\n- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n- After receiving new instructions - Immediately capture user requirements as tasks\n- When you start working on a task - Mark it as in_progress BEFORE beginning work\n- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n- There is only a single, straightforward task\n- The task is trivial and tracking it provides no organizational benefit\n- The task can be completed in less than 3 trivial steps\n- The task is purely conversational or informational\n\nNOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n\n## Task Fields\n\n- **subject**: A brief, actionable title in imperative form (e.g., \"Fix authentication bug in login flow\")\n- **description**: What needs to be done\n- **activeForm** (optional): Present continuous form shown in the spinner when the task is in_progress (e.g., \"Fixing authentication bug\"). If omitted, the spinner shows the subject instead.\n\nAll tasks are created with status `pending`.\n\n## Tips\n\n- Create tasks with clear, specific subjects that describe the outcome\n- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed\n- Check TaskList first to avoid creating duplicate tasks\n",
|
|
647
|
-
"input_schema": {
|
|
648
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
649
|
-
"type": "object",
|
|
650
|
-
"properties": {
|
|
651
|
-
"subject": {
|
|
652
|
-
"description": "A brief title for the task",
|
|
653
|
-
"type": "string"
|
|
654
|
-
},
|
|
655
|
-
"description": {
|
|
656
|
-
"description": "What needs to be done",
|
|
657
|
-
"type": "string"
|
|
658
|
-
},
|
|
659
|
-
"activeForm": {
|
|
660
|
-
"description": "Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")",
|
|
661
|
-
"type": "string"
|
|
662
|
-
},
|
|
663
|
-
"metadata": {
|
|
664
|
-
"description": "Arbitrary metadata to attach to the task",
|
|
665
|
-
"type": "object",
|
|
666
|
-
"propertyNames": {
|
|
667
|
-
"type": "string"
|
|
668
|
-
},
|
|
669
|
-
"additionalProperties": {}
|
|
670
|
-
}
|
|
671
|
-
},
|
|
672
|
-
"required": [
|
|
673
|
-
"subject",
|
|
674
|
-
"description"
|
|
675
|
-
],
|
|
676
|
-
"additionalProperties": false
|
|
677
|
-
},
|
|
678
|
-
"_mount": "both"
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
"name": "TaskGet",
|
|
682
|
-
"description": "Use this tool to retrieve a task by its ID from the task list.\n\n## When to Use This Tool\n\n- When you need the full description and context before starting work on a task\n- To understand task dependencies (what it blocks, what blocks it)\n- After being assigned a task, to get complete requirements\n\n## Output\n\nReturns full task details:\n- **subject**: Task title\n- **description**: Detailed requirements and context\n- **status**: 'pending', 'in_progress', or 'completed'\n- **blocks**: Tasks waiting on this one to complete\n- **blockedBy**: Tasks that must complete before this one can start\n\n## Tips\n\n- After fetching a task, verify its blockedBy list is empty before beginning work.\n- Use TaskList to see all tasks in summary form.\n",
|
|
683
|
-
"input_schema": {
|
|
684
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
685
|
-
"type": "object",
|
|
686
|
-
"properties": {
|
|
687
|
-
"taskId": {
|
|
688
|
-
"description": "The ID of the task to retrieve",
|
|
689
|
-
"type": "string"
|
|
690
|
-
}
|
|
691
|
-
},
|
|
692
|
-
"required": [
|
|
693
|
-
"taskId"
|
|
694
|
-
],
|
|
695
|
-
"additionalProperties": false
|
|
696
|
-
},
|
|
697
|
-
"_mount": "both"
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
"name": "TaskList",
|
|
701
|
-
"description": "Use this tool to list all tasks in the task list.\n\n## When to Use This Tool\n\n- To see what tasks are available to work on (status: 'pending', no owner, not blocked)\n- To check overall progress on the project\n- To find tasks that are blocked and need dependencies resolved\n- After completing a task, to check for newly unblocked work or claim the next available task\n- **Prefer working on tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones\n\n## Output\n\nReturns a summary of each task:\n- **id**: Task identifier (use with TaskGet, TaskUpdate)\n- **subject**: Brief description of the task\n- **status**: 'pending', 'in_progress', or 'completed'\n- **owner**: Agent ID if assigned, empty if available\n- **blockedBy**: List of open task IDs that must be resolved first (tasks with blockedBy cannot be claimed until dependencies resolve)\n\nUse TaskGet with a specific task ID to view full details including description and comments.\n",
|
|
702
|
-
"input_schema": {
|
|
703
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
704
|
-
"type": "object",
|
|
705
|
-
"properties": {},
|
|
706
|
-
"additionalProperties": false
|
|
707
|
-
},
|
|
708
|
-
"_mount": "both"
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
"name": "TaskOutput",
|
|
712
|
-
"description": "DEPRECATED: Background tasks return their output file path in the tool result, and you receive a <task-notification> with the same path when the task completes.\n- For bash tasks: prefer using the Read tool on that output file path — it contains stdout/stderr.\n- For local_agent tasks: use the Agent tool result directly. Do NOT Read the .output file — it is a symlink to the full subagent conversation transcript (JSONL) and will overflow your context window.\n- For remote_agent tasks: prefer using the Read tool on the output file path — it contains the streamed remote session output (same as bash).\n\n- Retrieves output from a running or completed task (background shell, agent, or remote session)\n- Takes a task_id parameter identifying the task\n- Returns the task output along with status information\n- Use block=true (default) to wait for task completion\n- Use block=false for non-blocking check of current status\n- Task IDs can be found using the /tasks command\n- Works with all task types: background shells, async agents, and remote sessions",
|
|
713
|
-
"input_schema": {
|
|
714
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
715
|
-
"type": "object",
|
|
716
|
-
"properties": {
|
|
717
|
-
"task_id": {
|
|
718
|
-
"description": "The task ID to get output from",
|
|
719
|
-
"type": "string"
|
|
720
|
-
},
|
|
721
|
-
"block": {
|
|
722
|
-
"description": "Whether to wait for completion",
|
|
723
|
-
"default": true,
|
|
724
|
-
"type": "boolean"
|
|
725
|
-
},
|
|
726
|
-
"timeout": {
|
|
727
|
-
"description": "Max wait time in ms",
|
|
728
|
-
"default": 30000,
|
|
729
|
-
"type": "number",
|
|
730
|
-
"minimum": 0,
|
|
731
|
-
"maximum": 600000
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
"required": [
|
|
735
|
-
"task_id",
|
|
736
|
-
"block",
|
|
737
|
-
"timeout"
|
|
738
|
-
],
|
|
739
|
-
"additionalProperties": false
|
|
740
|
-
},
|
|
741
|
-
"_mount": "both"
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
"name": "TaskStop",
|
|
745
|
-
"description": "\n- Stops a running background task by its ID\n- Takes a task_id parameter identifying the task to stop\n- To stop an agent-team teammate, pass its agent ID (\"name@team\") or bare teammate name as task_id\n- To stop a background agent spawned with a name, pass that name as task_id\n- Returns a success or failure status\n- Use this tool when you need to terminate a long-running task\n",
|
|
746
|
-
"input_schema": {
|
|
747
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
748
|
-
"type": "object",
|
|
749
|
-
"properties": {
|
|
750
|
-
"task_id": {
|
|
751
|
-
"description": "The ID of the background task to stop. Agent-team teammates and named background agents are also accepted by agent ID or name.",
|
|
752
|
-
"type": "string"
|
|
753
|
-
},
|
|
754
|
-
"shell_id": {
|
|
755
|
-
"description": "Deprecated: use task_id instead",
|
|
756
|
-
"type": "string"
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
"additionalProperties": false
|
|
760
|
-
},
|
|
761
|
-
"_mount": "both"
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
"name": "TaskUpdate",
|
|
765
|
-
"description": "Use this tool to update a task in the task list.\n\n## When to Use This Tool\n\n**Mark tasks as resolved:**\n- When you have completed the work described in a task\n- When a task is no longer needed or has been superseded\n- IMPORTANT: Always mark your assigned tasks as resolved when you finish them\n- After resolving, call TaskList to find your next task\n\n- ONLY mark a task as completed when you have FULLY accomplished it\n- If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n- When blocked, create a new task describing what needs to be resolved\n- Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn't find necessary files or dependencies\n\n**Delete tasks:**\n- When a task is no longer relevant or was created in error\n- Setting status to `deleted` permanently removes the task\n\n**Update task details:**\n- When requirements change or become clearer\n- When establishing dependencies between tasks\n\n## Fields You Can Update\n\n- **status**: The task status (see Status Workflow below)\n- **subject**: Change the task title (imperative form, e.g., \"Run tests\")\n- **description**: Change the task description\n- **activeForm**: Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")\n- **owner**: Change the task owner (agent name)\n- **metadata**: Merge metadata keys into the task (set a key to null to delete it)\n- **addBlocks**: Mark tasks that cannot start until this one completes\n- **addBlockedBy**: Mark tasks that must complete before this one can start\n\n## Status Workflow\n\nStatus progresses: `pending` → `in_progress` → `completed`\n\nUse `deleted` to permanently remove a task.\n\n## Staleness\n\nMake sure to read a task's latest state using `TaskGet` before updating it.\n\n## Examples\n\nMark task as in progress when starting work:\n```json\n{\"taskId\": \"1\", \"status\": \"in_progress\"}\n```\n\nMark task as completed after finishing work:\n```json\n{\"taskId\": \"1\", \"status\": \"completed\"}\n```\n\nDelete a task:\n```json\n{\"taskId\": \"1\", \"status\": \"deleted\"}\n```\n\nClaim a task by setting owner:\n```json\n{\"taskId\": \"1\", \"owner\": \"my-name\"}\n```\n\nSet up task dependencies:\n```json\n{\"taskId\": \"2\", \"addBlockedBy\": [\"1\"]}\n```\n",
|
|
766
|
-
"input_schema": {
|
|
767
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
768
|
-
"type": "object",
|
|
769
|
-
"properties": {
|
|
770
|
-
"taskId": {
|
|
771
|
-
"description": "The ID of the task to update",
|
|
772
|
-
"type": "string"
|
|
773
|
-
},
|
|
774
|
-
"subject": {
|
|
775
|
-
"description": "New subject for the task",
|
|
776
|
-
"type": "string"
|
|
777
|
-
},
|
|
778
|
-
"description": {
|
|
779
|
-
"description": "New description for the task",
|
|
780
|
-
"type": "string"
|
|
781
|
-
},
|
|
782
|
-
"activeForm": {
|
|
783
|
-
"description": "Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")",
|
|
784
|
-
"type": "string"
|
|
785
|
-
},
|
|
786
|
-
"status": {
|
|
787
|
-
"description": "New status for the task",
|
|
788
|
-
"anyOf": [
|
|
789
|
-
{
|
|
790
|
-
"type": "string",
|
|
791
|
-
"enum": [
|
|
792
|
-
"pending",
|
|
793
|
-
"in_progress",
|
|
794
|
-
"completed"
|
|
795
|
-
]
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
"type": "string",
|
|
799
|
-
"const": "deleted"
|
|
800
|
-
}
|
|
801
|
-
]
|
|
802
|
-
},
|
|
803
|
-
"addBlocks": {
|
|
804
|
-
"description": "Task IDs that this task blocks",
|
|
805
|
-
"type": "array",
|
|
806
|
-
"items": {
|
|
807
|
-
"type": "string"
|
|
808
|
-
}
|
|
809
|
-
},
|
|
810
|
-
"addBlockedBy": {
|
|
811
|
-
"description": "Task IDs that block this task",
|
|
812
|
-
"type": "array",
|
|
813
|
-
"items": {
|
|
814
|
-
"type": "string"
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
"owner": {
|
|
818
|
-
"description": "New owner for the task",
|
|
819
|
-
"type": "string"
|
|
820
|
-
},
|
|
821
|
-
"metadata": {
|
|
822
|
-
"description": "Metadata keys to merge into the task. Set a key to null to delete it.",
|
|
823
|
-
"type": "object",
|
|
824
|
-
"propertyNames": {
|
|
825
|
-
"type": "string"
|
|
826
|
-
},
|
|
827
|
-
"additionalProperties": {}
|
|
828
|
-
}
|
|
829
|
-
},
|
|
830
|
-
"required": [
|
|
831
|
-
"taskId"
|
|
832
|
-
],
|
|
833
|
-
"additionalProperties": false
|
|
834
|
-
},
|
|
835
|
-
"_mount": "both"
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
"name": "WebFetch",
|
|
839
|
-
"description": "Fetches a URL, converts the page to markdown, and answers `prompt` against it using a small fast model.\n\n- Fails on authenticated/private URLs — use an authenticated MCP tool or `gh` for those instead.\n- HTTP is upgraded to HTTPS. Cross-host redirects are returned to you rather than followed; call again with the redirect URL.\n- Responses are cached for 15 minutes per URL.",
|
|
840
|
-
"input_schema": {
|
|
841
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
842
|
-
"type": "object",
|
|
843
|
-
"properties": {
|
|
844
|
-
"url": {
|
|
845
|
-
"description": "The URL to fetch content from",
|
|
846
|
-
"type": "string",
|
|
847
|
-
"format": "uri"
|
|
848
|
-
},
|
|
849
|
-
"prompt": {
|
|
850
|
-
"description": "The prompt to run on the fetched content",
|
|
851
|
-
"type": "string"
|
|
852
|
-
}
|
|
853
|
-
},
|
|
854
|
-
"required": [
|
|
855
|
-
"url",
|
|
856
|
-
"prompt"
|
|
857
|
-
],
|
|
858
|
-
"additionalProperties": false
|
|
859
|
-
},
|
|
860
|
-
"_mount": "both"
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
"name": "WebSearch",
|
|
864
|
-
"description": "Search the web. Returns result blocks with titles and URLs. US-only.\n\n- The current month is July 2026 — use this when searching for recent information.\n- `allowed_domains` / `blocked_domains` filter results.\n- After answering from results, end with a \"Sources:\" list of the URLs you used as markdown links.",
|
|
865
|
-
"input_schema": {
|
|
866
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
867
|
-
"type": "object",
|
|
868
|
-
"properties": {
|
|
869
|
-
"query": {
|
|
870
|
-
"description": "The search query to use",
|
|
871
|
-
"type": "string",
|
|
872
|
-
"minLength": 2
|
|
873
|
-
},
|
|
874
|
-
"allowed_domains": {
|
|
875
|
-
"description": "Only include search results from these domains",
|
|
876
|
-
"type": "array",
|
|
877
|
-
"items": {
|
|
878
|
-
"type": "string"
|
|
879
|
-
}
|
|
880
|
-
},
|
|
881
|
-
"blocked_domains": {
|
|
882
|
-
"description": "Never include search results from these domains",
|
|
883
|
-
"type": "array",
|
|
884
|
-
"items": {
|
|
885
|
-
"type": "string"
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
"required": [
|
|
890
|
-
"query"
|
|
891
|
-
],
|
|
892
|
-
"additionalProperties": false
|
|
893
|
-
},
|
|
894
|
-
"_mount": "both"
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
"name": "Workflow",
|
|
898
|
-
"description": "Execute a workflow script that orchestrates multiple subagents deterministically. Workflows run in the background — this tool returns immediately with a task ID, and a <task-notification> arrives when the workflow completes. Use /workflows to watch live progress.\n\nA workflow structures work across many agents — to be comprehensive (decompose and cover in parallel), to be confident (independent perspectives and adversarial checks before committing), or to take on scale one context can't hold (migrations, audits, broad sweeps). The script is where you encode that structure: what fans out, what verifies, what synthesizes.\n\nONLY call this tool when the user has explicitly opted into multi-agent orchestration. Workflows can spawn dozens of agents and consume a large amount of tokens; the user must request that scale, not have it inferred. Explicit opt-in means one of:\n- The user included the keyword \"ultracode\" in their prompt (you'll see a system-reminder confirming it).\n- Ultracode is on for the session (a system-reminder confirms it) — see **Ultracode** below.\n- The user directly asked you to run a workflow or use multi-agent orchestration in their own words (\"use a workflow\", \"run a workflow\", \"fan out agents\", \"orchestrate this with subagents\"). The ask must be in the user's words — a task that would merely benefit from a workflow does not count.\n- The user invoked a skill or slash command whose instructions tell you to call Workflow.\n- The user asked you to run a specific named or saved workflow.\n\nFor any other task — even one that would clearly benefit from parallelism — do NOT call this tool. Use the Agent tool for individual subagents, or briefly describe what a multi-agent workflow could do and how much it would roughly cost, and ask the user whether to run it. Mention they can ask for one with \"use a workflow\" in a future message to skip the ask.\n\nWhen you do call it, the right move is often **hybrid**: scout inline first (list the files, find the channels, scope the diff) to discover the work-list, then call Workflow to pipeline over it. You don't need to know the shape before the *task* — only before the *orchestration step*.\n\nCommon single-phase workflows you can chain across turns:\n- **Understand** — parallel readers over relevant subsystems → structured map\n- **Design** — judge panel of N independent approaches → scored synthesis\n- **Review** — dimensions → find → adversarially verify (example below)\n- **Research** — multi-modal sweep → deep-read → synthesize\n- **Migrate** — discover sites → transform each (worktree isolation) → verify\n\nFor larger work, run several in sequence — read each result before deciding the next phase. You stay in the loop; each workflow is one well-scoped fan-out.\n\n**Ultracode.** When a system-reminder confirms ultracode is on, that opt-in is standing: author and run a workflow for every substantive task by default. The goal is the most exhaustive, correct answer you can produce — token cost is not a constraint. For multi-phase work (understand → design → implement → review), that often means several workflows in sequence — one per phase — so you stay in the loop between them. The quality patterns below (adversarial verify, multi-modal sweep, completeness critic, loop-until-dry) are the tools; pick what fits the task. Lean toward orchestrating with workflows and adversarially verifying your findings — unless the work is trivial or already verified. Solo only on conversational turns or trivial mechanical edits. When a reminder says ultracode is off, revert to the opt-in rule above.\n\nPass the script inline via `script` — do not Write it to a file first. Every invocation automatically persists its script to a file under the session directory and returns the path in the tool result. To iterate on a workflow, edit that file with Write/Edit and re-invoke Workflow with `{scriptPath: \"<path>\"}` instead of resending the full script.\n\nEvery script must begin with `export const meta = {...}`:\n export const meta = {\n name: 'find-flaky-tests',\n description: 'Find flaky tests and propose fixes', // one-line, shown in permission dialog\n phases: [ // one entry per phase() call\n { title: 'Scan', detail: 'grep test logs for retries' },\n { title: 'Fix', detail: 'one agent per flaky test' },\n ],\n }\n // script body starts here — use agent()/parallel()/pipeline()/phase()/log()\n phase('Scan')\n const flaky = await agent('grep CI logs for retry markers', {schema: FLAKY_SCHEMA})\n ...\n\nThe `meta` object must be a PURE LITERAL — no variables, function calls, spreads, or template interpolation. Required fields: `name`, `description`. Optional: `whenToUse` (shown in the workflow list), `phases`. Use the SAME phase titles in meta.phases as in phase() calls — titles are matched exactly; a phase() call with no matching meta entry just gets its own progress group. Add `model` to a phase entry when that phase uses a specific model override.\n\nScript body hooks:\n- agent(prompt: string, opts?: {label?: string, phase?: string, schema?: object, model?: string, effort?: string, isolation?: 'worktree', agentType?: string}): Promise<any> — spawn a subagent. Without schema, returns its final text as a string. With schema (a JSON Schema), the subagent is forced to call a StructuredOutput tool and agent() returns the validated object — no parsing needed. Returns null if the user skips the agent mid-run or the subagent dies on a terminal API error after retries (filter with .filter(Boolean)). opts.label overrides the display label. opts.phase explicitly assigns this agent to a progress group (use this inside pipeline()/parallel() stages to avoid races on the global phase() state — same phase string → same group box). opts.model overrides the model for this agent call. Default to omitting it — the agent inherits the main-loop model (the resolved session model), which is almost always correct. Only set it when you're highly confident a different tier fits the task; when unsure, omit. opts.effort overrides the reasoning effort for this agent call ('low' | 'medium' | 'high' | 'xhigh' | 'max') — omit to inherit the session effort; use 'low' for cheap mechanical stages and higher tiers only for the hardest verify/judge stages. opts.isolation: 'worktree' runs the agent in a fresh git worktree — EXPENSIVE (~200-500ms setup + disk per agent), use ONLY when agents mutate files in parallel and would otherwise conflict; the worktree is auto-removed if unchanged. opts.agentType uses a custom subagent type (e.g. 'general-purpose', 'code-reviewer') instead of the default workflow subagent — resolved from the same registry as the Agent tool; composes with schema (the custom agent's system prompt gets a StructuredOutput instruction appended).\n- pipeline(items, stage1, stage2, ...): Promise<any[]> — run each item through all stages independently, NO barrier between stages. Item A can be in stage 3 while item B is still in stage 1. This is the DEFAULT for multi-stage work. Wall-clock = slowest single-item chain, not sum-of-slowest-per-stage. Every stage callback receives (prevResult, originalItem, index) — use originalItem/index in later stages to label work without threading context through stage 1's return value. A stage that throws drops that item to `null` and skips its remaining stages.\n- parallel(thunks: Array<() => Promise<any>>): Promise<any[]> — run tasks concurrently. This is a BARRIER: awaits all thunks before returning. A thunk that throws (or whose agent errors) resolves to `null` in the result array — the call itself never rejects, so `.filter(Boolean)` before using the results. Use ONLY when you genuinely need all results together.\n- log(message: string): void — emit a progress message to the user (shown as a narrator line above the progress tree)\n- phase(title: string): void — start a new phase; subsequent agent() calls are grouped under this title in the progress display\n- args: any — the value passed as Workflow's `args` input, verbatim (undefined if not provided). Pass arrays/objects as actual JSON values in the tool call, NOT as a JSON-encoded string — `args: [\"a.ts\", \"b.ts\"]`, not `args: \"[\\\"a.ts\\\", ...]\"` (a stringified list reaches the script as one string, so `args.filter`/`args.map` throw). Use this to parameterize named workflows — e.g. pass a research question, target path, or config object directly instead of via a side-channel file.\n- budget: {total: number|null, spent(): number, remaining(): number} — the turn's token target from the user's \"+500k\"-style directive. `budget.total` is null if no target was set. `budget.spent()` returns output tokens spent this turn across the main loop and all workflows — the pool is shared, not per-workflow. `budget.remaining()` returns `max(0, total - spent())`, or `Infinity` if no target. The target is a HARD ceiling, not advisory: once `spent()` reaches `total`, further `agent()` calls throw. Use for dynamic loops: `while (budget.total && budget.remaining() > 50_000) { ... }`, or static scaling: `const FLEET = budget.total ? Math.floor(budget.total / 100_000) : 5`.\n- workflow(nameOrRef: string | {scriptPath: string}, args?: any): Promise<any> — run another workflow inline as a sub-step and return whatever it returns. Pass a name to invoke a saved workflow (same registry as {name: \"...\"}), or {scriptPath} to run a script file you Wrote earlier. The child shares this run's concurrency cap, agent counter, abort signal, and token budget — its agents appear under a \"▸ name\" group in /workflows and its tokens count toward budget.spent(). The args param becomes the child's `args` global. Nesting is one level only: workflow() inside a child throws. Throws on unknown name / unreadable scriptPath / child syntax error; catch to handle gracefully.\n\nSubagents are told their final text IS the return value (not a human-facing message), so they return raw data. For structured output, use the schema option — validation happens at the tool-call layer so the model retries on mismatch.\n\nWorkflow agents can reach all session-connected MCP tools via ToolSearch — schemas load on demand per agent. Caveat: interactively-authenticated MCP servers (e.g. claude.ai) may be absent in headless/cron runs.\n\nScripts are plain JavaScript, NOT TypeScript — type annotations (`: string[]`), interfaces, and generics fail to parse. The script body runs in an async context — use await directly. Standard JS built-ins (JSON, Math, Array, etc.) are available — EXCEPT `Date.now()`/`Math.random()`/argless `new Date()`, which throw (they would break resume); pass timestamps in via `args`, stamp results after the workflow returns, and for randomness vary the agent prompt/label by index. No filesystem or Node.js API access.\n\nDEFAULT TO pipeline(). Only reach for a barrier (parallel between stages) when you genuinely need ALL prior-stage results together.\n\nA barrier is correct ONLY when stage N needs cross-item context from all of stage N-1:\n- Dedup/merge across the full result set before expensive downstream work\n- Early-exit if the total count is zero (\"0 bugs found → skip verification entirely\")\n- Stage N's prompt references \"the other findings\" for comparison\n\nA barrier is NOT justified by:\n- \"I need to flatten/map/filter first\" — do it inside a pipeline stage: pipeline(items, stageA, r => transform([r]).flat(), stageB)\n- \"The stages are conceptually separate\" — that's what pipeline() models. Separate stages ≠ synchronized stages.\n- \"It's cleaner code\" — barrier latency is real. If 5 finders run and the slowest takes 3× the fastest, a barrier wastes 2/3 of the fast finders' idle time.\n\nSmell test: if you wrote\n const a = await parallel(...)\n const b = transform(a) // flatten, map, filter — no cross-item dependency\n const c = await parallel(b.map(...))\nthat middle transform doesn't need the barrier. Rewrite as a pipeline with the transform inside a stage. When in doubt: pipeline.\n\nConcurrent agent() calls are capped at min(16, cpu cores - 2) per workflow — excess calls queue and run as slots free up. You can still pass 100 items to parallel()/pipeline() and they all complete; only ~10 run at any moment. Total agent count across a workflow's lifetime is capped at 1000 — a runaway-loop backstop set far above any real workflow. A single parallel()/pipeline() call accepts at most 4096 items; passing more is an explicit error, not a silent truncation.\n\nThe canonical multi-stage pattern — pipeline by default, each dimension verifies as soon as its review completes:\n export const meta = {\n name: 'review-changes',\n description: 'Review changed files across dimensions, verify each finding',\n phases: [{ title: 'Review' }, { title: 'Verify' }],\n }\n const DIMENSIONS = [{key: 'bugs', prompt: '...'}, {key: 'perf', prompt: '...'}]\n const results = await pipeline(\n DIMENSIONS,\n d => agent(d.prompt, {label: `review:${d.key}`, phase: 'Review', schema: FINDINGS_SCHEMA}),\n review => parallel(review.findings.map(f => () =>\n agent(`Adversarially verify: ${f.title}`, {label: `verify:${f.file}`, phase: 'Verify', schema: VERDICT_SCHEMA})\n .then(v => ({...f, verdict: v}))\n ))\n )\n const confirmed = results.flat().filter(Boolean).filter(f => f.verdict?.isReal)\n return { confirmed }\n // Dimension 'bugs' findings verify while dimension 'perf' is still reviewing. No wasted wall-clock.\n\nWhen a barrier IS correct — dedup across all findings before expensive verification:\n const all = await parallel(DIMENSIONS.map(d => () => agent(d.prompt, {schema: FINDINGS_SCHEMA})))\n const deduped = dedupeByFileAndLine(all.filter(Boolean).flatMap(r => r.findings)) // <-- genuinely needs ALL at once\n const verified = await parallel(deduped.map(f => () => agent(verifyPrompt(f), {schema: VERDICT_SCHEMA})))\n\nLoop-until-count pattern — accumulate to a target:\n const bugs = []\n while (bugs.length < 10) {\n const result = await agent(\"Find bugs in this codebase.\", {schema: BUGS_SCHEMA})\n bugs.push(...result.bugs)\n log(`${bugs.length}/10 found`)\n }\n\nLoop-until-budget pattern — scale depth to the user's \"+500k\" directive. Guard on budget.total: with no target set, remaining() is Infinity and the loop would run straight to the 1000-agent cap.\n const bugs = []\n while (budget.total && budget.remaining() > 50_000) {\n const result = await agent(\"Find bugs in this codebase.\", {schema: BUGS_SCHEMA})\n bugs.push(...result.bugs)\n log(`${bugs.length} found, ${Math.round(budget.remaining()/1000)}k remaining`)\n }\n\nComposing patterns — exhaustive review (find → dedup vs seen → diverse-lens panel → loop-until-dry):\n const seen = new Set(), confirmed = []\n let dry = 0\n while (dry < 2) { // loop-until-dry\n const found = (await parallel(FINDERS.map(f => () => // barrier: collect all finders this round\n agent(f.prompt, {phase: 'Find', schema: BUGS})))).filter(Boolean).flatMap(r => r.bugs)\n const fresh = found.filter(b => !seen.has(key(b))) // dedup vs ALL seen — plain code, not an agent\n if (!fresh.length) { dry++; continue }\n dry = 0; fresh.forEach(b => seen.add(key(b)))\n const judged = await parallel(fresh.map(b => () => // every fresh bug judged concurrently...\n parallel(['correctness','security','repro'].map(lens => () => // ...each by 3 distinct lenses\n agent(`Judge \"${b.desc}\" via the ${lens} lens — real?`, {phase: 'Verify', schema: VERDICT})))\n .then(vs => ({ b, real: vs.filter(Boolean).filter(v => v.real).length >= 2 }))))\n confirmed.push(...judged.filter(v => v.real).map(v => v.b))\n }\n return confirmed\n // dedup vs `seen`, NOT `confirmed` — else judge-rejected findings reappear every round and it never converges.\n\nQuality patterns — common shapes; pick by task and compose freely:\n- Adversarial verify: spawn N independent skeptics per finding, each prompted to REFUTE. Kill if ≥majority refute. Prevents plausible-but-wrong findings from surviving.\n const votes = await parallel(Array.from({length: 3}, () => () =>\n agent(`Try to refute: ${claim}. Default to refuted=true if uncertain.`, {schema: VERDICT})))\n const survives = votes.filter(Boolean).filter(v => !v.refuted).length >= 2\n- Perspective-diverse verify: when a finding can fail in more than one way, give each verifier a distinct lens (correctness, security, perf, does-it-reproduce) instead of N identical refuters — diversity catches failure modes redundancy can't.\n- Judge panel: generate N independent attempts from different angles (e.g. MVP-first, risk-first, user-first), score with parallel judges, synthesize from the winner while grafting the best ideas from runners-up. Beats one-attempt-iterated when the solution space is wide.\n- Loop-until-dry: for unknown-size discovery (bugs, issues, edge cases), keep spawning finders until K consecutive rounds return nothing new. Simple counters (while count < N) miss the tail.\n- Multi-modal sweep: parallel agents each searching a different way (by-container, by-content, by-entity, by-time). Each is blind to what the others surface; useful when one search angle won't find everything.\n- Completeness critic: a final agent that asks \"what's missing — modality not run, claim unverified, source unread?\" What it finds becomes the next round of work.\n- No silent caps: if a workflow bounds coverage (top-N, no-retry, sampling), `log()` what was dropped — silent truncation reads as \"covered everything\" when it didn't.\n\nScale to what the user asked for. \"find any bugs\" → a few finders, single-vote verify. \"thoroughly audit this\" or \"be comprehensive\" → larger finder pool, 3–5 vote adversarial pass, synthesis stage. When unsure, lean toward thoroughness for research/review/audit requests and toward brevity for quick checks.\n\nThese patterns aren't exhaustive — compose novel harnesses when the task calls for it (tournament brackets, self-repair loops, staged escalation, whatever fits).\n\nUse this tool for multi-step orchestration where control flow should be deterministic (loops, conditionals, fan-out) rather than model-driven.\n\n## Resume\n\nThe tool result includes a runId. To resume after a pause, kill, or script edit, relaunch with Workflow({scriptPath, resumeFromRunId}) — the longest unchanged prefix of agent() calls returns cached results instantly; the first edited/new call and everything after it runs live. Same script + same args → 100% cache hit. Before diagnosing why a completed workflow returned an empty or unexpected result, Read <transcriptDir>/journal.jsonl — it records each agent's actual return value; do not assume cached results are non-empty. Date.now()/Math.random()/new Date() are unavailable in scripts (they would break this) — stamp results after the workflow returns, or pass timestamps via args. Fallback when no journal is available: Read agent-<id>.jsonl files in the transcript directory and hand-author a continuation script.",
|
|
899
|
-
"input_schema": {
|
|
900
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
901
|
-
"type": "object",
|
|
902
|
-
"properties": {
|
|
903
|
-
"script": {
|
|
904
|
-
"description": "Self-contained workflow script. Must begin with `export const meta = { name, description, phases }` (pure literal, no computed values) followed by the script body using agent()/parallel()/pipeline()/phase().",
|
|
905
|
-
"type": "string",
|
|
906
|
-
"maxLength": 524288
|
|
907
|
-
},
|
|
908
|
-
"name": {
|
|
909
|
-
"description": "Name of a predefined workflow (built-in or from .claude/workflows/). Resolves to a self-contained script.",
|
|
910
|
-
"type": "string"
|
|
911
|
-
},
|
|
912
|
-
"description": {
|
|
913
|
-
"description": "Ignored — set the workflow description in the script's `meta` block.",
|
|
914
|
-
"type": "string"
|
|
915
|
-
},
|
|
916
|
-
"title": {
|
|
917
|
-
"description": "Ignored — set the workflow title in the script's `meta` block.",
|
|
918
|
-
"type": "string"
|
|
919
|
-
},
|
|
920
|
-
"args": {
|
|
921
|
-
"description": "Optional input value exposed to the script as the global `args`, verbatim. Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list breaks `args.filter`/`args.map` in the script. Use for parameterized named workflows (e.g. a research question)."
|
|
922
|
-
},
|
|
923
|
-
"scriptPath": {
|
|
924
|
-
"description": "Path to a workflow script file on disk. Every Workflow invocation persists its script under the session directory and returns the path in the tool result. To iterate, edit that file with Write/Edit and re-invoke Workflow with the same `scriptPath` instead of re-sending the full script. Takes precedence over `script` and `name`.",
|
|
925
|
-
"type": "string"
|
|
926
|
-
},
|
|
927
|
-
"resumeFromRunId": {
|
|
928
|
-
"description": "Run ID of a prior Workflow invocation to resume from. Completed agent() calls with unchanged (prompt, opts) return their cached results instantly; only edited or new calls re-run. Same-session only. Stop the prior run first (TaskStop) before resuming.",
|
|
929
|
-
"type": "string",
|
|
930
|
-
"pattern": "^wf_[a-z0-9-]{6,}$"
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
"additionalProperties": false
|
|
934
|
-
},
|
|
935
|
-
"_mount": "both"
|
|
936
|
-
},
|
|
937
|
-
{
|
|
938
|
-
"name": "Write",
|
|
939
|
-
"description": "Writes a file to the local filesystem, overwriting if one exists.\n\nWhen to use: creating a new file, or fully replacing one you've already Read. Overwriting an existing file you haven't Read will fail. For partial changes, use Edit instead.",
|
|
940
|
-
"input_schema": {
|
|
941
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
942
|
-
"type": "object",
|
|
943
|
-
"properties": {
|
|
944
|
-
"file_path": {
|
|
945
|
-
"description": "The absolute path to the file to write (must be absolute, not relative)",
|
|
946
|
-
"type": "string"
|
|
947
|
-
},
|
|
948
|
-
"content": {
|
|
949
|
-
"description": "The content to write to the file",
|
|
950
|
-
"type": "string"
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
"required": [
|
|
954
|
-
"file_path",
|
|
955
|
-
"content"
|
|
956
|
-
],
|
|
957
|
-
"additionalProperties": false
|
|
958
|
-
},
|
|
959
|
-
"_mount": "both"
|
|
960
|
-
}
|
|
961
|
-
]
|
|
962
|
-
}
|