Documentation › Hacks and limitations
Delegation Is Instruction-Only and Not Guaranteed
Hooks cannot start subagents, so delegate: true only tells the main session to hand the phase to a subagent (see Delegating a phase). It may do the work itself anyway, for example after context compaction or when it judges the phase to be small. The gates still protect the result either way; only the fresh-context benefit is lost.
To remove the choice, start the session with claude --agent specloop-orchestrator: its tool list has no edit tools. This route is experimental; see The orchestrator agent route. For why the engine stays, see Native Claude Code features.
- How to notice: in a delegated phase, the main session reads source files, edits files or runs the tests itself instead of starting one subagent.
- How to recover: run
/sl-pause, then/clear, then/sl-go./sl-gore-sends the orchestrator instructions with the phase brief to a clean context.
Agent Model and Effort Checks Are Unverified
Agent model and effort depends on four Claude Code behaviors. A check with the claude CLI (2.1.325) in a sandbox project could not run: the CLI session was not logged in (“OAuth session expired”). All four are therefore unverified, and the code follows the documented names.
- (a) Input names: PreToolUse should receive the Agent tool’s
modelandeffortintool_inputunder those names. Unverified;handle_pretoolreadstool_input["model"]andtool_input["effort"]. - (b) Denial reason: a denied Agent call should reach Claude with its reason. Unverified. If it does not, Claude cannot learn the required settings, and
agents.maxDenialsends the enforcement. - (c) Override of
inherit: amodelargument should overridemodel: inheritof the agent named bysubagent_type. Unverified. If it does not, the model in the agent file wins. - (d) Orchestrator route: under
claude --agent specloop-orchestratorthe main thread’s Agent calls should carry noagent_id. Unverified; see The orchestrator agent route.
specloop cannot set the model of the main session. Only the subagents it starts get model and effort; the main session keeps the model the person chose.
feature.enforceDelegation Can Block, Not Force
This option is for sessions not started with --agent specloop-orchestrator (see The orchestrator agent route). Claude Code adds agent_id (and agent_type) to hook input when a tool call comes from inside a subagent, and leaves them out for the main conversation (hooks reference, “Common input fields”). With enforceDelegation: true, PreToolUse uses that to deny the main session’s Edit, Write, MultiEdit and NotebookEdit calls outside .claude/specloop/run/ in any delegated phase, and tells it to start a subagent. Subagent calls are never affected. Limits:
- it cannot make the main session start a subagent; it only stops it from editing source files itself;
- read-only phases such as review (and planning), which already edit only
run/, cannot be forced into a subagent at all: the main session can still read the code and write the review itself; - edits made through Bash (for example
sed -ior>redirects) are not covered; agent_typealone is not trusted, because it is also present in the main conversation of a session started with--agent; in-process teammates carry anagent_idand are treated like subagents.
PreToolUse Is Only Early Feedback
Claude Code’s own deny rules have a similar limit; see Native Claude Code features. PreToolUse sees tool calls, not what a command does. Its denials of edits to protected paths cover Edit, Write, MultiEdit and NotebookEdit only. They do not stop sed -i, > or a script run through Bash, and nothing in the hook can tell that such a command rewrites detekt.yml. The same holds for the denial of run.sh advance and run.sh quality accept: it matches the text of the Bash command, so a command that builds the call another way (a wrapper script, a variable, python engine.py) is not recognised. The disable-model-invocation: true setting of the command templates is the other half, and it only stops Claude from invoking the slash command.
Protection that matters therefore works when a gate runs: the engine compares the SHA-256 of every protected file and the quality block with the values stored at the first /sl-go, and scans added lines for forbid patterns, whatever tool made the change (see Protected files). The PreToolUse denials only tell Claude early, before it wastes an iteration. A person who runs /sl-quality accept or /sl-advance can always override them.
See Also
- Delegating a phase: the key row for
feature.enforceDelegationand the phase brief. - Native Claude Code features: the limits of native deny rules,
/goal, workflows and plugins. - Guard rails: the other PreToolUse rules, including the denials of protected paths and of the commands only the user may run.
- Quality gates: the fingerprint check that protects gate files whatever tool changes them.
- Several chats in one project: limits of running several chats in one checkout.