Skip to content

Commit 9efcb25

Browse files
committed
feat(agent): add shell efficiency section to appended instructions
Nudges the model to batch sequential shell commands with && and emit independent tool calls in one response, cutting full-context round trips. Generated-By: PostHog Code Task-Id: 2e63ca05-ef07-4251-9348-687a07ecfa93
1 parent df9a4cc commit 9efcb25

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,16 @@ 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-
export const APPENDED_INSTRUCTIONS = BRANCH_NAMING + PLAN_MODE + MCP_TOOLS;
29+
const SHELL_EFFICIENCY = `
30+
# Shell Efficiency
31+
32+
Optimize for the fewest shell round trips.
33+
34+
- Batch related commands into one Bash invocation using \`&&\`.
35+
- Emit all independent tool calls in the same response.
36+
- Read multiple files at once.
37+
- Never rerun a command solely to reproduce output you already have.
38+
`;
39+
40+
export const APPENDED_INSTRUCTIONS =
41+
BRANCH_NAMING + PLAN_MODE + MCP_TOOLS + SHELL_EFFICIENCY;

0 commit comments

Comments
 (0)