Bash, WebFetch and WebSearch
Level 4 · The tools it uses
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 contentsLesson 10 of 16
Level 1 · Starting out
Level 2 · Asking before it acts
Level 3 · Telling it how you work
Level 4 · The tools it uses
Level 5 · Growing past one chat
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
10 mincovers 5 glossary entries
Worth reading first: Claude Code File Tools
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.
{
"permissions": {
"allow": ["Bash(npm run *)", "WebFetch(domain:docs.python.org)"],
"deny": ["WebSearch"]
}
}Worked 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.
The words for this lesson5
Check yourself
Claude says a docs page does not mention a setting. Why might that be wrong?
Finished this lesson?
Marking it complete also marks its 5 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.