Skip to content
BENIBIX Learn

CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION environment variable

It caps how many web searches one session can run.

Think of it like

It is like a cap on trips to the shop. One job gets only so many.

Example

Lucy's research job ran for hours and searched hundreds of times. She sets a cap of 50, and Claude writes up what it found when it hits it.

Why it matters

Searches cost money and time. A cap stops a long job from searching without end.

Definition

CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION caps how many web searches Claude can run in one session. The default is 200. At the cap, a search returns a note telling Claude to go on with what it has and to say so. You can raise it, but not turn it off. It needs version 2.1.212 or later.

Example code

bash
export CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION=50
claude
Allow 50 searches per session.

Common mistake

Setting 0 to stop all searches. That is ignored. Deny the web search tool instead.

Key takeaways

  1. 1
    Default 200. Per session.
  2. 2
    At the cap. Claude wraps up.
  3. 3
    Raise, not remove. 0 is ignored.