Skip to content

fix: decrease chance of claude ignoring hook instructions#105

Merged
scode merged 1 commit intomainfrom
remove-injection-framing
Mar 21, 2026
Merged

fix: decrease chance of claude ignoring hook instructions#105
scode merged 1 commit intomainfrom
remove-injection-framing

Conversation

@scode
Copy link
Copy Markdown
Owner

@scode scode commented Mar 21, 2026

I asked Claude why it didn't distill and it said it ignored the instructions because it looked like prompt injection.

Claude asserts that these changes will make the instructions look less adversarial.

changelog: include

Claude sometimes ignores SessionStart hook output because the wording
combines urgency, secrecy, and pre-emption — patterns that match prompt
injection signatures. Replace secrecy ("do not mention to user",
"silently") and pre-emption ("before responding to the user's first
message") with transparency-encouraging language ("let the user know",
"tell the user", "briefly mention to the user"). Keep "ACTION REQUIRED"
as the action signal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scode
Copy link
Copy Markdown
Owner Author

scode commented Mar 21, 2026

Stack Links

This PR is part of a stacked series:

This comment was autogenerated by stax

@scode scode marked this pull request as ready for review March 21, 2026 00:09
@scode scode changed the title fix: remove prompt-injection-like framing from agent instructions fix: decrease change of agent ignoring instructions from hooks Mar 21, 2026
@scode scode changed the title fix: decrease change of agent ignoring instructions from hooks fix: decrease chance of claude ignoring instructions from hooks Mar 21, 2026
@scode scode changed the title fix: decrease chance of claude ignoring instructions from hooks fix: decrease chance of claude ignoring hook instructions Mar 21, 2026
@scode scode merged commit 93e8f7b into main Mar 21, 2026
22 of 28 checks passed
@scode scode deleted the remove-injection-framing branch March 21, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant