# CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION

> It caps how many web searches one session can run.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION environment variable

## Think of it like

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

## 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

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.

## Example code

```bash
export CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION=50
claude
```

Allow 50 searches per session.

## Why it matters

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

## Common mistake

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

## Three principles

- **Default 200.** Per session.
- **At the cap.** Claude wraps up.
- **Raise, not remove.** 0 is ignored.

## Related terms

- [WebSearch Tool](https://learn.benibix.com/term/ai/web-search-tool)
- [CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS](https://learn.benibix.com/term/ai/claude-code-max-concurrent-subagents-variable)

---

Source: https://learn.benibix.com/term/ai/claude-code-max-web-searches-per-session-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
