All blogs

Agentic Node ·

How we reduced Cursor’s token usage by 42–50% on two DeepSWE tasks

Happy DOM needed a fix for body reads left pending after an abort. ofetch needed a circuit breaker that tracked failures separately for each origin. Could Cursor solve both with less context to read?

Working principle

The Happy DOM turn used 49.9% fewer total tokens with agentic-node. The ofetch turn used 41.7% fewer.

Two tasks, four passing patches

Times cover the agent turn. Cursor reports total tokens including cache reads.

DeepSWE v1.1 paired runs
TaskStock Nodeagentic-nodeTurn time, stock / preloadTests passed in both
Happy DOM3,834,5991,920,95711:37 / 11:28179/179
ofetch1,471,544858,1388:24 / 6:5760/60

What changed between runs

We ran each DeepSWE v1.1 task twice with Cursor Auto Cost on Node.js 24.12.0. We kept the prompt, Docker image and search rule the same. The only setup change was loading agentic-node 0.3.0 for the second configuration. All four patches passed the original task verifiers.

What Cursor actually saw

The preload runs inside an existing Node.js process. It folds repeated warnings and stack frames, keeps the error location visible and saves full output for inspection. Each agentic trace contained two compaction markers. The JavaScript searches skipped node_modules, so dependency-path folding never activated. Cursor also took fewer tool calls (108 to 61 and 56 to 45). Cache reads accounted for most of the token difference, so one run per setup cannot tell us how much the preload alone saved.

The preload works with existing Node.js 22, 24, 26 and 27 installations. Next we will repeat these pairs, then test more JS/TS tasks and Node versions to see how often the difference holds.