Grep/Glob tools become unavailable for entire session (incl. subagents) after early /model switch

Open 💬 1 comment Opened Jul 1, 2026 by mhchoi26

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

  1. Start a new Claude Code session.
  2. Run /model early in the session to switch model and/or effort level (observed with a switch to Sonnet 5 at max effort, run as essentially the first action in the session).
  3. Ask Claude to search file contents or list files by pattern.
  4. Observe that Grep/Glob are not available (not in the initial tool list, not discoverable via ToolSearch), and Claude/subagents fall back to Bash for 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.json still lists "Grep" and "Glob" under permissions.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 PreToolUse hook that redirects raw Bash ls/grep/find calls toward Grep/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 via Bash fallbacks (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)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗