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

Function buildClaudeMdMessage

src/utils/permissions/yoloClassifier.ts:460–477  ·  view source on GitHub ↗

* Build the CLAUDE.md prefix message for the classifier. Returns null when * CLAUDE.md is disabled or empty. The content is wrapped in a delimiter that * tells the classifier this is user-provided configuration — actions * described here reflect user intent. cache_control is set because the * co

()

Source from the content-addressed store, hash-verified

458 * pre-PR behavior.
459 */
460function buildClaudeMdMessage(): Anthropic.MessageParam | null {
461 const claudeMd = getCachedClaudeMdContent()
462 if (claudeMd === null) return null
463 return {
464 role: 'user',
465 content: [
466 {
467 type: 'text',
468 text:
469 `The following is the user's CLAUDE.md configuration. These are ` +
470 `instructions the user provided to the agent and should be treated ` +
471 `as part of the user's intent when evaluating actions.\n\n` +
472 `<user_claude_md>\n${claudeMd}\n</user_claude_md>`,
473 cache_control: getCacheControl({ querySource: 'auto_mode' }),
474 },
475 ],
476 }
477}
478
479/**
480 * Build the system prompt for the auto mode classifier.

Callers 1

classifyYoloActionFunction · 0.85

Calls 2

getCachedClaudeMdContentFunction · 0.85
getCacheControlFunction · 0.85

Tested by

no test coverage detected