feat: block work tools without active delegation#50
Open
barkain wants to merge 3 commits into
Open
Conversation
Scoped to 7 WORK_TOOLS only — Agent, Skill, TaskCreate etc. always pass. Subagents and active delegations bypass. 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? |
Subagents saw the stub and tried to delegate instead of doing work. The blocking hook already bypasses subagents, but the injected instructions were still telling them to delegate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The flag was referenced by require_delegation.py to bypass blocking for active delegations, but no code ever created it — the creation logic was removed in v2.0.0. Now created in the PostToolUse hook that already detects delegate invocations. 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
require_delegation.pyreturns exit 2 (block) for the 7 WORK_TOOLS when no delegation is activedelegation_activeflag bypasses (main agent steering subagents)Why
Plugin
additionalContextdoesn't carry CLAUDE.md authority — the model ignores soft nudges and calls work tools directly. Blocking is the only reliable enforcement mechanism available to plugins.Test plan
ccw --plugin-dir ~/dev/claude-code-workflow-orchestration→ "add a hello world script" → should block Write and prompt delegation🤖 Generated with Claude Code