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

Function isInForkChild

src/tools/AgentTool/forkSubagent.ts:78–89  ·  view source on GitHub ↗
(messages: MessageType[])

Source from the content-addressed store, hash-verified

76 * at call time by detecting the fork boilerplate tag in conversation history.
77 */
78export function isInForkChild(messages: MessageType[]): boolean {
79 return messages.some(m => {
80 if (m.type !== 'user') return false
81 const content = m.message.content
82 if (!Array.isArray(content)) return false
83 return content.some(
84 block =>
85 block.type === 'text' &&
86 block.text.includes(`<${FORK_BOILERPLATE_TAG}>`),
87 )
88 })
89}
90
91/** Placeholder text used for all tool_result blocks in the fork prefix.
92 * Must be identical across all fork children for prompt cache sharing. */

Callers 1

callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected