spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / fixtures / agent-spawned.ts
20 lines · 569 BRaw
1import type { AgentSpawnInput, Origin } from 'claude-code'
2
3/**
4 * A subagent's spawn as the engine raises it, pinned to who provides the
5 * agent's definition.
6 *
7 * @param provider who provides the agent, as the engine pinned it
8 * @returns the `agent.spawn` input
9 */
10export const agentSpawned = (provider: Origin): AgentSpawnInput => ({
11 tool_use_id: 't1',
12 prompt: 'list the files in src',
13 description: 'List files',
14 subagentType: 'general-purpose',
15 provider,
16 parentModel: 'the-model',
17 permissionMode: 'default',
18 background: false,
19 fork: false,
20})