MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getSystemPrompt

Method getSystemPrompt

server/src/addie/claude-client.ts:364–374  ·  view source on GitHub ↗

* Get the system prompt from markdown rule files, with tool reference always appended. * * Rules are loaded from ./rules/*.md files (cached in memory after first read). * Tool reference (ADDIE_TOOL_REFERENCE) is always appended (tied to code). * Fallback prompt used only when rule files

()

Source from the content-addressed store, hash-verified

362 * Fallback prompt used only when rule files can't be read.
363 */
364 private getSystemPrompt(): { prompt: string } {
365 try {
366 const basePrompt = loadRules();
367 const prompt = `${basePrompt}\n\n---\n\n${ADDIE_TOOL_REFERENCE}`;
368 return { prompt };
369 } catch (error) {
370 logger.warn({ error }, 'Addie: Failed to load rules from files, using fallback prompt');
371 const fallbackPrompt = `${ADDIE_FALLBACK_PROMPT}\n\n---\n\n${ADDIE_TOOL_REFERENCE}`;
372 return { prompt: fallbackPrompt };
373 }
374 }
375
376 private estimateMessageContentChars(content: Anthropic.MessageParam['content']): number {
377 if (typeof content === 'string') return content.length;

Callers 2

processMessageMethod · 0.95
processMessageStreamMethod · 0.95

Calls 2

loadRulesFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected