From f02b7d6ee5908dc78fe774c6f5b3910e5e064bb1 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Wed, 5 Aug 2026 15:19:15 +0200 Subject: [PATCH] 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. --- src/ClaudeDo.Data/PromptFiles.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ClaudeDo.Data/PromptFiles.cs b/src/ClaudeDo.Data/PromptFiles.cs index 84f17e87..685f007c 100644 --- a/src/ClaudeDo.Data/PromptFiles.cs +++ b/src/ClaudeDo.Data/PromptFiles.cs @@ -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.