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
Copy file name to clipboardExpand all lines: packages/agent/src/adapters/claude/session/instructions.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,12 @@ When working in a detached HEAD state, create a descriptive branch name based on
6
6
When creating a new branch, prefix it with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`).
7
7
`;
8
8
9
+
constPULL_REQUEST_LINKS=`
10
+
# Pull Request Links
11
+
12
+
When you mention a pull request in any reply or summary, always hyperlink it to its full URL (e.g. a Markdown link like [#123](https://github.com/org/repo/pull/123)) rather than plain text, so readers can open it directly.
13
+
`;
14
+
9
15
constPLAN_MODE=`
10
16
# Plan Mode
11
17
@@ -26,4 +32,5 @@ If an MCP tool call is explicitly denied with a message, relay that denial messa
26
32
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.
Copy file name to clipboardExpand all lines: packages/agent/src/server/agent-server.ts
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2659,6 +2659,12 @@ we want:
2659
2659
Generated-By: PostHog Code
2660
2660
Task-Id: ${taskId}`;
2661
2661
2662
+
constprLinkInstructions=`
2663
+
## Referencing pull requests
2664
+
When you mention a pull request in any reply or summary, always hyperlink it to its full URL
2665
+
(e.g. a Markdown link like [#123](https://github.com/org/repo/pull/123)) rather than plain
2666
+
text, so readers can open it directly.`;
2667
+
2662
2668
constwhyContextInstruction=` - Add a brief **Why** to the body — one or two sentences capturing the reason the user asked for this change (the motivation, not a restatement of the diff). Keep it short.`;
2663
2669
constpublicRepoSafetyInstruction=` - **Public-repo safety.** Treat the target repository as public-readable unless you have verified otherwise. The PR title, description, and commit messages must not contain private operational scale (exact event counts, internal row volumes, customer-usage percentages), customer names / emails / companies, references to internal tickets or incidents, the contents of Slack threads (do not quote or paraphrase what was said), or unreleased roadmap details. Linking to the originating Slack thread is fine and encouraged — Slack links are auth-gated and useful as context — as are channel references like "raised in #team-foo". Describe findings qualitatively ("present on nearly all X events, absent from Y") rather than with quantitative figures pulled from analytics queries — the reasoning that uses those numbers can stay in the thread; the PR copy cannot.`;
2664
2670
// Slack- and inbox-originated PRs are attributed to PostHog, not the
@@ -2685,7 +2691,7 @@ Do the requested work, but stop with local changes ready for review.
2685
2691
Important:
2686
2692
- Do NOT create new commits, push to the branch, or update the pull request unless the user explicitly asks.
2687
2693
- Do NOT create a new branch or a new pull request.
2688
-
${signedCommitInstructions}
2694
+
${signedCommitInstructions}${prLinkInstructions}
2689
2695
`;
2690
2696
}
2691
2697
@@ -2706,7 +2712,7 @@ After completing the requested changes:
2706
2712
Important:
2707
2713
- Do NOT create a new branch or a new pull request.
2708
2714
- Do NOT push fixes for review comments without replying to and resolving each related thread.
2709
-
${signedCommitInstructions}
2715
+
${signedCommitInstructions}${prLinkInstructions}
2710
2716
`;
2711
2717
}
2712
2718
@@ -2745,7 +2751,7 @@ ${publishInstructions}
2745
2751
2746
2752
Important:
2747
2753
- Prefer using MCP tools to answer questions with real data over giving generic advice.
2748
-
${signedCommitInstructions}
2754
+
${signedCommitInstructions}${prLinkInstructions}
2749
2755
`;
2750
2756
}
2751
2757
@@ -2757,7 +2763,7 @@ Do the requested work, but stop with local changes ready for review.
2757
2763
2758
2764
Important:
2759
2765
- Do NOT create a branch, commit, push, or open a pull request unless the user explicitly asks.
2760
-
${signedCommitInstructions}
2766
+
${signedCommitInstructions}${prLinkInstructions}
2761
2767
`;
2762
2768
}
2763
2769
@@ -2784,7 +2790,7 @@ ${prFooter}
2784
2790
2785
2791
Important:
2786
2792
- Always create the PR as a draft. Do not ask for confirmation.
Copy file name to clipboardExpand all lines: packages/workspace-server/src/services/agent/agent.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -603,7 +603,9 @@ When creating pull requests, add the following footer at the end of the PR descr
603
603
\`\`\`
604
604
---
605
605
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*
606
-
\`\`\``;
606
+
\`\`\`
607
+
608
+
When you mention a pull request in any reply or summary, always hyperlink it to its full URL (e.g. a Markdown link like [#123](https://github.com/org/repo/pull/123)) rather than plain text, so readers can open it directly.`;
0 commit comments