Grep/Glob tools become unavailable for entire session (incl. subagents) after early /model switch
Description
In a session where /model is used to switch model/effort level early on, the built-in Grep and Glob tools become completely unavailable for the rest of that session — not just hidden from the initial tool list, but absent even from lazy/deferred tool discovery (a ToolSearch exact-name lookup for Grep/Glob returns no matches). Only Read remains as a file-access tool; all pattern/file search has to fall back to Bash (grep/find/rg/fd).
This also propagates to subagents spawned via the Agent/Task tool within the affected session — verified directly by prompting two different subagent types to introspect and test their own tool access; both confirmed no Grep/Glob tools and had to fall back to Bash.
Steps to reproduce
- Start a new Claude Code session.
- Run
/modelearly in the session to switch model and/or effort level (observed with a switch to Sonnet 5 atmaxeffort, run as essentially the first action in the session). - Ask Claude to search file contents or list files by pattern.
- Observe that
Grep/Globare not available (not in the initial tool list, not discoverable viaToolSearch), and Claude/subagents fall back toBashfor search instead.
Expected behavior
Grep and Glob remain available for the session regardless of /model usage.
Actual behavior
Grep and Glob are entirely absent from the tool registry for the rest of the affected session. A separate, freshly-started session (without an early /model switch) has both tools working normally, so this appears to be a session-scoped tool-registration issue rather than a permanent removal. Working theory (unconfirmed): switching model/effort shortly after session start interferes with tool-manifest initialization.
Additional context
~/.claude/settings.jsonstill lists"Grep"and"Glob"underpermissions.allow, so this isn't a permissions/config problem — the tools simply aren't registered.- The gap is silent: no error surfaces when the tools are missing; they just aren't present. This made it hard to notice until a permission-prompt-volume investigation surfaced it.
- Impact: setups with a custom
PreToolUsehook that redirects rawBashls/grep/findcalls towardGrep/Glob(a commonly recommended pattern for reducing permission-prompt noise) get redirected toward tools that don't exist in the affected session, forcing extra retries viaBashfallbacks (rg/fd).
Environment
- Claude Code version: 2.1.197
- OS: Ubuntu 22.04 (Linux 6.8.0-124-generic)
- Model: Sonnet 5 (claude-sonnet-5)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗