@askalf/dario 4.8.26 β 4.8.28
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/dist/cc-template-data.json +12 -115
- package/dist/live-fingerprint.d.ts +1 -1
- package/dist/live-fingerprint.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_version": "2.1.
|
|
3
|
-
"_captured": "2026-
|
|
2
|
+
"_version": "2.1.162",
|
|
3
|
+
"_captured": "2026-06-04T12:25:00.361Z",
|
|
4
4
|
"_source": "bundled",
|
|
5
5
|
"_schemaVersion": 3,
|
|
6
6
|
"agent_identity": "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"name": "Bash",
|
|
173
|
-
"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 `
|
|
173
|
+
"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. Foreground `sleep` is blocked; use Monitor with an until-loop to wait on a condition.\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 Opus 4.8 (1M context) <noreply@anthropic.com>\n- End PR bodies with:\nπ€ Generated with [Claude Code](https://claude.com/claude-code)",
|
|
174
174
|
"input_schema": {
|
|
175
175
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
176
176
|
"type": "object",
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
},
|
|
297
297
|
{
|
|
298
298
|
"name": "EnterPlanMode",
|
|
299
|
-
"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 with explore agent instead)\n\n## What Happens in Plan Mode\n\nIn plan mode, you'll:\n1. Thoroughly explore the codebase using Glob, 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",
|
|
299
|
+
"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 with explore agent 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",
|
|
300
300
|
"input_schema": {
|
|
301
301
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
302
302
|
"type": "object",
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
"name": "EnterWorktree",
|
|
309
|
-
"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\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\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",
|
|
309
|
+
"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",
|
|
310
310
|
"input_schema": {
|
|
311
311
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
312
312
|
"type": "object",
|
|
@@ -385,110 +385,9 @@
|
|
|
385
385
|
"additionalProperties": false
|
|
386
386
|
}
|
|
387
387
|
},
|
|
388
|
-
{
|
|
389
|
-
"name": "Glob",
|
|
390
|
-
"description": "Fast file pattern matching. Supports glob patterns like \"**/*.js\" or \"src/**/*.ts\". Returns matching file paths sorted by modification time.",
|
|
391
|
-
"input_schema": {
|
|
392
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
393
|
-
"type": "object",
|
|
394
|
-
"properties": {
|
|
395
|
-
"pattern": {
|
|
396
|
-
"description": "The glob pattern to match files against",
|
|
397
|
-
"type": "string"
|
|
398
|
-
},
|
|
399
|
-
"path": {
|
|
400
|
-
"description": "The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter \"undefined\" or \"null\" - simply omit it for the default behavior. Must be a valid directory path if provided.",
|
|
401
|
-
"type": "string"
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
"required": [
|
|
405
|
-
"pattern"
|
|
406
|
-
],
|
|
407
|
-
"additionalProperties": false
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
"name": "Grep",
|
|
412
|
-
"description": "Content search built on ripgrep. Prefer this over `grep`/`rg` via Bash β results integrate with the permission UI and file links.\n\n- Full regex syntax (e.g. \"log.*Error\", \"function\\s+\\w+\"). Ripgrep, not grep β escape literal braces (`interface\\{\\}`).\n- Filter with `glob` (e.g. \"**/*.tsx\") or `type` (e.g. \"js\", \"py\", \"rust\").\n- `output_mode`: \"content\" (matching lines), \"files_with_matches\" (paths only, default), or \"count\".\n- `multiline: true` for patterns that span lines.",
|
|
413
|
-
"input_schema": {
|
|
414
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
415
|
-
"type": "object",
|
|
416
|
-
"properties": {
|
|
417
|
-
"pattern": {
|
|
418
|
-
"description": "The regular expression pattern to search for in file contents",
|
|
419
|
-
"type": "string"
|
|
420
|
-
},
|
|
421
|
-
"path": {
|
|
422
|
-
"description": "File or directory to search in (rg PATH). Defaults to current working directory.",
|
|
423
|
-
"type": "string"
|
|
424
|
-
},
|
|
425
|
-
"glob": {
|
|
426
|
-
"description": "Glob pattern to filter files (e.g. \"*.js\", \"*.{ts,tsx}\") - maps to rg --glob",
|
|
427
|
-
"type": "string"
|
|
428
|
-
},
|
|
429
|
-
"output_mode": {
|
|
430
|
-
"description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"files_with_matches\".",
|
|
431
|
-
"type": "string",
|
|
432
|
-
"enum": [
|
|
433
|
-
"content",
|
|
434
|
-
"files_with_matches",
|
|
435
|
-
"count"
|
|
436
|
-
]
|
|
437
|
-
},
|
|
438
|
-
"-B": {
|
|
439
|
-
"description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise.",
|
|
440
|
-
"type": "number"
|
|
441
|
-
},
|
|
442
|
-
"-A": {
|
|
443
|
-
"description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise.",
|
|
444
|
-
"type": "number"
|
|
445
|
-
},
|
|
446
|
-
"-C": {
|
|
447
|
-
"description": "Alias for context.",
|
|
448
|
-
"type": "number"
|
|
449
|
-
},
|
|
450
|
-
"context": {
|
|
451
|
-
"description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise.",
|
|
452
|
-
"type": "number"
|
|
453
|
-
},
|
|
454
|
-
"-n": {
|
|
455
|
-
"description": "Show line numbers in output (rg -n). Requires output_mode: \"content\", ignored otherwise. Defaults to true.",
|
|
456
|
-
"type": "boolean"
|
|
457
|
-
},
|
|
458
|
-
"-i": {
|
|
459
|
-
"description": "Case insensitive search (rg -i)",
|
|
460
|
-
"type": "boolean"
|
|
461
|
-
},
|
|
462
|
-
"-o": {
|
|
463
|
-
"description": "Print only the matched (non-empty) parts of each matching line, one match per output line (rg -o / --only-matching). Requires output_mode: \"content\", ignored otherwise. Defaults to false.",
|
|
464
|
-
"type": "boolean"
|
|
465
|
-
},
|
|
466
|
-
"type": {
|
|
467
|
-
"description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than include for standard file types.",
|
|
468
|
-
"type": "string"
|
|
469
|
-
},
|
|
470
|
-
"head_limit": {
|
|
471
|
-
"description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). Defaults to 250 when unspecified. Pass 0 for unlimited (use sparingly β large result sets waste context).",
|
|
472
|
-
"type": "number"
|
|
473
|
-
},
|
|
474
|
-
"offset": {
|
|
475
|
-
"description": "Skip first N lines/entries before applying head_limit, equivalent to \"| tail -n +N | head -N\". Works across all output modes. Defaults to 0.",
|
|
476
|
-
"type": "number"
|
|
477
|
-
},
|
|
478
|
-
"multiline": {
|
|
479
|
-
"description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false.",
|
|
480
|
-
"type": "boolean"
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
"required": [
|
|
484
|
-
"pattern"
|
|
485
|
-
],
|
|
486
|
-
"additionalProperties": false
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
388
|
{
|
|
490
389
|
"name": "Monitor",
|
|
491
|
-
"description": "Start a background monitor that streams events from a long-running script. Each stdout line is an event β you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you're waiting for the user to answer a question.\n\nPick by how many notifications you need:\n- **One** (\"tell me when the server is ready / the build finishes\") β use **Bash with `run_in_background`** and a command that exits when the condition is true, e.g. `until grep -q \"Ready in\" dev.log; do sleep 0.5; done`. You get a single completion notification when it exits.\n- **One per occurrence, indefinitely** (\"tell me every time an ERROR line appears\") β Monitor with an unbounded command (`tail -f`, `inotifywait -m`, `while true`).\n- **One per occurrence, until a known end** (\"emit each CI step result, stop when the run completes\") β Monitor with a command that emits lines and then exits.\n\nYour script's stdout is the event stream. Each line becomes a notification. Exit ends the watch.\n\n # Each matching log line is an event\n tail -f /var/log/app.log | grep --line-buffered \"ERROR\"\n\n # Each file change is an event\n inotifywait -m --format '%e %f' /watched/dir\n\n # Poll GitHub for new PR comments and emit one line per new comment\n last=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n while true; do\n now=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n gh api \"repos/owner/repo/issues/123/comments?since=$last\" --jq '.[] | \"\\(.user.login): \\(.body)\"'\n last=$now; sleep 30\n done\n\n # Node script that emits events as they arrive (e.g. WebSocket listener)\n node watch-for-events.js\n\n # Per-occurrence with a natural end: emit each CI check as it lands, exit when the run completes\n prev=\"\"\n while true; do\n s=$(gh pr checks 123 --json name,bucket)\n cur=$(jq -r '.[] | select(.bucket!=\"pending\") | \"\\(.name): \\(.bucket)\"' <<<\"$s\" | sort)\n comm -13 <(echo \"$prev\") <(echo \"$cur\")\n prev=$cur\n jq -e 'all(.bucket!=\"pending\")' <<<\"$s\" >/dev/null && break\n sleep 30\n done\n\n**Don't use an unbounded command for a single notification.** `tail -f`, `inotifywait -m`, and `while true` never exit on their own, so the monitor stays armed until timeout even after the event has fired. For \"tell me when X is ready,\" use Bash `run_in_background` with an `until` loop instead (one notification, ends in seconds). Note that `tail -f log | grep -m 1 ...` does *not* fix this: if the log goes quiet after the match, `tail` never receives SIGPIPE and the pipeline hangs anyway.\n\n**Script quality:**\n-
|
|
390
|
+
"description": "Start a background monitor that streams events from a long-running script. Each stdout line is an event β you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you're waiting for the user to answer a question.\n\nPick by how many notifications you need:\n- **One** (\"tell me when the server is ready / the build finishes\") β use **Bash with `run_in_background`** and a command that exits when the condition is true, e.g. `until grep -q \"Ready in\" dev.log; do sleep 0.5; done`. You get a single completion notification when it exits.\n- **One per occurrence, indefinitely** (\"tell me every time an ERROR line appears\") β Monitor with an unbounded command (`tail -f`, `inotifywait -m`, `while true`).\n- **One per occurrence, until a known end** (\"emit each CI step result, stop when the run completes\") β Monitor with a command that emits lines and then exits.\n\nYour script's stdout is the event stream. Each line becomes a notification. Exit ends the watch.\n\n # Each matching log line is an event\n tail -f /var/log/app.log | grep --line-buffered \"ERROR\"\n\n # Each file change is an event\n inotifywait -m --format '%e %f' /watched/dir\n\n # Poll GitHub for new PR comments and emit one line per new comment\n last=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n while true; do\n now=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n gh api \"repos/owner/repo/issues/123/comments?since=$last\" --jq '.[] | \"\\(.user.login): \\(.body)\"'\n last=$now; sleep 30\n done\n\n # Node script that emits events as they arrive (e.g. WebSocket listener)\n node watch-for-events.js\n\n # Per-occurrence with a natural end: emit each CI check as it lands, exit when the run completes\n prev=\"\"\n while true; do\n s=$(gh pr checks 123 --json name,bucket)\n cur=$(jq -r '.[] | select(.bucket!=\"pending\") | \"\\(.name): \\(.bucket)\"' <<<\"$s\" | sort)\n comm -13 <(echo \"$prev\") <(echo \"$cur\")\n prev=$cur\n jq -e 'all(.bucket!=\"pending\")' <<<\"$s\" >/dev/null && break\n sleep 30\n done\n\n**Don't use an unbounded command for a single notification.** `tail -f`, `inotifywait -m`, and `while true` never exit on their own, so the monitor stays armed until timeout even after the event has fired. For \"tell me when X is ready,\" use Bash `run_in_background` with an `until` loop instead (one notification, ends in seconds). Note that `tail -f log | grep -m 1 ...` does *not* fix this: if the log goes quiet after the match, `tail` never receives SIGPIPE and the pipeline hangs anyway.\n\n**Script quality:**\n- Every pipe stage must flush per line or matches sit in its buffer unseen: `grep` needs `--line-buffered`, `awk` needs `fflush()`. `head` cannot flush at all β `| head -N` delivers nothing until N matches accumulate, then ends the stream.\n- In poll loops, handle transient failures (`curl ... || true`) β one failed request shouldn't kill the monitor.\n- Poll intervals: 30s+ for remote APIs (rate limits), 0.5-1s for local checks.\n- Write a specific `description` β it appears in every notification (\"errors in deploy.log\" not \"watching logs\").\n- Only stdout is the event stream. Stderr goes to the output file (readable via Read) but does not trigger notifications β for a command you run directly (e.g. `python train.py 2>&1 | grep --line-buffered ...`), merge stderr with `2>&1` so its failures reach your filter. (No effect on `tail -f` of an existing log β that file only contains what its writer redirected.)\n\n**Coverage β silence is not success.** When watching a job or process for an outcome, your filter must match every terminal state, not just the happy path. A monitor that greps only for the success marker stays silent through a crashloop, a hung process, or an unexpected exit β and silence looks identical to \"still running.\" Before arming, ask: *if this process crashed right now, would my filter emit anything?* If not, widen it.\n\n # Wrong β silent on crash, hang, or any non-success exit\n tail -f run.log | grep --line-buffered \"elapsed_steps=\"\n\n # Right β one alternation covering progress + the failure signatures you'd act on\n tail -f run.log | grep -E --line-buffered \"elapsed_steps=|Traceback|Error|FAILED|assert|Killed|OOM\"\n\nFor poll loops checking job state, emit on every terminal status (`succeeded|failed|cancelled|timeout`), not just success. If you cannot confidently enumerate the failure signatures, broaden the grep alternation rather than narrow it β some extra noise is better than missing a crashloop.\n\n**Output volume**: Every stdout line is a conversation message, so the filter should be selective β but selective means \"the lines you'd act on,\" not \"only good news.\" Never pipe raw logs; filter to exactly the success and failure signals you care about. Monitors that produce too many events are automatically stopped; restart with a tighter filter if this happens.\n\nStdout lines within 200ms are batched into a single notification, so multiline output from a single event groups naturally.\n\nThe script runs in the same shell environment as Bash. Exit ends the watch (exit code is reported). Timeout β killed. Set `persistent: true` for session-length watches (PR monitoring, log tails) β the monitor runs until you call TaskStop or the session ends. Use TaskStop to cancel early.",
|
|
492
391
|
"input_schema": {
|
|
493
392
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
494
393
|
"type": "object",
|
|
@@ -524,7 +423,7 @@
|
|
|
524
423
|
},
|
|
525
424
|
{
|
|
526
425
|
"name": "NotebookEdit",
|
|
527
|
-
"description": "
|
|
426
|
+
"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.",
|
|
528
427
|
"input_schema": {
|
|
529
428
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
530
429
|
"type": "object",
|
|
@@ -773,7 +672,7 @@
|
|
|
773
672
|
},
|
|
774
673
|
{
|
|
775
674
|
"name": "TaskOutput",
|
|
776
|
-
"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
|
|
675
|
+
"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",
|
|
777
676
|
"input_schema": {
|
|
778
677
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
779
678
|
"type": "object",
|
|
@@ -921,7 +820,7 @@
|
|
|
921
820
|
},
|
|
922
821
|
{
|
|
923
822
|
"name": "WebSearch",
|
|
924
|
-
"description": "Search the web. Returns result blocks with titles and URLs. US-only.\n\n- The current month is
|
|
823
|
+
"description": "Search the web. Returns result blocks with titles and URLs. US-only.\n\n- The current month is June 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.",
|
|
925
824
|
"input_schema": {
|
|
926
825
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
927
826
|
"type": "object",
|
|
@@ -954,7 +853,7 @@
|
|
|
954
853
|
},
|
|
955
854
|
{
|
|
956
855
|
"name": "Workflow",
|
|
957
|
-
"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 \"workflow\" or \"workflows\" keyword (you'll see a system-reminder confirming it).\n- Ultracode is on (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 (\"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 include \"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, 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 (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.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. 'Explore', '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.\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. 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.",
|
|
856
|
+
"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, 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 (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.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. 'Explore', '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.\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. 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.",
|
|
958
857
|
"input_schema": {
|
|
959
858
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
960
859
|
"type": "object",
|
|
@@ -1028,8 +927,6 @@
|
|
|
1028
927
|
"EnterWorktree",
|
|
1029
928
|
"ExitPlanMode",
|
|
1030
929
|
"ExitWorktree",
|
|
1031
|
-
"Glob",
|
|
1032
|
-
"Grep",
|
|
1033
930
|
"Monitor",
|
|
1034
931
|
"NotebookEdit",
|
|
1035
932
|
"PushNotification",
|
|
@@ -1073,7 +970,7 @@
|
|
|
1073
970
|
"anthropic_beta": "claude-code-20250219,context-1m-2025-08-07,interleaved-thinking-2025-05-14,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,advisor-tool-2026-03-01,effort-2025-11-24",
|
|
1074
971
|
"header_values": {
|
|
1075
972
|
"accept": "application/json",
|
|
1076
|
-
"user-agent": "claude-cli/2.1.
|
|
973
|
+
"user-agent": "claude-cli/2.1.162 (external, sdk-cli)",
|
|
1077
974
|
"x-stainless-arch": "x64",
|
|
1078
975
|
"x-stainless-lang": "js",
|
|
1079
976
|
"x-stainless-os": "Linux",
|
|
@@ -1098,5 +995,5 @@
|
|
|
1098
995
|
"output_config",
|
|
1099
996
|
"stream"
|
|
1100
997
|
],
|
|
1101
|
-
"_supportedMaxTested": "2.1.
|
|
998
|
+
"_supportedMaxTested": "2.1.162"
|
|
1102
999
|
}
|
|
@@ -282,7 +282,7 @@ export declare function _resetInstalledVersionProbeForTest(): void;
|
|
|
282
282
|
*/
|
|
283
283
|
export declare const SUPPORTED_CC_RANGE: {
|
|
284
284
|
readonly min: "1.0.0";
|
|
285
|
-
readonly maxTested: "2.1.
|
|
285
|
+
readonly maxTested: "2.1.162";
|
|
286
286
|
};
|
|
287
287
|
/**
|
|
288
288
|
* Compare two dotted-numeric version strings. Returns negative if `a<b`,
|
package/dist/live-fingerprint.js
CHANGED
|
@@ -786,7 +786,7 @@ export function _resetInstalledVersionProbeForTest() {
|
|
|
786
786
|
*/
|
|
787
787
|
export const SUPPORTED_CC_RANGE = {
|
|
788
788
|
min: '1.0.0',
|
|
789
|
-
maxTested: '2.1.
|
|
789
|
+
maxTested: '2.1.162',
|
|
790
790
|
};
|
|
791
791
|
/**
|
|
792
792
|
* Compare two dotted-numeric version strings. Returns negative if `a<b`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.28",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool β Cursor, Cline, Aider, the Agent SDK, your scripts β at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|