Description
The system prompt contains a nearly identical ~100-word paragraph in two different sections — CAPABILITIES and SYSTEM INFORMATION. This means every model invocation wastes tokens reading the same content twice.
Affected files
-
src/core/prompts/sections/capabilities.ts (line 9, bullet point):
- When the user initially gives you a task, a recursive list of all filepaths
in the current workspace directory ('${cwd}') will be included in environment_details.
This provides an overview of the project's file structure...
-
src/core/prompts/sections/system-info.ts (line 27):
When the user initially gives you a task, a recursive list of all filepaths
in the current workspace directory ('/test/path') will be included in environment_details.
This provides an overview of the project's file structure...
Impact
- Token waste: ~100 tokens (with full path expansion) are consumed twice per request
- Model confusion: The model sees identical instructions in two different sections, which may appear as if they need separate interpretation
- Historical artifact: This text was carried over from upstream repos without deduplication
How to reproduce
- Check
src/core/prompts/system.ts — the prompt is assembled from multiple sections
- Compare the text in
capabilities.ts and system-info.ts — the paragraph about recursive file listing is identical
- The resulting prompt sent to the model contains this same text twice
Suggested fix
Remove the duplicate paragraph from system-info.ts (keep it in capabilities.ts where it logically belongs as a capability description). The SYSTEM INFORMATION section should only contain structural info (OS, shell, CWD) without repeating capability descriptions.
Additional related findings in the same template system
All discovered via self-audit of the live system prompt (fresh model session analyzing its own prompt).
1. Template defect: "if I needed to run" instead of "if you needed to run"
In src/core/prompts/sections/rules.ts (line 78), the template uses first-person pronoun:
if I needed to run `npm install` in a project outside of...
Should be "if you needed to run" — the template was written from the model's perspective but never normalized to consistent second-person tone used in the rest of the prompt.
2. Logical contradiction about cd
In the same file (rules.ts, lines 76-78), two consecutive sentences directly contradict each other:
- Sentence 1: "You cannot
cd into a different directory to complete a task. You are stuck operating from '${cwd}'"
- Sentence 2: "prepend with
cd'ing into that directory && then executing the command"
This is confusing — the model is told both "you cannot cd" and "use cd" in the same section.
3. Triple duplication of "don't end with questions"
The instruction "Do not end your result with questions or offers for further assistance" (or variants) appears three times:
- In
OBJECTIVE section: "But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance"
- In
RULES section: "NEVER end attempt_completion result with a question or request to engage in further conversation"
- In
attempt_completion tool description
Same rule, three places, slightly different wording each time.
All of these are copy-paste/template-evolution artifacts of the same nature as the main duplicate — the system prompt grew organically without deduplication or consistency review.
Found during code analysis. Also confirmed present in upstream repos.
Description
The system prompt contains a nearly identical ~100-word paragraph in two different sections —
CAPABILITIESandSYSTEM INFORMATION. This means every model invocation wastes tokens reading the same content twice.Affected files
src/core/prompts/sections/capabilities.ts(line 9, bullet point):src/core/prompts/sections/system-info.ts(line 27):Impact
How to reproduce
src/core/prompts/system.ts— the prompt is assembled from multiple sectionscapabilities.tsandsystem-info.ts— the paragraph about recursive file listing is identicalSuggested fix
Remove the duplicate paragraph from
system-info.ts(keep it incapabilities.tswhere it logically belongs as a capability description). TheSYSTEM INFORMATIONsection should only contain structural info (OS, shell, CWD) without repeating capability descriptions.Additional related findings in the same template system
All discovered via self-audit of the live system prompt (fresh model session analyzing its own prompt).
1. Template defect: "if I needed to run" instead of "if you needed to run"
In
src/core/prompts/sections/rules.ts(line 78), the template uses first-person pronoun:Should be "if you needed to run" — the template was written from the model's perspective but never normalized to consistent second-person tone used in the rest of the prompt.
2. Logical contradiction about
cdIn the same file (
rules.ts, lines 76-78), two consecutive sentences directly contradict each other:cdinto a different directory to complete a task. You are stuck operating from '${cwd}'"cd'ing into that directory && then executing the command"This is confusing — the model is told both "you cannot cd" and "use cd" in the same section.
3. Triple duplication of "don't end with questions"
The instruction "Do not end your result with questions or offers for further assistance" (or variants) appears three times:
OBJECTIVEsection: "But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance"RULESsection: "NEVER end attempt_completion result with a question or request to engage in further conversation"attempt_completiontool descriptionSame rule, three places, slightly different wording each time.
All of these are copy-paste/template-evolution artifacts of the same nature as the main duplicate — the system prompt grew organically without deduplication or consistency review.
Found during code analysis. Also confirmed present in upstream repos.