Effective System Prompt Selection
# Effective System Prompt Selection
## Source
- `src/utils/systemPrompt.ts`
---
## Purpose
This module determines which system prompt actually gets sent for a turn.
It defines `buildEffectiveSystemPrompt(...)` and enforces precedence/combination rules between:
- override prompt
- coordinator prompt
- main-thread agent prompt
- custom CLI prompt
- default prompt
- appended prompt suffix
---
## Selection order
`buildEffectiveSystemPrompt` applies this priority:
1. `overrideSystemPrompt` (hard replace)
2. Coordinator system prompt (`COORDINATOR_MODE` gate + env + no main-thread agent)
3. Agent system prompt (`mainThreadAgentDefinition`)
- in proactive mode: append agent instructions to default prompt
- otherwise: agent prompt replaces default prompt
4. `customSystemPrompt`
5. `defaultSystemPrompt`
`appendSystemPrompt` is appended in non-override paths.
---
## Notable prompt behavior
- In coordinator mode, it lazy-loads `getCoordinatorSystemPrompt()` and bypasses default prompt.
- For built-in agents, `getSystemPrompt(...)` may depend on tool context.
- In proactive mode, agent instructions are wrapped as:when to use it
Community prompt sourced from the open-source GitHub repo moiralongspurred78/claude-code-prompts-reference (no explicit license). A "Effective System Prompt Selection" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
moiralongspurred78/claude-code-prompts-reference · no explicit license
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar