web-fetch
Skill4 starsChanged 7 months agoMITView on GitHub
Fetch a URL and save the body to a temp file so you can pipe it through rg / jq / awk instead of dumping the whole page into the conversation. Use this whenever a user gives you a URL to read - articles, docs, PRs, gists, README files, blog posts, anything HTTP. Returns a path on disk; the agent then greps the path for the relevant section and quotes only what matters. Strongly preferred over the built-in webfetch tool when (a) the page is more than a few KB, (b) the user wants to find a specific phrase / table / code block on the page, (c) you need to keep the long page out of context, or (d) you want to inspect raw HTML alongside rendered markdown. Triggers: 'fetch', 'fetch this URL', 'fetch and save', 'fetch the page', 'pull this', 'grab this article', 'read this URL', 'read the docs at', 'mirror this page', 'page is too long', 'save the page so I can grep it', 'put it on disk so I can rg', 'cache this URL'.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- titouannwtt/claude-toolstheir own version, first seen Nov 15, 2026
- tonyfettes/skillstheir own version, first seen Nov 8, 2026
- Mathews-Tom/armorytheir own version, first seen Nov 1, 2026
- runxhq/runxtheir own version, first seen Oct 13, 2026
- superbereza/lobster-powerstheir own version, first seen Oct 11, 2026
- jholhewres/devclaw-skillstheir own version, first seen Oct 9, 2026
Used with
Projects with it also use github and skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
NVIDIASkillgithub
Interact with GitHub using the gh CLI restricted to REST API only (no GraphQL). Use when the user wants to work with GitHub issues, pull requests, repos, releases, or Actions — especially in sandboxed environments where the GraphQL endpoint may be blocked. Trigger keywords - github, gh, pull request, PR, github issue, github actions, workflow, release, gh api.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 4 projects that use this
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- Mathews-Tom/armory★ 340same name
- Lingyuzhou111/dow-ipad-859★ 260same name
- runxhq/runx★ 97same name
- archibate/agent-skills★ 19same name
- jholhewres/devclaw-skills★ 4same name
- smart-lty/my-skills★ 4same name
- seven-steven/skills★ 1same name
- Throokie/claude-code-skills★ 1same name
- titouannwtt/claude-tools★ 1same name
- tonyfettes/skills★ 1same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If the URL is https://example.com and you only need 3 lines, the built-in tool is fine.
- Distinctive: line 116
Every successful fetch produces this metadata:
- Distinctive: line 149
If both attempts fail, the script exits with code 2 and the trace records both attempts so you can see exactly why.
- Distinctive: line 156
Public HTTP/HTTPS only: No file://, no localhost shortcuts, no credentials in the URL.
- Very specific: line 157
No JS rendering: If the page needs a real browser to populate content, you will get the unhydrated shell.
- Distinctive: line 162
Always mention the path: When you tell the user "I fetched X", also mention where it is on disk so they can grep it themselves.
- Very specific: line 163
Pipe before reading: When the user asks a specific question about the page, run rg / jq / awk against the saved path and quote only …
- Very specific: line 164
Trace is machine-readable: If a fetch fails, surface the per-attempt error from trace.json, do not blindly retry the same URL with the same …
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
web-fetch
Fetch a URL, write the body to $TMPDIR/web-fetch-<runid>/, print the path. Pipe the path through rg / jq / awk to surgically extract what you need.
Why this skill exists
The built-in webfetch tool dumps the whole rendered page into the conversation. For anything bigger than a few KB that drowns the context window. The fix is dead simple: write the page to disk, then grep it.
That is all this skill does. One curl call, one Cloudflare-aware retry, HTML → Markdown via stdlib, save to a temp dir, print the path. No providers, no fallback chain, no fancy machinery. The same shape as pi-webfetch and opencode/webfetch, but as a standalone skill that works from any agent (Claude Code, OpenCode, pi, hermes, openclaw, whatever speaks Bash).
When to use it
Trigger this skill any time the user hands you a URL and the goal is to read its content. Examples:
- "Fetch https://docs.python.org/3/library/asyncio.html and tell me about TaskGroup."
- "Read the README at https://github.com/anthropics/anthropic-sdk-python."
- "What does this article say about
<topic>?<URL>" - "Pull
<PR url>, what's the key change?" - "Fetch the page and pull out only the deprecated section."
If the URL is https://example.com and you only need 3 lines, the built-in tool is fine. Use this skill when the page is non-trivially large or you want to filter before reading.
How to invoke it
The script is at scripts/web_fetch.py. It needs python3 (3.9+) and ideally curl (auto-detected; urllib fallback works too).
Basic fetch (markdown is default)
python3 <skill_dir>/scripts/web_fetch.py https://docs.python.org/3/library/asyncio.htmlStdout prints two lines:
/tmp/web-fetch-20260501-171120-abc123/result.md
/tmp/web-fetch-20260501-171120-abc123/result.jsonresult.md is the converted markdown. result.json is the same content plus a _meta envelope.
Pick format
python3 web_fetch.py https://example.com --format markdown # default; HTML auto-converted
python3 web_fetch.py https://example.com --format text # tags stripped, entities decoded
python3 web_fetch.py https://example.com --format html # original HTML untouched
python3 web_fetch.py https://example.com --format raw # bytes-as-they-came (no conversion)Other flags
| Flag | Default | Purpose |
--timeout SEC | 30 (cap 120) | Per-request timeout |
--output-dir PATH | $TMPDIR/web-fetch-<runid> | Custom output dir for stable paths |
--print-path {all,content,json} | all | What to print on stdout |
--print-content | off | Also dump rendered content to stdout (for direct piping) |
--use-curl / --use-urllib | auto | Force the HTTP transport |
--quiet / --verbose | off | Trace verbosity |
The pipe-and-grep pattern
This is the whole point. Resist the temptation to read the entire result.md. Use the path:
# Capture the content path
CONTENT=$(python3 web_fetch.py https://docs.python.org/3/library/asyncio.html --print-path content --quiet)
# Find the relevant section
rg -n "TaskGroup" "$CONTENT" | head -20
# Get N lines of context around a match
rg -B2 -A8 "asyncio.run" "$CONTENT" | head -40
# Multiple keywords
rg -in "deprecated|removed|since 3\.1[0-9]" "$CONTENT"
# Grab specific markdown sections (## or ### headings)
awk '/^## TaskGroup/,/^## /' "$CONTENT"For headers / metadata extraction:
JSON=$(python3 web_fetch.py https://example.com --print-path json --quiet)
jq -r '._meta.final_url, ._meta.content_type, ._meta.bytes' "$JSON"
jq -r '._meta.attempts[] | "\(.user_agent): \(.status) (\(.duration_ms)ms)"' "$JSON"For Windows PowerShell, see references/pipelines-windows.md.
What gets written
$TMPDIR/web-fetch-<runid>/
├── result.md rendered markdown (or .txt / .html depending on --format)
├── result.json { content, _meta }
├── trace.json _meta only (faster to inspect)
└── raw.html original response body (or raw.bin for non-text)Useful when:
- You want to compare rendered markdown against raw HTML (
diff result.md raw.html). - You want to keep the raw bytes around for forensic / replay use.
- You want the structured
_metaseparate from the content for cheap inspection.
The _meta envelope
Every successful fetch produces this metadata:
{
"version": "0.1.0",
"url": "https://docs.python.org/3/library/asyncio.html",
"format": "markdown",
"ok": true,
"http_status": 200,
"content_type": "text/html",
"final_url": "https://docs.python.org/3/library/asyncio.html",
"converted": true,
"bytes": 41023,
"raw_bytes": 198541,
"attempts": [
{"user_agent": "browser", "status": 200, "duration_ms": 187, "bytes": 198541,
"content_type": "text/html", "final_url": "...", "cf_challenge": false}
],
"duration_ms": 199,
"started_at": "2026-05-01T08:11:20.045449+00:00",
"raw_path": "/tmp/.../raw.html",
"content_path": "/tmp/.../result.md",
"output_dir": "/tmp/.../",
"transport": "curl"
}attempts[] shows the actual HTTP calls. If a Cloudflare challenge fired, you will see two entries (browser then honest). If you need to debug a fetch that "looks weird," dump this trace.
Cloudflare retry (built-in)
Some sites return HTTP 403 with a Cloudflare challenge page when called with a browser-like UA but a non-browser TLS fingerprint. The skill detects this case (status 403 or 503 plus body markers like <title>Just a moment...</title> or cf-mitigated) and retries once with a plain web-fetch/<version> UA. Some operators allow honest UAs through. This is the same trick pi-webfetch and opencode/webfetch use.
If both attempts fail, the script exits with code 2 and the trace records both attempts so you can see exactly why.
Limits
- 5 MB response cap. Anything larger is rejected (curl uses
--max-filesize; urllib reads N+1 then aborts). - 120 second timeout cap.
--timeoutlarger than this is silently clamped. - Read-only. This skill never modifies remote state; all calls are GET.
- Public HTTP/HTTPS only. No file://, no localhost shortcuts, no credentials in the URL.
- No JS rendering. If the page needs a real browser to populate content, you will get the unhydrated shell. For SPAs / aggressively dynamic content, use a headless-browser tool (
playwright,firecrawl, etc.) outside this skill.
Key invariants (do not break)
- Content lives on disk, not in the conversation. Quote what is relevant from the file. Never paste a full fetched body into your response unless the user explicitly asked for the full content.
- Always mention the path. When you tell the user "I fetched X", also mention where it is on disk so they can grep it themselves.
- Pipe before reading. When the user asks a specific question about the page, run
rg/jq/awkagainst the saved path and quote only matching lines. Do not pre-load the entire file. - Trace is machine-readable. If a fetch fails, surface the per-attempt error from
trace.json, do not blindly retry the same URL with the same args.
More
references/pipelines-posix.md- rg/jq/awk worked examples for macOS / Linux / WSL / Git Bash.references/pipelines-windows.md- PowerShell + cmd equivalents.references/compat.md- per-OS support matrix, Python/curl version floor, Windows / WSL / Alpine / RHEL 7 setup.references/troubleshooting.md- 403 / 429 / Cloudflare / TLS / proxy gotchas and how to read the trace.README.md- install, packaging, registration into pi/senpi/.agents/skills/, project structure.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

