MCPcopy
hub / github.com/codeaashu/claude-code / getCoordinatorUserContext

Function getCoordinatorUserContext

src/coordinator/coordinatorMode.ts:80–109  ·  view source on GitHub ↗
(
  mcpClients: ReadonlyArray<{ name: string }>,
  scratchpadDir?: string,
)

Source from the content-addressed store, hash-verified

78}
79
80export function getCoordinatorUserContext(
81 mcpClients: ReadonlyArray<{ name: string }>,
82 scratchpadDir?: string,
83): { [k: string]: string } {
84 if (!isCoordinatorMode()) {
85 return {}
86 }
87
88 const workerTools = isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)
89 ? [BASH_TOOL_NAME, FILE_READ_TOOL_NAME, FILE_EDIT_TOOL_NAME]
90 .sort()
91 .join(', ')
92 : Array.from(ASYNC_AGENT_ALLOWED_TOOLS)
93 .filter(name => !INTERNAL_WORKER_TOOLS.has(name))
94 .sort()
95 .join(', ')
96
97 let content = `Workers spawned via the ${AGENT_TOOL_NAME} tool have access to these tools: ${workerTools}`
98
99 if (mcpClients.length > 0) {
100 const serverNames = mcpClients.map(c => c.name).join(', ')
101 content += `\n\nWorkers also have access to MCP tools from connected MCP servers: ${serverNames}`
102 }
103
104 if (scratchpadDir && isScratchpadGateEnabled()) {
105 content += `\n\nScratchpad directory: ${scratchpadDir}\nWorkers can read and write here without permission prompts. Use this for durable cross-worker knowledge — structure files however fits the work.`
106 }
107
108 return { workerToolsContext: content }
109}
110
111export function getCoordinatorSystemPrompt(): string {
112 const workerCapabilities = isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)

Callers 2

submitMessageMethod · 0.85
REPLFunction · 0.85

Calls 4

isCoordinatorModeFunction · 0.85
isEnvTruthyFunction · 0.85
isScratchpadGateEnabledFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected