Skip to content

Commit 6394e8e

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 4d568cc commit 6394e8e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,16 @@ If an MCP tool call is explicitly denied with a message, relay that denial messa
3232
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.
3333
`;
3434

35+
const SHELL_EFFICIENCY = `
36+
# Shell Efficiency
37+
38+
Optimize for the fewest shell round trips.
39+
40+
- Batch related commands into one Bash invocation using \`&&\` (e.g. \`npm run typecheck && npm run lint && npm test\`).
41+
- Emit all independent tool calls in the same response.
42+
- Read multiple files at once.
43+
- Never rerun a command solely to reproduce output you already have.
44+
`;
45+
3546
export const APPENDED_INSTRUCTIONS =
36-
BRANCH_NAMING + PULL_REQUEST_LINKS + PLAN_MODE + MCP_TOOLS;
47+
BRANCH_NAMING + PULL_REQUEST_LINKS + PLAN_MODE + MCP_TOOLS + SHELL_EFFICIENCY;

0 commit comments

Comments
 (0)