home/productivity/effective-system-prompt-selection

Effective System Prompt Selection

GPTClaudeDeepSeek··547 copies·updated 2026-07-14
effective-system-prompt-selection.prompt
# 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