
claude-webcache
io.github.theYahia由 GitHub 账号 theYahia 发布v0.1.5更新于 Oct 24, 2026
Cross-session WebFetch cache for Claude Code. Unlimited TTL by default, SQLite, MCP plugin.
发布方自己的服务:Claude Platform Docs
概览
为 Claude Code 的 WebFetch 与 WebSearch 结果提供本地 SQLite 缓存,跨会话持久保存,让助手复用已抓取页面而无需重复请求。
- 可以做什么
- 按 URL 与提示词读取缓存的页面文本,或按查询读取缓存的搜索结果,未命中时返回缓存未命中标记
- 将 URL、提示词与输出写入缓存,并可批量预检一组 URL
- 查看缓存统计、最近 URL 与按命名空间的明细,并使单条记录失效或刷新
- 按时间清理条目或整体清空缓存,并批量预热或刷新条目
- 通过命令行工具或本地网页仪表盘执行同样的操作
- 适用场景
- 适合在多个 Claude Code 会话中反复查阅同一批文档或网页、希望避免重复网络请求及其开销的场景。更适合内容稳定的页面;搜索排名与个性化页面变化较快。
- 运行要求
- 作为本地进程在用户机器上运行,可通过 npm 包或 Claude Code 插件安装。需要 Node.js 22.5 或更高版本,因为使用内置的 node:sqlite 模块。数据保存在用户主目录下的本地 SQLite 文件中。可选行为由 WEBCACHE_TTL_DAYS、WEBCACHE_NAMESPACE、WEBCACHE_AUTOREAD 等环境变量控制。
安装
在 SourceWeft 中
- 打开 控制台中的 claude-webcache,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
claude-webcache
[npm] [npm downloads] [license] [tests]
Persistent cross-session WebFetch cache for Claude Code. Cached reads in ~0.07ms — orders of magnitude faster than re-fetching.
Claude Code's built-in cache lasts 15 minutes, within one session. Every new session re-fetches from scratch. claude-webcache persists results across sessions in a local SQLite database — instant cache hits, zero network cost.
v0.1.5+: every WebFetch is automatically saved via PostToolUse hook — nothing to configure.
[CACHE_MISS flow: WebFetch + cache_store in first session] [CACHE_HIT flow: instant hit, no WebFetch in second session]
Install
Works in: Claude Code CLI · Desktop (Mac/Windows) · VS Code extension · JetBrains plugin — same command everywhere.
Done. Every WebFetch is auto-cached from now on.
Optionally add the usage pattern to ~/.claude/CLAUDE.md to also check the cache before fetching (saves the WebFetch call entirely on repeat URLs).
Plugin TUI not working? There's an open Claude Code bug (#41653) where
/plugin installrejects third-party sources with "source type not supported." Use the CLI command above — it bypasses the TUI and works fine.Fallback (no marketplace):
Option 2 — npm global
Requires Node.js 22.5+ (uses built-in node:sqlite — no native deps, no install step).
Then register in ~/.claude/settings.json (replace path with output of npm root -g):
Option 3 — clone (contributors)
See CONTRIBUTING.md.
Usage pattern (optional — for pre-fetch cache checks)
v0.1.5+ auto-caches every WebFetch automatically. The pattern below is optional: add it to ~/.claude/CLAUDE.md to also check the cache before making a WebFetch — this saves the WebFetch call entirely on repeat URLs.
Auto-read (v0.5+): nothing to do. A PreToolUse hook checks the cache before every WebFetch/WebSearch. On a hit it serves the cached copy and skips the network; on a miss the call runs normally and the PostToolUse hook stores the result. Same URL + same prompt (or same search query) in any future session = instant hit, zero network cost.
Manual lookup is still available if you want it: call cached_fetch(url, prompt) (or cached_search(query)) — returns the cached text, or [CACHE_MISS] … if absent. Disable auto-read with WEBCACHE_AUTOREAD=0.
⚠ Security — authenticated URLs
The cache stores the URL alongside the response in ~/.webcache/cache.db. By default, claude-webcache strips obvious credentials from the stored URL before write (user:pass@host and query params named token, api_key, apikey, access_token, auth, secret, password, key, signature, etc.).
That's display-level redaction, not key-level. The cache key still hashes the original URL, so re-fetching the same authenticated URL hits the cache. If you want a stricter trade-off:
With WEBCACHE_STRICT_REDACT=1, the cache key is computed from the redacted URL too — endpoints differing only in ?token=A vs ?token=B collide in one slot. Safe for pass-through auth (identical content), unsafe for personalized endpoints (different users see each other's cached data).
Bottom line: prefer header-based auth (Authorization: headers) over URL-embedded tokens. Don't commit ~/.webcache/cache.db to git.
Namespaces
Multiple projects sharing one machine? Isolate per-project caches:
Default namespace is the empty string "" (shared cache for v0.3 behavior). Inspect/manage per-namespace via CLI: claude-webcache namespaces, claude-webcache --namespace gosdelo stats.
Tools (MCP)
CLI
The npm package ships a claude-webcache binary for ad-hoc inspection and a local web dashboard:
The dashboard renders top URLs by hits, top domains (with avg hits / last fetch / entry counts), full search-able paginated list with one-click invalidate + refresh buttons. Pure stdlib — no extra deps to install.
Configuration (env vars)
SessionStart hook
Every new session injects a one-liner so Claude knows the cache exists:
No output if cache is empty. [ns=...] is omitted when using the default namespace.
Storage
SQLite at ~/.webcache/cache.db (WAL mode, synchronous=NORMAL, busy_timeout=5000).
Cache key = SHA256(namespace + "|" + canonical(url) + "|" + prompt). Default TTL: unlimited (set WEBCACHE_TTL_DAYS=N for N-day expiry).
URL canonicalization (v0.4+): lowercase hostname, strip default ports (:80/:443), strip fragment, sort query parameters alphabetically. So https://EXAMPLE.com/p?b=2&a=1#frag and https://example.com/p?a=1&b=2 produce the same cache key — no silent miss on URL formatting variance.
Concurrent-safe via WAL + 5-second busy_timeout — multiple Claude Code sessions can read/write simultaneously without SQLITE_BUSY errors.
Limits
- Cache key includes the prompt — use consistent prompts to maximize hit rate.
- Output is whatever WebFetch returns (already summarized). No re-processing.
- No semantic search. Exact
(namespace, canonical_url, prompt)match only.
Benchmarks
Single-process latency on a populated DB (N=10000 entries, 1KB output each), measured via npm run bench:
Storage overhead: ~2 KB per entry for a 1 KB payload (key + indexes + WAL + new v0.4 columns). With WEBCACHE_COMPRESS=1 on text-heavy responses, expect 3-7× reduction.
WebFetch over the network typically takes 1-5 seconds — a cached hit is ~15,000-70,000× faster. Reproduce on your hardware: npm run bench. See bench/README.md for methodology and full results metadata (CPU, RAM, OS, commit) saved per run.
Related
- claude-mem — persistent memory across sessions (complements claude-webcache: memory vs. web cache)
- WWmcp — catalog of 46 MCP servers for non-Western APIs
License
MIT — see LICENSE.
来源:README.md,提交 58d6198
工具
0版本历史
1- v0.1.5最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Claude 集成
Claude Platform Docs
com.claude.platform官方发布者
远程 MCP 服务器,让助手搜索并阅读 Claude 平台文档与 API 参考。

Insta Edits for Claude
由 GitHub 账号 faisalkhanzemi 发布
把 Claude Code 连接到 Mac 版 Instagram Edits,同步完整的 274 个工具编辑器,让助手剪辑 Reels。

Claude Checkpoint Mcp
由 GitHub 账号 daniel-munoz 发布
本地 MCP 服务器,把 Claude Code 会话的工作状态保存为项目内的 JSON 文件,并能还原成简短的续接摘要。

Qwen DAP MCP — C/C++ Debugger for Claude Code, Codex & Qwen
由 GitHub 账号 spk-c 发布
通过 GDB、LLDB 和 MCP 为 Claude Code、Codex 和 Qwen 提供 C/C++ 崩溃、挂起和转储调试AI 翻译

AVE for Claude Code — Local Video Editing
由 GitHub 账号 lemberalla 发布
仅适用于 Claude Code 的本地 AVE 时间线编辑与导出。需要现有 AVE 连接。AI 翻译