MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createPlanModeAttachmentIfNeeded

Function createPlanModeAttachmentIfNeeded

src/services/compact/compact.ts:1542–1560  ·  view source on GitHub ↗
(
  context: ToolUseContext,
)

Source from the content-addressed store, hash-verified

1540 * normally only injected on tool-use turns via getAttachmentMessages).
1541 */
1542export async function createPlanModeAttachmentIfNeeded(
1543 context: ToolUseContext,
1544): Promise<AttachmentMessage | null> {
1545 const appState = context.getAppState()
1546 if (appState.toolPermissionContext.mode !== 'plan') {
1547 return null
1548 }
1549
1550 const planFilePath = getPlanFilePath(context.agentId)
1551 const planExists = getPlan(context.agentId) !== null
1552
1553 return createAttachmentMessage({
1554 type: 'plan_mode',
1555 reminderType: 'full',
1556 isSubAgent: !!context.agentId,
1557 planFilePath,
1558 planExists,
1559 })
1560}
1561
1562/**
1563 * Creates attachments for async agents so the model knows about them after

Callers 2

compactConversationFunction · 0.85

Calls 3

getPlanFilePathFunction · 0.85
getPlanFunction · 0.85
createAttachmentMessageFunction · 0.85

Tested by

no test coverage detected