Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions 0021-tool-scoping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@ with `claude --agent`.

| Mechanism | Parameterized? | `--agent` session | Subagent |
|-----------|---------------|-------------------|----------|
| `tools` in frontmatter | No | **No effect** | Restricts to listed tools |
| `disallowedTools` in frontmatter | No | **No effect** | Removes listed tools |
| `tools` in frontmatter | No | ~~**No effect**~~ see note | Restricts to listed tools |
| `disallowedTools` in frontmatter | No | ~~**No effect**~~ see note | Removes listed tools |
| `permissions.allow` in settings.json | **Yes** | **Enforced** (with `dontAsk`) | — |
| `permissions.deny` in settings.json | **Yes** | **Enforced** (even with `--dangerously-skip-permissions`) | — |
| `bypassPermissions` mode | N/A | **Partial** — auto-approves some tools, denies others | — |

> **Note (2026-07):** This experiment ran on v2.1.118. Claude Code
> v2.1.119, released 21 hours later, changed enforcement: `tools` and
> `disallowedTools` are now applied in `--agent`/`--print` sessions.
> However, multiple bugs make them unreliable — scoped patterns like
> `Bash(sed *)` strip the entire tool, and subagents don't inherit
> restrictions. See RCA (Root Cause Analysis)
> [#5182](https://github.com/fullsend-ai/fullsend/discussions/5182).

## 1. Frontmatter scoping (`tools`, `disallowedTools`)

`tools` and `disallowedTools` in agent frontmatter **have no effect in
`--agent` sessions**. They only work when the agent runs as a subagent
spawned via the Agent tool.
`tools` and `disallowedTools` in agent frontmatter ~~**have no effect in
`--agent` sessions**~~ see note. They only work when the agent runs as
a subagent spawned via the Agent tool.
Comment on lines +36 to +38

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Contradictory scoping claim 🐞 Bug ≡ Correctness

Section 1 now strikes the "no effect in --agent" claim but still states frontmatter
tools/disallowedTools "only work" for subagents, which conflicts with the new note stating
v2.1.119 applies them in --agent/--print sessions. This leaves the README giving contradictory
guidance about current behavior.
Agent Prompt
### Issue description
The README now says v2.1.119 applies `tools`/`disallowedTools` in `--agent`/`--print` sessions, but section 1 still contains an unconditional statement that these mechanisms "only work" for subagents. This is internally inconsistent.

### Issue Context
The PR introduces a dated note explaining post-v2.1.119 behavior, but the surrounding section 1 prose still reads like a universal statement rather than "v2.1.118-only" guidance.

### Fix Focus Areas
- 0021-tool-scoping/README.md[26-38]

### Suggested change
Rewrite the section-1 opening to explicitly scope the old behavior to v2.1.118 (or rewrite it to describe both behaviors), e.g.:
- "On v2.1.118, `tools`/`disallowedTools` have no effect in `--agent` sessions and only work for subagents." 
- "As of v2.1.119, they are applied in `--agent`/`--print` sessions (see note), but are unreliable; subagent behavior differs (see RCA)."

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


### `--agent` sessions: `tools` neither restricts nor grants

Expand Down Expand Up @@ -121,3 +129,9 @@ See [HOW_TO.md](HOW_TO.md).
- **Claude CLI version:** 2.1.118
- **Date:** 2026-04-23
- **OS:** Linux 6.19.11-200.fc43.x86_64 (Fedora 43)

> **Note (2026-07):** v2.1.119 was released on 2026-04-23 23:24 UTC —
> 21 hours after this experiment concluded. That release changed `tools`
> and `disallowedTools` enforcement in `--agent`/`--print` sessions.
> Results in section 1 are accurate for v2.1.118 but no longer reflect
> current behavior.
Loading