Make Claude Code WebFetch succeed on Cloudflare protected docs and blogs
Wire the SKILL.md flow into Codex or OpenCode for the same fallback
Add a custom domain allowlist before invoking CloakBrowser to control egress
Log every 403 retry as a hook event for later debugging
You must install CloakBrowser, point an env var at the right Python interpreter, and paste a JSON snippet into Claude Code settings before the hook fires.
cloakFetch is a small helper that fixes a specific annoyance for people using Claude Code, the command-line coding assistant from Anthropic. When Claude Code is asked to read a web page, it uses a built-in tool called WebFetch. Many websites sit behind Cloudflare or similar bot protection, and when a normal request hits one of those pages, the response that comes back is just an HTTP 403 Forbidden error. Claude then has nothing to read. The project routes those blocked requests through a different program called CloakBrowser, which is a real Chromium browser with patches at the C++ level that let it pass Cloudflare's JavaScript challenge. Once the page actually loads, the rendered HTML is handed to a Python library called trafilatura, which strips away the menus and ads and returns a clean Markdown version of the article. The Claude agent receives that Markdown and never has to know that the original fetch failed. cloakFetch offers two ways to switch this behavior on. The first is a PostToolUse hook for Claude Code. Claude Code's hook system lets you run a script after every tool call, so the bundled shell script watches WebFetch results, spots the 403 pattern, pulls the URL out of the payload, runs CloakBrowser on it, and feeds the rendered text back as additional context. This path is invisible to the agent and triggers automatically. The second path is a SKILL.md skill that works with agents like Codex, OpenCode, OpenClaw, and SkillsMP. In that mode the agent itself decides to invoke the skill after seeing a failed fetch. The same Python script does the actual browser work in both modes. The repository is organized into a hooks folder for the Claude Code path, a skills folder for the SKILL.md path, and a settings snippet that you paste into your Claude Code configuration. Installation involves copying or symlinking two files into a hooks directory, pointing an environment variable at a Python interpreter that has CloakBrowser installed, and adding a small block of JSON to settings.json. The README notes that successful fallbacks take around 25 to 40 seconds, while misses cost only milliseconds because the regex check skips the browser entirely.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.