MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / fetchSystemPromptParts

Function fetchSystemPromptParts

src/utils/queryContext.ts:44–74  ·  view source on GitHub ↗
({
  tools,
  mainLoopModel,
  additionalWorkingDirectories,
  mcpClients,
  customSystemPrompt,
}: {
  tools: Tools
  mainLoopModel: string
  additionalWorkingDirectories: string[]
  mcpClients: MCPServerConnection[]
  customSystemPrompt: string | undefined
})

Source from the content-addressed store, hash-verified

42 * sideQuestion's fallback uses the base result directly.
43 */
44export async function fetchSystemPromptParts({
45 tools,
46 mainLoopModel,
47 additionalWorkingDirectories,
48 mcpClients,
49 customSystemPrompt,
50}: {
51 tools: Tools
52 mainLoopModel: string
53 additionalWorkingDirectories: string[]
54 mcpClients: MCPServerConnection[]
55 customSystemPrompt: string | undefined
56}): Promise<{
57 defaultSystemPrompt: string[]
58 userContext: { [k: string]: string }
59 systemContext: { [k: string]: string }
60}> {
61 const [defaultSystemPrompt, userContext, systemContext] = await Promise.all([
62 customSystemPrompt !== undefined
63 ? Promise.resolve([])
64 : getSystemPrompt(
65 tools,
66 mainLoopModel,
67 additionalWorkingDirectories,
68 mcpClients,
69 ),
70 getUserContext(),
71 customSystemPrompt !== undefined ? Promise.resolve({}) : getSystemContext(),
72 ])
73 return { defaultSystemPrompt, userContext, systemContext }
74}
75
76/**
77 * Build CacheSafeParams from raw inputs when getLastCacheSafeParams() is null.

Callers 2

submitMessageMethod · 0.85

Calls 2

getSystemPromptFunction · 0.50
resolveMethod · 0.45

Tested by

no test coverage detected