feat(agents): ship CLI-parity built-in subagents to embedded SDK#203
Draft
aletc1 wants to merge 34 commits into21st-dev:mainfrom
Draft
feat(agents): ship CLI-parity built-in subagents to embedded SDK#203aletc1 wants to merge 34 commits into21st-dev:mainfrom
aletc1 wants to merge 34 commits into21st-dev:mainfrom
Conversation
- @anthropic-ai/claude-agent-sdk 0.2.45 -> 0.2.112 - Bundled Claude Code CLI 2.1.45 -> 2.1.112 (required for Opus 4.7) - Model picker: Opus 4.7, Opus 4.7 1M, Sonnet 4.6, Haiku 4.5 - 1M variant uses the opus[1m] alias; Claude Code parses the suffix and enables the 1M context window on the same underlying model Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Enter now inserts a newline and Shift+Enter submits (Opt+Shift+Enter force-submits). Applies to both the new-workspace prompt and the active-chat input, since they share AgentsMentionsEditor. Multi-line prompts are much easier to compose without an accidental send. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* FIX: White screen issue when loading * FIX: Updated nullable ollama
* FIX: White screen issue when loading * FIX: Updated nullable ollama * FEATURE: Aside version
…#7) The sidebar files section rendered as a flat list on Windows because paths occasionally contained backslashes, so the tree builder's `path.split("/")` produced a single segment. Normalize all paths emitted by the git status/diff parsers to forward slashes at the single backend boundary. Git stores paths with "/" on every platform, and Node fs / path.join accept "/" on Windows, so downstream functionality (file reads, diffs, numstat lookups) is unaffected. The renderer's many `split("/")` call sites keep working unchanged on both platforms. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chat content was capped at 672px, leaving excessive whitespace on wide windows and cramping bash/tool output. Bumps the message column, input area, status cards, and loading wrapper to 896px (+33%) so they stay aligned and tool renderers (which inherit width) breathe. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the binary on/off toggle with a per-subChat Off/Low/Medium/High/XHigh/Max selector (filtered per model) using the SDK's new `effort` option; drops the deprecated `maxThinkingTokens`. A one-time migration seeds the new atom from the old boolean so existing preferences carry over. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Combined Opus 4.7/1M from dev with thinkings arrays from feature branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Default Plan / Agent / Review Mode Model selectors in Settings → Agents, defaulting to Opus 4.7 1M / Sonnet 4.6 / Opus 4.7 (falling back to Opus if missing). The chat input selector now automatically switches to the mode's default at every mode-change point — plan approval, /plan, /agent, Shift+Tab toggle, new-chat initialization, and /review (transiently). The Settings dropdowns list every enabled model — Claude and Codex alike, filtered by hiddenModelsAtom — so users can pin a Codex model as the Plan / Agent / Review default. Cross-provider autoswitch writes to the right atom family (subChatModelIdAtomFamily vs subChatCodexModelIdAtomFamily), sets a new subChatProviderOverride atom, and syncs lastSelectedAgentIdAtom so the transport follows. subChatProviderOverrides moves from local React state in ChatViewInner to a runtime-only Jotai atom (cleared on chat switch) so the model-switching helper can write to it from outside React. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Overlays (Dropdown, Popover, ContextMenu, Select) used to hardcode a `dark` class on their content, producing a dark surface in the otherwise light UI. Replaced the hardcoded class with an opt-in `forceDark` prop (default `false`) across all four primitives, so every dropdown / popover / context menu / select follows the active theme by default. Added a 32px draggable strip at the top of the main content pane in `agents-layout.tsx` so window dragging works from any view (previously only the sidebar top was draggable). Added `-webkit-app-region: no-drag` carve-outs to interactive elements that sit inside the strip — AgentsHeaderControls hamburger, NewChatForm mobile fallback, SubChatSelector tabs and Plus button, AutomationsView / InboxView / AutomationsDetailView headers — so buttons remain clickable while empty gaps stay draggable. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ing (#14) Aggregates every local Claude Code session (~/.claude/projects/**/*.jsonl) and Codex CLI session (~/.codex/sessions/**/rollout-*.jsonl) into a dashboard with token totals, daily activity heatmap, cost bar chart, and per-model breakdown — no DB persistence, re-read on demand with a 15s cache. Opens from a new BarChart3 icon in the sidebar footer next to Archive, via a "usage" branch on desktopViewAtom. Pricing is bundled from LiteLLM (USD per MTok, Anthropic cache-write/read and OpenAI cached-input handled separately). Entries are deduped on `${messageId}:${requestId}` to avoid double-counting forked/resumed sessions, matching ccusage. Unknown models surface tokens but omit cost. Verified against the user's existing CLI totals: Opus 4.6 $134.26 and peak day 04/15 at 173M tokens match exactly. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- @anthropic-ai/claude-agent-sdk: 0.2.112 -> 0.2.114 - @modelcontextprotocol/sdk: ^1.25.3 -> ^1.29.0 (match SDK peer dep) - claude:download CLI binary: 2.1.112 -> 2.1.114 - Remove /pr-comments (deprecated in Claude Code v2.1.91) - Add /init, /simplify, /help builtin commands Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…xes (#16) - Per-mode Thinking Effort: new defaultPlan/Agent/ReviewModeThinkingAtom applied alongside the model default via applyModeDefaultModel, so switching mode (or /review) also swaps thinking effort. Removes the global Thinking Effort row from Settings; keeps per-subChat overrides intact. - Settings Preferences redesign: drop "Mode" from model labels; collapse the six model/thinking rows into three "Default Plan/Agent/Review" rows with the model and thinking selectors side-by-side on the right. Widen the settings container from max-w-2xl to max-w-5xl. - Chat column: bump max-w-4xl -> max-w-5xl on messages, user-questions, queue/status cards, chat input, disabled input fallback, and the new-chat form so every view uses the same wider column. - Drag-region fixes: add WebkitAppRegion: "no-drag" to interactive elements sitting under the 32px draggable top strip that were silently becoming drag regions. Affects right-side chat header buttons (Fork Locally, Open Preview, View Details, Open Terminal, Restore), terminal sidebar (Close + TerminalModeSwitcher), details sidebar, agent-plan sidebar, agent-preview desktop header, file-viewer sidebar (both headers), and expanded-widget sidebar. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes out the 6 items still open from the 10-bug stability audit: - auto-create sub-chat row on send when the row is missing (prevents silent UPDATE no-op if renderer races createSubChat → send) - strip CLAUDE_CODE_ENTRYPOINT/CLAUDECODE from inherited env so the dev build launched from a `claude` CLI terminal no longer fails with "Claude Code cannot be launched inside another session" - 90s first-chunk wedge timeout on the SDK stream — aborts and surfaces a STREAM_WEDGE error instead of hanging the UI indefinitely - clearer ENOENT message when the bundled Claude binary is missing, pointing the user at `bun run claude:download` - root AppErrorBoundary + preload try/catch around exposeElectronTRPC, with one-shot auto-reload (10s debounce via sessionStorage) so IPC race crashes recover instead of leaving a black screen - Opus 1M context: map `opus[1m]` to the `opus` CLI shortcut and set ANTHROPIC_BETAS=context-1m-2025-08-07 on the child env so the 1M window actually engages Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add { once: true } to abort listeners in ipc/acp/remote chat transports
to prevent AbortSignal listener accumulation.
- Add abortClaudeSessionsForSubChats() helper and call it from
projects.delete, chats.delete, and chats.deleteSubChat so in-flight
Claude sessions are aborted before their workspace is removed.
- Bump @pierre/diffs to 1.1.0-beta.18.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…archive popover (#20) ## Summary Addresses four bugs from the "happy hippo" stability pass that weren't yet applied on `dev`. Two of the six originally reported fixes (changelog URL, PostHog SDK) were already in the codebase; this PR ships the remaining four. ### 1. Pull & Push dialog for remote-ahead errors When `git push` fails because the remote branch has new commits, the user now sees a dialog offering a one-click **Pull & Push** (auto-stash + rebase, then retry push) instead of a raw `[rejected] non-fast-forward` toast. - Backend detects the error via a new `isNonFastForwardPushError` helper and re-throws it with a `REMOTE_AHEAD:` prefix so the renderer can distinguish it from generic push failures. - `usePushAction` routes `REMOTE_AHEAD:` errors to a new `PullPushDialog` and keeps the toast path for every other error. - Dialog is rendered in both push consumers: `DiffSidebarHeader` and `ActiveChat`. ### 2. PR status cache invalidation on branch switch Switching branches via the branch selector in `ChangesPanelHeader` now invalidates both `changes.getGitHubStatus` and `chats.getPrStatus`, so the PR chip reflects the new branch immediately instead of waiting for the 30s polling interval. ### 3. Missing tool-type registrations Added 14 tool types to `AgentToolRegistry` that were falling through to the plain-text fallback: `Skill`, `ScheduleWakeup`, `EnterPlanMode`, `CronCreate`/`CronDelete`/`CronList`, `Monitor`, `PushNotification`, `TaskOutput`/`TaskStop`, `EnterWorktree`/`ExitWorktree`, `RemoteTrigger`, `ToolSearch`. Each renders with a proper icon, pending/completed title, and a compact subtitle derived from the tool input. `AskUserQuestion` is intentionally left out since it still uses its dedicated rich renderer. ### 4. Archive popover eager fetches `archive-popover.tsx` no longer fires `trpc.projects.list` or `useRemoteArchivedChats` until the popover opens. `useRemoteArchivedChats` accepts a new `enabled` argument (defaults to `true` to keep existing callers unchanged). ## Test plan - [ ] Create a diverging commit on `origin/<branch>`, commit locally, press **Push** → dialog appears; **Pull & Push** completes in one click, auto-stashes/restores any local changes. - [ ] Disconnect network and push → plain toast (no dialog regression for unrelated errors). - [ ] Open a chat with an open PR, switch branches via the branch dropdown → PR chip refreshes immediately. - [ ] Trigger a Claude session that uses a Skill and/or a ScheduleWakeup → both render with icons and labels instead of plain text. - [ ] Cold app start → confirm neither `projects.list` nor the remote archived-chats query fires until the archive popover is opened. - [ ] Verify `bun run build` still passes (no new type errors in touched files). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Comment out all update-checking, download/install, changelog, and Feedback UI entry points so they are invisible to users in this build. Implementation is preserved verbatim behind UPDATES-DISABLED markers for easy reactivation (grep UPDATES-DISABLED to find all sites). Affected surfaces: - macOS app menu "Check for Updates..." item - Main-process auto-updater init, IPC handlers, focus/startup checks - Preload bridge update:* methods + event listeners - Update banner (bottom-left) + useUpdateChecker hook call - Settings -> Beta tab -> Updates section (Early Access + Check Now) - Help popover "What's new" section + changelog fetch - Sidebar Feedback button Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…y action (#22) - Register Sonnet 4.6 1M (sonnet[1m]) alongside existing Opus 1M. - Generalize the [1m] beta-header path so the same context-1m-2025-08-07 slug is sent for both Opus and Sonnet 1M models. - Add an amber "1M · higher cost" badge in the model selector to surface the pricing tradeoff before users opt in. - On rate-limit / context errors against a [1m] model, swap the toast action to "Switch to <base model>" — one click moves the sub-chat back to the 200K variant instead of leaving the user stuck. - Add gpt-5.4 and gpt-5.4-mini to Codex models and switch both the backend default (gpt-5.4/high) and frontend last-selected default to gpt-5.4. 5.3-codex stays available; existing user prefs are preserved. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sidebar, draggable tabs (#23) * feat: copy popover, optimistic sub-chats, worktree + empty-chat cleanup, sortable sidebar, draggable tabs Bundles six related improvements (F1-F6): - F1: Copy button in text-selection popover - F2: Optimistic sub-chat creation with rollback on RPC failure - F3: Worktree directory cleanup (path-prefix guard, project-delete cascade, startup orphan scan) - F4: Native HTML5 DnD on the tab bar with insertion marker - F5: Sortable sidebar rows via @dnd-kit - F6: Cached file_stats columns + auto-delete empty sub-chats on tab close and app quit Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ui: add grab cursor + grip-handle hint for draggable rows and tabs Drag affordances were invisible — users couldn't tell which rows/tabs were draggable. Sidebar rows now show a hover-revealed GripVertical icon on the left edge plus cursor-grab on hover. Tab pills show cursor-grab when draggable. Split-pair items keep cursor-pointer (they're locked). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t diff, VS Code/terminal fixes (#24) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Audit found three code paths that could destroy worktree source code without explicit user consent. Worktrees now only get deleted through the archive flow with the "Delete worktree" checkbox explicitly checked. - projects.delete no longer removes worktrees or the slug directory. The "Remove Project" dialog promises "Your files will not be deleted"; the backend now honors that promise. Only DB rows + terminals + Claude sessions are cleaned up. - Startup orphan scanner is no longer auto-invoked. Any automatic deletion risks destroying uncommitted code if the DB is empty, stale, or transiently errors. scanWorktreeOrphans() is kept for a future opt-in settings UI. - chats.delete gains a deleteWorktree flag (default false) and only calls removeWorktree when the caller opts in, matching chats.archive. - removeWorktree now logs path + caller stack before deleting so any unexpected loss can be traced. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds drag-and-drop to create/extend the split view by dragging sub-chats from the sidebar, drag reordering for queued messages, a Cmd+Shift+T shortcut (and tooltip) that opens a new sub-chat directly in split view, and PR status auto-refresh on git commit/push. Also adds a per-pane close button inline with the title, hides the Background/sandbox option, and lifts the sidebar's DndContext to a shared parent so drag can cross from sidebar to main content without overflow clipping (DragOverlay portals the preview at document root). Fix: `removeFromSplit` now shifts `activeSubChatId` when the removed pane was active so the correct pane stays visible after close. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…esh (#27) * fix(security,perf): audit-driven hardening of main process Addresses critical findings from a security/correctness/performance audit. Security (P0): - voice.ts, claude/env.ts: replace `execSync(${shell} -ilc '...')` with `execFileSync(shell, ['-ilc', ...])` and add a safe-shell allowlist to block `$SHELL=` command-injection via template interpolation. - claude-token.ts: remove `shell: true` from the `claude setup-token` spawn and resolve the CLI to an absolute path via `which`/`where` before invoking, so metacharacters in PATH can't be interpreted. - auth-manager.ts + index.ts: the `/auth` deep-link handler now requires an in-flight OAuth flow initiated by `startAuthFlow()`. A per-flow `state` nonce is generated, attached to the auth URL, and verified with constant-time compare on callback. Unsolicited deep links (drive- by CSRF via `twentyfirst-agents://auth?code=...`) are rejected. Performance (P1): - db/index.ts: add `PRAGMA synchronous = NORMAL` under WAL to reduce fsync load during high-frequency message persistence. - db/schema/index.ts + drizzle/0009_*: add indexes on `chats.project_id`, `sub_chats.chat_id`, and `sub_chats.stream_id` (previously full-table scans on hot FK lookups). - claude.ts: coalesce `text-delta` chunks in a 24ms buffer keyed by text id. Non-delta chunks flush the buffer first to preserve ordering. Cuts tRPC/IPC chatter during long streaming responses. Robustness (P2): - db/index.ts: migration failures now quarantine the DB file to `agents.db.broken-<timestamp>` and start fresh instead of crashing the app on every launch. - index.ts: bound `cleanupGitWatchers()` in `before-quit` to 1.5s so a hung chokidar instance can't block app quit indefinitely. Dismissed during verification: - `sandbox: false` in webPreferences is intentional for electron-trpc; contextIsolation remains enabled. - `activeSessions` map cleanup is already wired on unsubscribe and in the stream's finally block. - The stream's async IIFE is wrapped in try/catch/finally; no unhandled rejection. - Project deletion is atomic under FK cascade with `foreign_keys=ON`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: refresh fork additions section with recent features Adds the user-visible features shipped since the README was last touched (commits #18 through #26) and groups the fork additions into four sections for readability: Workflow & UI, Git/PRs/Worktrees, Models, and Stability & Polish. Highlights surfaced: split view with drag-to-split, Cmd+Shift+T, sortable sidebar, draggable tabs, queue reorder, copy popover, PR widget + branch switcher, two-column commit diff, Pull & Push recovery dialog, worktree deletion safety, Sonnet 4.6 1M context + recovery action, GPT-5.4, rich tool rendering, stream wedge timeout, and crash auto-recovery. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#28) The Review button sent its prompt on whatever model was currently active, ignoring the user-configured Default Review model + thinking. The /review slash command already applies it via applyModeDefaultModel; the button was missed. Mirror that call so both paths behave the same. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Setup commands (bun install, etc.) failed in Electron GUI launches because process.env.PATH is stripped. Resolve the full shell env via getShellEnvironment() before exec(), matching the pattern already used by getGitEnv() in worktree.ts. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Detects dev.azure.com / visualstudio.com remotes automatically and routes PR status, merge, title updates, and Create-PR flows through the az CLI (azure-devops extension). GitHub path is unchanged — a thin dispatcher in src/main/lib/git/providers forwards by provider, and the PR widget, status bar, and rename dialog consume the existing provider-agnostic shape. Silent detection of az / extension / login; queries degrade to null on any failure so the 30s poll never throws, mutations throw toast-ready messages (missing CLI, missing extension, not logged in). Conflict errors surface via the existing MERGE_CONFLICT: contract so no renderer changes are needed. Also adds a new git_project column (Drizzle migration 0010) to store the Azure project slug without colliding with gitOwner, extends getPrContext to return provider info for the agent prompt, and teaches pr-message.ts and git-activity.ts to emit and parse az repos pr create. v1 scope: cloud only; PR comments stubbed to [] for Azure; additions/ deletions report 0; rebase merge falls back to non-squash. On-prem Azure DevOps Server is out of scope. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove the "Delete worktree" checkbox from the Archive dialog and expose Delete as an explicit action on already-archived workspaces: a Delete button next to Restore in the chat header (desktop + mobile) and a Delete all button in the archive popover. Both delete flows confirm via AlertDialog and cover local archived workspaces only. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#32) The MarkdownViewer and ImageViewer header divs were missing `WebkitAppRegion: "no-drag"`, so the top 32px of their toolbars overlapped the window drag region and swallowed clicks on the Open-in-editor, view-toggle, copy, and close buttons. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a Tasks widget to the Details Sidebar that surfaces what Claude is actively doing in the selected sub-chat. Each in-flight tool (Bash, Read, Edit, Task-tool sub-agents, etc.) renders as a row with name, input summary and ticking elapsed time; Task-tool sub-agent children nest under their parent via the composite toolCallId convention. The list is strictly live-only: gated on the streaming-status store and filters out any part whose state has reached output-available / output-error / result / input-error, so finished items never linger. Todo tools (TaskCreate / TaskUpdate / TaskList / TaskGet / TodoWrite) are excluded because they already surface in the Todo widget. No stop button in the widget \u2014 the SDK only supports session-level abort, which the existing chat-input Stop button already covers. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refresh bundled AI backends to pick up upstream bug fixes (MCP OAuth, credential save crash on Linux/Windows, MCP approval flow) and stay in sync with the current ACP protocol. - @anthropic-ai/claude-agent-sdk 0.2.114 -> 0.2.118 - Claude Code native binary 2.1.114 -> 2.1.118 - @zed-industries/codex-acp 0.9.3 -> 0.11.1 - Codex CLI native binary 0.98.0 -> 0.124.0 No API surface changes; model catalog (Opus 4.7 / Sonnet 4.6 / Haiku 4.5) verified current against the Anthropic model overview docs. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Worktrees were being created off `origin/<baseBranch>`, a local remote-tracking ref that only reflects the last fetch. When the remote had advanced, the new worktree was born stale and caused avoidable merge conflicts later. Now `createWorktreeForChat` best-effort-fetches `origin <baseBranch>` before calling `git worktree add`; fetch failures are logged and never block creation. Skipped for `branchType === "local"` and repos without an origin remote. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Claude running inside the app reports "Explore agent isn't available" because @anthropic-ai/claude-agent-sdk ships zero built-in subagents — Explore/Plan/general-purpose/statusline-setup/claude-code-guide are CLI-only. Seed them via options.agents so Claude inside 1Code gets parity with the CLI's Task tool. - New builtin-agents.ts with the five subagents. Read-only ones use disallowedTools (Edit, Write, NotebookEdit, ExitPlanMode) rather than a hand-curated allowlist, matching the CLI's "all tools except X" phrasing and avoiding SDK tool-name drift. - All built-ins omit the model field so they inherit the user's selected model rather than forcing Sonnet. - buildAgentsOption() seeds built-ins first, then overlays user/ project/plugin agents — user-defined files with the same name still override, matching CLI behavior. - Also forwards disallowedTools from parsed user .md agents to the SDK. This field was already parsed from frontmatter but silently dropped before reaching the SDK. Ollama path unchanged (SDK options.agents isn't supported there). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@anthropic-ai/claude-agent-sdkships zero built-in subagents —Explore/Plan/general-purpose/statusline-setup/claude-code-guideare CLI-only. The SDK requires every subagent to be declared viaoptions.agents.buildAgentsOption()with aBUILTIN_SUBAGENTSconstant so Claude inside the app gets the same Task-tool toolkit as CLI users. Read-only subagents (Explore/Plan) usedisallowedTools: ["Edit", "Write", "NotebookEdit", "ExitPlanMode"]— matches the CLI's "all tools except X" phrasing and auto-picks up any new SDK tools without hand-curated allowlists. All built-ins omitmodelso they inherit the user's selected model (no forced Sonnet).~/.claude/agents/Explore.mdstill wins, matching CLI behavior.disallowedToolswas already parsed from.mdagent frontmatter viaparseAgentMd()but silently dropped before reaching the SDK. Now forwarded correctly so user agents withdisallowedTools: Write, Editin frontmatter work as documented.options.agentsisn't supported on the Ollama bridge, so the existing!isUsingOllamaguard keeps built-ins off that path.Files
src/main/lib/trpc/routers/builtin-agents.ts(new) — five CLI-parity subagents with descriptions verbatim from the CLI's Agent tool schema.src/main/lib/trpc/routers/agent-utils.ts— seed built-ins inbuildAgentsOption(), widen return type to includedisallowedTools, forwarddisallowedToolsfrom parsed user agents.Sources
general-purpose,Explore,Plan,statusline-setupas built-ins.claude-code-guideis observable in the CLI but not in the public docs — included for completeness. Built-in prompts/tool restrictions are treated as implementation details that may change between CLI versions; caveat noted in the file's JSDoc.Test plan
bun run dev.tsfiles undersrc/main/lib/trpc/routers." → expect aTasktool call withsubagent_type: "Explore"and a returned file list.~/.claude/agents/Explore.mdwith a custom prompt → restart → rerun th