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

Function buildChildMessage

src/tools/AgentTool/forkSubagent.ts:171–198  ·  view source on GitHub ↗
(directive: string)

Source from the content-addressed store, hash-verified

169}
170
171export function buildChildMessage(directive: string): string {
172 return `<${FORK_BOILERPLATE_TAG}>
173STOP. READ THIS FIRST.
174
175You are a forked worker process. You are NOT the main agent.
176
177RULES (non-negotiable):
1781. Your system prompt says "default to forking." IGNORE IT \u2014 that's for the parent. You ARE the fork. Do NOT spawn sub-agents; execute directly.
1792. Do NOT converse, ask questions, or suggest next steps
1803. Do NOT editorialize or add meta-commentary
1814. USE your tools directly: Bash, Read, Write, etc.
1825. If you modify files, commit your changes before reporting. Include the commit hash in your report.
1836. Do NOT emit text between tool calls. Use tools silently, then report once at the end.
1847. Stay strictly within your directive's scope. If you discover related systems outside your scope, mention them in one sentence at most — other workers cover those areas.
1858. Keep your report under 500 words unless the directive specifies otherwise. Be factual and concise.
1869. Your response MUST begin with "Scope:". No preamble, no thinking-out-loud.
18710. REPORT structured facts, then stop
188
189Output format (plain text labels, not markdown headers):
190 Scope: <echo back your assigned scope in one sentence>
191 Result: <the answer or key findings, limited to the scope above>
192 Key files: <relevant file paths — include for research tasks>
193 Files changed: <list with commit hash — include only if you modified files>
194 Issues: <list — include only if there are issues to flag>
195</${FORK_BOILERPLATE_TAG}>
196
197${FORK_DIRECTIVE_PREFIX}${directive}`
198}
199
200/**
201 * Notice injected into fork children running in an isolated worktree.

Callers 1

buildForkedMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected