claude-code
Micro-CLI oc cuts a 6-page browse to 1,936 tokens
Claude News
claude-codeA command line tool called oc turns a web page into a compact numbered view for coding agents, cutting a six-page browsing run to 1,936 tokens. The benchmark, published in the project's Github repository, puts Jina Reader at 16,402 tokens and a raw HTML fetch at 177,685 on the same pages.
At a glance
- Instead of raw markup or a screenshot, oc open prints a numbered index of a page's links and text regions, with an actions line teaching the agent the commands do, read, next and raw.
- oc was the only method in the maintainer's test that returned real content on all six pages: Jina Reader was blocked on the Reddit page, the raw fetch on the search page.
- Requests impersonate Chrome through impers and fall back to native fetch, which lets the tool reach pages that refuse naive fetchers without a headless browser, a daemon or per-site adapters.
Context is the binding constraint on long agent runs, and web pages are among the most expensive things an agent can pull into one. A tool that keeps a browsing step in the hundreds of tokens rather than the tens of thousands changes what an agent can afford to look at inside a single session. The design also reads as a bet against headless browsing: cheaper and simpler, but bounded by whatever the server already renders.
A default budget of 500 tokens governs what oc prints
oc open renders a page against a token budget set by --budget, which defaults to 500. The budget is a target rather than a hard cap: a page that would run only slightly long is printed whole, on the reasoning that one extra tool call costs more than the tokens a cut would save.
Pages that exceed the budget state what was left out, and oc find, oc read and oc next retrieve the rest without refetching. A read returns the full text of one numbered region, up to 2000 tokens. Each session stores its rendered page in a JSON file under ~/.only-cli, overridable with OC_HOME, so oc do 3 follows link [3] without the agent ever handling a URL.
Tuned shortcuts cover ten sites, including X and Stack Overflow
Beyond generic static pages, the repository ships shortcuts for ten domains: Hacker News, Reddit through old.reddit.com, GitHub, X, LinkedIn, DuckDuckGo, Bing, Stack Overflow through its Atom feeds, Yahoo Finance and YouTube. Each exposes its own verbs, such as sub, post and search on Reddit, or quote, gainers and losers on Yahoo Finance.
Three of them, X, Stack Overflow and YouTube, read pages that look login-gated or JavaScript-only from the outside by locating server-rendered HTML, feeds or inline data the page already ships without a login. LinkedIn coverage is limited to public guest views, with profile, company and jobs queries. Requests for additional sites go through pull requests or issues.
Installation runs through npm and requires Node 20 or newer
The tool installs globally with npm install -g @only-cli/oc and requires Node 20 or newer. A global install is not mandatory: npx @only-cli/oc runs directly, and the tool documents itself through --help and the actions line printed on every render.
Integration can be a single line in an agent's instructions file, CLAUDE.md or AGENTS.md, telling it to run npx @only-cli/oc open on a URL instead of fetching raw HTML. Claude Code users can instead copy skills/only-cli/ into .claude/skills/, or run npx skills add only-cli/oc, which also covers Cursor, Codex, Copilot and others via skills.sh. The project is MIT-licensed.
What v0.2 and v0.3 add
v0.1 covers static pages, budget-aware rendering, sessions and the do, find, read and next actions, while fill, submit and back are slated for v0.2 and a lazy headless fallback for script-heavy pages for v0.3. No release dates are given for either. The known limits stand: no JavaScript rendering, no login-gated sites, and pages behind hard bot challenges may still refuse the tool.
Comments
No comments yet. Be the first.
Join the conversation
Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.
We only use your name and avatar from Google. We never store your email address.
