# Bash, WebFetch and WebSearch

> The Claude Code tools that run shell commands, watch output, open a web page and search the web. Their time limits, and what each one returns.

**Course:** [Claude Code Basics](https://learn.benibix.com/learn/ai-claude-code)  
**Time:** 10 min

**After this lesson you can:**

- Say how long a Bash command may run
- Explain why WebFetch returns an answer, not a page
- Tell WebFetch and WebSearch apart

## How Claude runs commands and reads the web

The Bash tool runs shell commands on your computer, such as tests, builds and git. A command stops after two minutes by default, and Claude can ask for up to ten. Long jobs, like a dev server, can run in the background instead. Bash asks before it runs, unless a rule or your mode allows that command.

Each command runs in its own shell. A change of folder with cd carries over to the next command while it stays in your project. A variable you export does not carry over. So a command that needs a setting must set it again, or the setting must be in place before you start Claude Code.

On Windows, the PowerShell tool runs PowerShell commands as they are, not through Git Bash. On Linux and macOS you have to switch it on. It needs version 7 or later. On Windows, a rule that blocks Bash also shuts the PowerShell tool off for the session.

The Monitor tool runs a command in the background and sends each new line of output to Claude as it shows up. Claude can watch a log or a CI job and act when something happens. Each watch ends after five minutes by default, and at most thirty. It asks before it runs, like Bash.

WebFetch opens one web page and turns it into text. Then a separate model call reads the page with a short question, and Claude gets that answer, not the whole page. So a reply that says the page does not mention something may only mean the question did not ask. It reads up to 100,000 characters and keeps each page for 15 minutes.

WebSearch searches the web and returns the titles and links of the results. It does not open the pages. To read one, Claude follows up with WebFetch. A session in the terminal can make up to 200 searches. WebFetch will not open localhost, so for a local server Claude uses curl through Bash.

```json
{
  "permissions": {
    "allow": ["Bash(npm run *)", "WebFetch(domain:docs.python.org)"],
    "deny": ["WebSearch"]
  }
}
```
Any npm script runs without asking, one docs site can be fetched, and searching is off.

![Bash runs a command and hands back the whole output once it ends. Monitor runs in the background and sends line 1, line 2 and line 3 to Claude one at a time, and Claude acts on what comes back.](https://learn.benibix.com/diagrams/ct-shell-tools.svg)

### Example: Jack lets Monitor watch the deploy

Jack's deploy log prints a line every few seconds for about 4 minutes. He asks Claude to watch it and tell him if an error shows up.

Claude starts Monitor on the log. At minute 3 a line says a health check failed, and Claude stops to show him before the rest rolls out.

**Words in this lesson:** [Bash Tool](https://learn.benibix.com/term/ai/bash-tool), [PowerShell Tool](https://learn.benibix.com/term/ai/powershell-tool), [Monitor Tool](https://learn.benibix.com/term/ai/monitor-tool), [WebFetch Tool](https://learn.benibix.com/term/ai/web-fetch-tool), [WebSearch Tool](https://learn.benibix.com/term/ai/web-search-tool)

**Question:** Claude says a docs page does not mention a setting. Why might that be wrong?

**Answer:** WebFetch returns a model's answer to a question, not the full page. WebFetch asks a question of the page and passes on only the answer. A narrow question can miss what is there. So ask it to fetch again with a sharper question.

---

Source: https://learn.benibix.com/learn/ai-claude-code/bash-webfetch-and-websearch
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-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
