Skip to content

fix(prompt): add coding-quality exceptions to token-minimization rules #37367

Description

@chicagoist

Problem

The system prompt in packages/opencode/src/session/prompt/default.txt contains three instructions that conflict with writing reliable code:

  1. "minimize output tokens as much as possible" — causes AI agents to omit model names from logs, skip tests, and skip guard clauses for None/edge cases.
  2. "MUST answer concisely with fewer than 4 lines" — prevents consequence research, error analysis, and code planning (the most token-costly but most critical activities).
  3. "DO NOT ADD ANY COMMENTS" — complex fallback/rotation logic needs inline explanations for future maintainers.

Proposal

Add exceptions for coding tasks so these instructions don't override code quality:

  1. Token minimization: explicitly state "never sacrifice correctness, debuggability, or completeness for token efficiency"
  2. 4-line limit: exempt code planning, consequence research, error analysis
  3. No comments: exempt complex logic, workarounds, security-critical sections

Impact

Only default.txt needs changes (~3 line modifications). All other prompt files (anthropic.txt, gpt.txt, gemini.txt, plan.txt, etc.) can be updated similarly if maintainers agree.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions