feat: strengthen delegation enforcement via three-layer reinforcement#49
Open
barkain wants to merge 3 commits into
Open
feat: strengthen delegation enforcement via three-layer reinforcement#49barkain wants to merge 3 commits into
barkain wants to merge 3 commits into
Conversation
The soft nudge system was too weak — Claude would "forget" to delegate after the initial stub injection faded in context. Three non-blocking layers now reinforce delegation: 1. Stub rewrite: opens with BLOCKING REQUIREMENT (proven constraint pattern), cut from ~450 to ~167 words 2. Per-turn reminder: UserPromptSubmit emits one-line stderr treated as user speech (~14 tokens/turn, subagent-safe) 3. Structured output: PreToolUse violations now emit additionalContext via stdout JSON (surfaces in conversation, not just stderr logs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Nothing actually blocks — the phrasing implied technical enforcement that doesn't exist. MANDATORY is equally strong as a prompt directive without misrepresenting the mechanism. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BLOCKING REQUIREMENT(proven constraint pattern from Claude Code's own system prompt). Cut from ~450 words to ~167 words — shorter but stronger.UserPromptSubmithook now emits a one-line delegation reminder to stderr, which Claude Code wraps as<user-prompt-submit-hook>and treats as user speech. ~14 tokens/turn, subagent-safe.PreToolUseviolations now emitadditionalContextvia stdout JSON in addition to stderr. Surfaces the nudge in conversation context, not just as a side-channel log. Zero cost when compliant.Motivation
Since moving from hard-blocking hooks (v2.0.0) to soft stderr nudges, Claude frequently "forgets" to delegate — the ~200-token stub injected at session start gets buried as conversation grows, and stderr nudges after the fact aren't enough to prevent the first violation.
Test plan
🤖 Generated with Claude Code