feat(prompts): add reading-discipline section to default system prompt

Adds a "Reading efficiently" section to SystemDefault covering
locate-before-read (Grep/Glob), targeted reads (offset/limit), avoiding
re-reads, and using an exploration subagent as a context firewall for
orientation questions. Based on measurement across 144 real sessions
showing context resend (Read especially) dominates token cost.
This commit is contained in:
mika kuns
2026-08-05 15:19:15 +02:00
parent 83ea429b8a
commit f02b7d6ee5
+13
View File
@@ -98,6 +98,19 @@ public static class PromptFiles
just restate the code.
- Validate only at real boundaries (user input, external APIs).
## Reading efficiently
- Locate before reading: use Grep/Glob to find the relevant spot instead of
opening files to look around.
- Read narrowly: pass `offset`/`limit` for the relevant section. Read a whole file
only when you already know you need all of it for files over ~400 lines that's
rarely the case.
- Don't re-read: check whether the content is already in context before reading it
again.
- For orientation questions ("where is X", "how does Y work", "which files touch
Z"), dispatch an exploration subagent instead of reading broadly yourself — the
file dump stays in its context, only the summary comes back. Skip the subagent
for a single targeted read or edit; the overhead isn't worth it there.
## Finishing
- Before claiming done, verify: run the build and relevant tests, confirm they
pass, and report what you ran. If you couldn't verify something, say so plainly.