You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate to one Karpathy discipline block; drop MINIMAL_CODE
Remove the Ponytail-derived MINIMAL_CODE block and restore the "Simplicity
First" section (adapted as "Keep it simple") that was omitted from
WORKING_DISCIPLINE to avoid overlap. The result is a single, non-redundant
always-on block sourced entirely from the Karpathy guidelines, carrying all
four sections in source order.
Generated-By: PostHog Code
Task-Id: 2cfc5453-0307-4c67-a6eb-6456bc96cf1a
Copy file name to clipboardExpand all lines: packages/agent/src/adapters/claude/session/instructions.ts
+5-21Lines changed: 5 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -26,26 +26,6 @@ If an MCP tool call is explicitly denied with a message, relay that denial messa
26
26
If an MCP tool call returns an error, treat it as a normal tool error — troubleshoot, retry, or inform the user about the specific error. Do NOT assume it is a permissions issue and do NOT direct the user to any settings page.
27
27
`;
28
28
29
-
// Always-on minimalism, adapted from Ponytail (https://github.com/DietrichGebert/ponytail, MIT).
30
-
constMINIMAL_CODE=`
31
-
# Writing Minimal Code
32
-
33
-
After you understand the problem — never instead of it — write the least code that fully solves the task. Less code means fewer output tokens now and fewer review and edit turns later.
34
-
35
-
Before writing code, stop at the first rung that holds:
36
-
1. YAGNI — does this need building at all?
37
-
2. Reuse — is it already in the codebase? Use it.
38
-
3. Standard library — does the stdlib cover it?
39
-
4. Native platform feature — does the platform already do this?
40
-
5. Installed dependency — can an already-installed dep handle it? Don't add a new one.
41
-
6. One line — if it can be one line, make it one line.
42
-
7. Otherwise, write the minimum that works.
43
-
44
-
Prefer deletion over addition and boring over clever. No unrequested abstractions, boilerplate, or dependencies. Fix bugs at the shared root, not once per caller. When a request is more complex than the problem warrants, propose the smaller version.
45
-
46
-
This is minimalism, not negligence. Never cut understanding the problem, input validation at trust boundaries, error handling that prevents data loss, security, accessibility, or anything the user explicitly asked for.
47
-
`;
48
-
49
29
// Behavioral guidelines adapted from the Karpathy guidelines
@@ -57,6 +37,10 @@ These bias toward caution over speed; for trivial tasks, use judgment.
57
37
58
38
Don't assume, don't hide confusion, surface tradeoffs. Before implementing, state your assumptions explicitly and ask when uncertain. If a request has multiple reasonable interpretations, present them instead of silently picking one. If a simpler approach exists, say so and push back when warranted. If something is unclear, stop and name what is confusing.
59
39
40
+
## Keep it simple
41
+
42
+
Write the minimum code that solves the problem; nothing speculative. No features beyond what was asked, no abstractions for single-use code, no "flexibility" or configurability that wasn't requested, and no error handling for impossible scenarios. If you write 200 lines and it could be 50, rewrite it. Ask yourself whether a senior engineer would call this overcomplicated — if so, simplify.
43
+
60
44
## Make surgical changes
61
45
62
46
Touch only what you must; clean up only your own mess. When editing existing code, don't "improve" adjacent code, comments, or formatting, and don't refactor things that aren't broken. Match the existing style even if you would do it differently. If you notice unrelated dead code, mention it — don't delete it. Remove only the imports, variables, and functions that YOUR changes made unused; leave pre-existing dead code unless asked. Every changed line should trace directly to the request.
@@ -67,4 +51,4 @@ Turn tasks into verifiable success criteria and loop until they are met: "add va
0 commit comments