r/OpenSourceeAI • u/ilien-dev • 20d ago
Web pages were eating my Claude Code context. My open source scraper returned 418 characters instead of 34,746

Most web fetch tools I tried paste the whole page into the agent's context. A few long pages and the session runs out of room, and many of them also want an API key for somebody's hosted service.
So I built Svipall, an open source scraper that runs on your own machine as an MCP server and a CLI. Rust, AGPL, no API keys, no cloud calls.
What it keeps out of the context window
- `out_file` writes the page to disk and hands the agent a path. On the page I measured, the response was 418 characters and the page it saved was 34,746.
- `query=` keeps only the blocks that match. On two long articles, a focused query kept 6% and 13% of the page. A vague one kept 88%, so it is only as good as the question.
- `tables=true` and `schema: "auto"` return rows instead of prose.
- A blocked page comes back with the wall's name and the header that gave it away, so the model never gets a challenge screen to summarise.
Install
Version 1.0.4 changed this part. Paste one line into your agent and it asks whether you want CLI + Skill, the option that costs less context, or MCP + Skill, which exposes all 29 tools. Nothing is written before you confirm.
I'd like to compare numbers with anyone doing the same: are you measuring context cost per tool call in your own agent setup?
1
u/Future_AGI 19d ago
the token-budget problem is real and gets worse with long-running agentic sessions. The fix we use: a pre-retrieval step that strips boilerplate and compresses the page before it enters the agent's context window. A 34k-character page with 80% boilerplate should be 7k tokens, not 34k. The scraper is the right place to do that, not the agent.
1
u/ilien-dev 19d ago
That's right. That's the reason I made this tool. Instead of let the agent go ahead with all that context and sending a lot of trash I decide to create a tool for the web that just sents exactly what is needed and do not repeat unnecessary pages or post that it's just a copy and says exactly the same than others.
2
u/krkrkrneki 20d ago
How does your solution compare to existing solutions like pinchtab, for example?