Hacks and Limitations

Contents
  1. Delegation Is Instruction-Only and Not Guaranteed
  2. Agent Model and Effort Checks Are Unverified
  3. feature.enforceDelegation Can Block, Not Force
  4. PreToolUse Is Only Early Feedback
  5. See Also

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-go re-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 model and effort in tool_input under those names. Unverified; handle_pretool reads tool_input["model"] and tool_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.maxDenials ends the enforcement.
  • (c) Override of inherit: a model argument should override model: inherit of the agent named by subagent_type. Unverified. If it does not, the model in the agent file wins.
  • (d) Orchestrator route: under claude --agent specloop-orchestrator the main thread’s Agent calls should carry no agent_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 -i or > redirects) are not covered;
  • agent_type alone is not trusted, because it is also present in the main conversation of a session started with --agent; in-process teammates carry an agent_id and 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

View this page on GitHub