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

Function createPlanAttachmentIfNeeded

src/services/compact/compact.ts:1470–1486  ·  view source on GitHub ↗
(
  agentId?: AgentId,
)

Source from the content-addressed store, hash-verified

1468 * This ensures the plan is preserved after compaction.
1469 */
1470export function createPlanAttachmentIfNeeded(
1471 agentId?: AgentId,
1472): AttachmentMessage | null {
1473 const planContent = getPlan(agentId)
1474
1475 if (!planContent) {
1476 return null
1477 }
1478
1479 const planFilePath = getPlanFilePath(agentId)
1480
1481 return createAttachmentMessage({
1482 type: 'plan_file_reference',
1483 planFilePath,
1484 planContent,
1485 })
1486}
1487
1488/**
1489 * Creates an attachment for invoked skills to preserve their content across compaction.

Callers 3

compactConversationFunction · 0.85

Calls 3

getPlanFunction · 0.85
getPlanFilePathFunction · 0.85
createAttachmentMessageFunction · 0.85

Tested by

no test coverage detected