← Back to home
Comparison · DevOps

Sanity vs withr

A side-by-side editorial comparison of Sanity and withr — release velocity, themes, recent moves, and the top alternatives to consider.

Sanity vs withr: at a glance

FeatureSanitywithr
SectorDevOpsDevOps
Velocity score7.50.0
Sparks · 30d10
Top themesmcp, agent-tooling, esm-migration, media-librarystate-management, testing, performance, base-r
Last editorial update5h ago50m ago
WebsiteVisit →Visit →

What is Sanity?

Sanity is widening the surface agents can act on while forcing its own packages onto modern Node.

Sanity ships on three tracks at once: Studio, the Media Library, and an MCP server that now moves faster than either. The MCP server took three releases in nine days, adding CORS-origin management and hardening how documents and schemas are written. Underneath that, the JavaScript client and the UI package both went ESM-only in the same week, raising the floor to Node 22.12 and React 19.2.

Read the full Sanity trajectory →

What is withr?

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

Read the full withr trajectory →

Sanity vs withr: editorial side-by-side

S
Sanity
DEVOPS
7.5

Sanity is widening the surface agents can act on while forcing its own packages onto modern Node.

◆ Current state

Sanity ships on three tracks at once: Studio, the Media Library, and an MCP server that now moves faster than either. The MCP server took three releases in nine days, adding CORS-origin management and hardening how documents and schemas are written. Underneath that, the JavaScript client and the UI package both went ESM-only in the same week, raising the floor to Node 22.12 and React 19.2.

◆ Where it's heading

The MCP server is where the new capability is landing — each release either exposes another piece of project administration to an agent or closes a way an agent could silently corrupt state. That pairs with Sanity New, which removes signup as a precondition for provisioning. The package modernization is cleanup that clears the way rather than a destination in itself.

◆ Prediction

Expect the MCP tool surface to keep expanding toward project administration that today requires the management console or CLI, with the same pattern of returning corrective errors rather than accepting malformed agent input.

W
withr
DEVOPS
0.0

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

◆ Current state

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

◆ Where it's heading

The arc here is a package pushing its own machinery down into base R and then living off the result. Once defer() became on.exit(), the remaining work is about where cleanup is allowed to happen - knitr documents, source() calls, the global environment, session end - and about restoring state correctly when an expression exits early. Releases are now infrequent and CRAN-driven.

◆ Prediction

Expect continued low-volume releases fixing edge cases in where deferred handlers run; with the core delegated to base R, there is little left that would prompt a larger change.

Alternatives to Sanity and withr

Other DevOps products tracked by Sparkpulse, ranked by recent ship velocity. Each card links to a full editorial trajectory and lets you pivot into a head-to-head comparison with either Sanity or withr.

See all Sanity alternatives → · See all withr alternatives →

Recent activity from Sanity and withr

Latest ship moves from both products, interleaved chronologically. ⚡ = editorial spark.

  1. 20h agoSanityJavaScript Client v8.0.0: Node 22+ ESM-only support and refined upload, proxy, and error handling
  2. 1d agoSanityMCP server v2.29.1: Standard protocol negotiation errors
  3. 1d agoSanityMCP server v2.29.0: CORS origin tools and safer document inputs
  4. 1d agoSanityMedia Library v2026.08.12.draft: Asset previews now show shareable URLs, steadier dialogs, and assorted improvements
  5. 2d agoSanitySanity Studio v6.9.2: Sanity New, Content Releases fixes, and Studio UI improvements
  6. 2d agoSanityMCP server v2.28.0: Explicit release IDs and safer schema management
  7. 1mo agowithrlocal_seed() actually preserves the seed now
  8. 1y agowithrlocal_language() no longer warns when set to C
  9. 2y agowithrdefer() becomes a thin wrapper over base::on.exit()
  10. 4y agowithrCleanup works inside Rmd and source(); with_() gains a getter
  11. 4y agowithrNew maintainer; handlers run at session end
  12. 5y agowithrlocal_options() can set NULL; with_seed() controls RNG kind

Frequently asked questions

What is the difference between Sanity and withr?

They serve adjacent needs but don't currently overlap on shipped themes. Sanity is currently shipping more aggressively (velocity 7.5 vs 0.0), with 1 editorial sparks in the last 30 days against 0. See the at-a-glance table above for a side-by-side breakdown of velocity, recent sparks, and editorial themes.

Is Sanity better than withr?

Sparkpulse doesn't pick a winner — we score release velocity, not feature parity. Sanity is currently shipping more aggressively (velocity 7.5 vs 0.0), with 1 editorial sparks in the last 30 days against 0. For your specific use case, the alternatives sections above list other DevOps products to evaluate alongside.

What are the best alternatives to Sanity?

Top Sanity alternatives in DevOps are ranked by recent ship velocity. Browse the "Sanity alternatives" section above for the current picks, or visit /alternatives/sanity for the full list with editorial commentary on each.

What are the best alternatives to withr?

Top withr alternatives in DevOps are ranked by recent ship velocity. Browse the "withr alternatives" section above for the current picks, or visit /alternatives/withr for the full list with editorial commentary on each.