claudeSdkOptions.ts ×4

Frontier kind: Code frontier

unlabeled · c_c39d64f540c7

118 tests · 4128 LOC · 27 files · introduces 0 tests · 52 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges52 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
574 ranges4128 lines · 27 files · Browse complete extent
All tests (intent)
118 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 52 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeSdkOptions.ts 52 introduced LOC · 4 ranges

Open complete file

90 * from the session's {@link SessionClientToolsDiff}.
91 */
92 > export async function buildOptions( claudeSdkOptions.ts
93 > input: IBuildOptionsInput,
94 > transport: ClaudeTransport,
95 > logStderr: (data: string) => void,
96 > ): Promise<Options> {
97 > const isProxy = transport.kind === 'proxy';
98 > const subprocessEnv = buildSubprocessEnv(isProxy);
99 > const resolvedRgDiskPath = await rgDiskPath();
100 > const settingsEnv: Record<string, string> = {
101 > // Proxied (Copilot-routed) mode points the SDK at the local proxy on a
102 > // per-session bearer. Native (BYO-Anthropic) mode omits both so the SDK
103 > // uses its own credential resolution from the subprocess env
104 > // (`ANTHROPIC_API_KEY`, or `CLAUDE_CODE_OAUTH_TOKEN` from `claude
105 > // setup-token` — both forwarded by `buildSubprocessEnv`).
106 > ...(transport.kind === 'proxy'
107 ? {
108 ANTHROPIC_BASE_URL: transport.handle.baseUrl,
110 }
111 : {}),
112 > CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: '1', claudeSdkOptions.ts
113 > USE_BUILTIN_RIPGREP: '0',
114 > // Attribute the CLI's tool subprocesses (`gh`, …) to VS Code.
115 > // `settings.env` is what the CLI layers onto the commands it runs, so it
116 > // needs the marker in addition to the spawn env below. Note the CLI
117 > // re-stamps `AI_AGENT` as `claude-code_<version>_agent` for its own Bash
118 > // tool, so commands from that tool are not attributed to VS Code.
119 > [AiAgentEnvVar]: AiAgentEnvValue,
120 > PATH: `${dirname(resolvedRgDiskPath)}${delimiter}${process.env.PATH ?? ''}`,
121 > };
122 >
123 > return {
124 > cwd: input.workingDirectory.fsPath,
125 > executable: process.execPath as 'node',
126 > env: subprocessEnv,
127 > abortController: input.abortController,
128 > allowDangerouslySkipPermissions: true,
129 > canUseTool: input.canUseTool,
130 > onElicitation: input.onElicitation,
131 > disallowedTools: ['WebSearch'],
132 > includePartialMessages: true,
133 > forwardSubagentText: true,
134 > enableFileCheckpointing: true,
135 > model: toSdkModelId(input.model?.id),
136 > effort: resolveClaudeEffort(input.model),
137 > permissionMode: input.permissionMode,
138 > ...(input.isResume
139 ? { resume: input.sessionId, ...(input.resumeSessionAt ? { resumeSessionAt: input.resumeSessionAt } : {}) }
140 : { sessionId: input.sessionId }),
141 > ...(input.mcpServers ? { mcpServers: input.mcpServers } : {}), claudeSdkOptions.ts
142 > ...(input.allowedTools && input.allowedTools.length > 0 ? { allowedTools: [...input.allowedTools] } : {}),
143 > ...(input.plugins && input.plugins.length > 0
144 ? { plugins: input.plugins.map(p => ({ type: 'local' as const, path: p.fsPath })) }
145 : {}),
146 > ...(input.agent ? { agent: input.agent } : {}), claudeSdkOptions.ts
147 > settingSources: ['user', 'project', 'local'],
148 > settings: { env: settingsEnv },
149 > systemPrompt: { type: 'preset', preset: 'claude_code' },
150 > stderr: logStderr,
151 > };
152 > }
153
154 /**