Skip to content

Commit 555dbd3

Browse files
committed
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
1 parent 96cbd15 commit 555dbd3

1 file changed

Lines changed: 5 additions & 21 deletions

File tree

packages/agent/src/adapters/claude/session/instructions.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,6 @@ If an MCP tool call is explicitly denied with a message, relay that denial messa
2626
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.
2727
`;
2828

29-
// Always-on minimalism, adapted from Ponytail (https://github.com/DietrichGebert/ponytail, MIT).
30-
const MINIMAL_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-
4929
// Behavioral guidelines adapted from the Karpathy guidelines
5030
// (https://github.com/multica-ai/andrej-karpathy-skills, MIT).
5131
const WORKING_DISCIPLINE = `
@@ -57,6 +37,10 @@ These bias toward caution over speed; for trivial tasks, use judgment.
5737
5838
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.
5939
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+
6044
## Make surgical changes
6145
6246
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
6751
`;
6852

6953
export const APPENDED_INSTRUCTIONS =
70-
BRANCH_NAMING + PLAN_MODE + MCP_TOOLS + MINIMAL_CODE + WORKING_DISCIPLINE;
54+
BRANCH_NAMING + PLAN_MODE + MCP_TOOLS + WORKING_DISCIPLINE;

0 commit comments

Comments
 (0)