Write tests in Gherkin.Pay for AI once.Replay forever.
An AI agent executes each scenario in a real browser on the first run and records a deterministic cache. Every later run replays with plain Playwright at zero LLM tokens and at Playwright's speed. When the UI changes, the agent heals mid-run and files a reviewable proposal, like snapshot testing for user journeys.
$ saffron run GREENSign the guestbook and leave a note cache · 147msYELLOWNote after the standard guests 4/5 seeded ✓GREENGuest count via step set cache · 160msGREENSuccessful login cache · 90msGREENLogin with a credentials table cache · 99msGREENFailed login shows an error (ex. 1) cache · 84msGREENFailed login shows an error (ex. 2) cache · 91ms 6 passed, 1 adapted, 0 failed · 5 AI calls · $0.61report: .saffron/reports/latest.htmlactual output from the bundled example suite · 6/7 replayed from cache · one novel scenario recorded and verified
Six rules that keep it honest
Saffron's culture is honesty over convenience. The runner refuses to hide costs, refuses to heal assertions, and refuses to change your suite without a commit.
Assertions are sacred
No Then is healed by default: enforced mechanically in the runner, not by prompt discipline. Projects may opt in to adaptable mid-scenario checkpoints; the final assertion block of every scenario stays strict under every policy.
Three result states
Green: replayed from cache. Gold: recorded or adapted by the agent this run; the proposal awaits review, stamped verified or honestly unverified. Red: failed. No fourth category.
Diagnose before adapting
The agent decides whether the failure is UI drift or a real application defect. Defects surface as red, not as a silent heal.
Caches are git artifacts
.saffron/cache lives in your repo and gets reviewed like snapshots. Diffs are readable. Nothing changes on CI without a commit.
Verified proposals
Every recording is proof-replayed with zero AI before it is filed. A proposal that cannot replay deterministically never leaves the machine.
Honest cost reporting
Prompt-cache reads and writes are shown alongside token counts. The number at the bottom of the report is the real bill.
Record once, replay forever, heal when the UI moves
Every scenario travels one of three paths. The runner picks the path automatically based on cache state and the outcome of the replay.
An AI agent drives Playwright via MCP and records semantic actions: ARIA role and accessible name first, CSS only as a fallback. The cache is verified by a zero-AI replay before it is written.
Plain Playwright replays the recorded actions against your app. No agent is loaded, no tokens are spent, and scenarios finish in about a hundred milliseconds each.
When a cached step fails, the agent takes over in the same browser via CDP, adapts around the drift, finishes the scenario, and files a proposal with a cache diff and a suggested feature-file edit. Nothing is applied without your review.
Cost scales with novel steps, not with runs
Real numbers from an internal checkout suite, at API rates. A new scenario gets cheaper as the suite grows because the agent seeds from every step it has already recorded. A cached replay spends no LLM tokens; it still costs what any Playwright run costs in CI minutes, and a heal is a new, smaller AI session when the UI changes.
| Scenario | Cost |
|---|---|
| Full unseeded recording | $2.07 |
| Tuned inner loop | $1.16 |
| Seeded recording, 6-step scenario, one novel step | $0.15 |
| Every cached replay after that | 0 tokens |
New scenarios get cheaper as the suite grows, because cost scales with novel steps only.
Works where you already work
One install per tool. JetBrains and VS Code get highlighting, completion with recorded/divergent/unrecorded badges, StepSet navigation, diagnostics, run buttons and a Saffron panel with proposals, tags, health and the report. Claude Code gets the same language server, the MCP tools and the agent skill.
Saffron plugin for IntelliJ, WebStorm, PyCharm, Rider
File type, highlighting and the language server, plus run configurations, right-click Run and a Saffron tool window with proposals, tags, health and an embedded dashboard. Community editions included.
Settings → Plugins → Marketplace → search "Saffron"
Saffron extension for VS Code
Highlighting, completion with status badges, StepSet navigation, diagnostics, right-click Run, a Saffron side panel with proposals, tags and health, and an in-editor dashboard.
code --install-extension ChathurangaJayasinghe.saffron-vscode
Saffron plugin for Claude Code
The language server, so Claude sees diagnostics and navigates StepSets while it edits .saffron files, the MCP server with search_steps, list_step_sets and project_status, and the Saffron agent skill, as one plugin.
/plugin marketplace add s-chathuranga-j/saffron-claude-plugin /plugin install saffron@saffron
JetBrains, Visual Studio Code and Claude are trademarks of their respective owners, shown to indicate compatibility. Saffron is not affiliated with or endorsed by them.
A few commands to your first zero-token run
npm i -D saffron-ainpx playwright install chromiumnpx saffron init --examples # config, agent skill, Saucedemo example suite npx saffron run # agent records, files proposalsnpx saffron accept --all # promote proposals to cachesnpx saffron run # 0 LLM tokens, the whole suite in secondsNo step definitions, no glue code. Write plain Gherkin (or .saffron), point saffron.config.json at your app, and run. The agent needs Claude Code auth or an ANTHROPIC_API_KEY on the first run only: replay-only CI needs no AI access at all, runs cross-browser (--browser firefox|webkit), and parallelizes with --workers N.
No app to point it at yet? saffron init --examples installs a handful of short .saffron scenarios against the public demo shop at saucedemo.com (login, a Scenario Outline, cart, checkout, StepSets at the start and mid-scenario), with the config and a .env.example ready. The first run records them for about $3 of AI usage; every run after that is free. The docs walk through it step by step.
Saffron is live on npm: free to use, including commercially. The GitHub button points at this site's repository, which also hosts the issue tracker.
What is shipped, what is ahead
Shipped is what is in the package you install today, grouped by what it lets you do. Ahead is ordered by how close it is, not by a date.
Shipped
23 capabilities · in saffron-ai 0.7.1Runner core
5- Record once, replay at zero tokens
- Mid-run healing into verified proposals
- Sacred assertions, with an assertion policy
- Step reuse: new recordings seeded from old ones
- Cross-browser replay, parallel workers, heal model
Writing tests
4- Step sets and the .saffron dialect
- Tables, doc strings and Scenario Outlines
- Secrets as {env:VAR}, masked in everything Saffron writes
- Guided first run with an example suite
Real-world pages
4- Dialogs, uploads, drag-and-drop, iframes
- Network-aware steps, in plain prose
- Multi-tab scenarios, in plain prose
- Dynamic values and date templates
Editors and agents
4- VS Code extension and JetBrains plugin
- Run from the IDE, panels and a dashboard
- Claude Code plugin with the language server
- Agent skill, MCP server and saffron init
Reports and history
4- Cost by how the run was paid for
- Run history, trends, chronic scenarios
- saffron status for panels and dashboards
- Multi-tag filter, tags in the report JSON
Distribution
2- Public npm package, free for any use
- Generated docs site and one changelog
Ahead
10 items · nearest firstDesigned, waiting for a slot
Multi-session scenarios
Two users in one scenario, each in its own browser context: buyer and seller, sender and receiver.
Run one scenario
A file:line form in the CLI, then gutter run icons per Scenario in JetBrains and VS Code, and an exclude-tags filter.
Failure screenshots and video
What the page looked like when a step failed, in the report and one click away in the IDE. Video per scenario, kept only for failures if you prefer.
Execution replay
Not a video: step through a run with the DOM inspectable at every action and the network alongside, navigated by your Given, When and Then.
Scoped, not scheduled
Sharding and parallel recording
Parallel replay is shipped. Next: split a suite across CI machines, and let independent scenarios record or heal at the same time.
Chrome, Edge and a browser matrix
Replay on Chromium, Firefox and WebKit is shipped. Next: branded Chrome and Edge, every engine in one run, and device profiles.
Multi-provider agents
Record and heal with models beyond Claude, behind the same provider interface.
LLM-less MCP replay
Replay through the MCP surface with no model in the loop.
Shared step library
Level 2 of step reuse, gated on evidence from real suites rather than scheduled.
Direction, not a date
Open-core SaaS layer
Hosted history and review for teams. The CLI never requires it.