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 is replayed by Saffron in a real browser, 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 · 0 tokensYELLOWNote after the standard guests 4/5 seeded ✓GREENGuest count via step set cache · 0 tokensGREENSuccessful login cache · 0 tokensGREENLogin with a credentials table cache · 0 tokensGREENFailed login shows an error (ex. 1) cache · 0 tokensGREENFailed login shows an error (ex. 2) cache · 0 tokens 6 passed, 1 adapted, 0 failed · 5 AI calls · $0.61report: .saffron/reports/latest.htmloutput 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 a real browser through Playwright MCP, and Saffron records what it does as semantic actions in a JSON cache: ARIA role and accessible name first, CSS only as a fallback. The cache is verified by a zero-AI replay before it is written.
Saffron replays the recorded actions in a real browser, on Playwright's browser engine. No agent is loaded, no MCP, no tokens: it runs at Playwright's speed.
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 chrome|msedge|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. Bug reports, feature requests and questions live in the public community repository, linked from the Community page.
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
40 capabilities · in saffron-ai 0.8.5Runner core
13- Record once, replay at zero tokens
- Mid-run healing into verified proposals
- Proposals bound to what you reviewed: stale ones cannot be accepted
- Recordings validated on read, problems named by path
- Heal notes that name the kind of change, checked against the recording
- Sacred assertions, with an assertion policy
- Step reuse: new recordings seeded from old ones
- Cross-browser replay, parallel workers, heal model
- Google Chrome and Microsoft Edge, recording included
- Setup and teardown commands around a run
- Sharding across CI machines, with one merged report
- Re-record a wrong recording, and prune the ones nothing owns
- A baseURL with a path or query, for variants behind a flag
Writing tests
6- Step sets and the .saffron dialect
- Tables, doc strings and Scenario Outlines
- Secrets as {env:VAR}, masked in everything Saffron writes
- Test data in a data folder: values, lists, Examples from a file
- Values that are new on every run, and data per environment
- 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
7- VS Code extension and JetBrains plugin
- Run from the IDE, panels and a dashboard
- Last run in the IDE, with the failure screenshot one click away
- Proposals, orphans, tags and health panels in both IDEs
- {data:...} completion, hover and diagnostics
- Claude Code plugin with the language server
- Agent skill, MCP server and saffron init
Reports and history
7- Failure screenshots, embedded in the report
- saffron diff: what a proposal changes, field by field
- Retries visible per step
- 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
3- Public npm package, free for any use
- Generated docs site and one changelog
- Configuration reference, and a community repo for issues
Ahead
9 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.
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
Parallel recording and healing
Parallel replay and sharding across CI machines are shipped. Next: let independent scenarios record or heal at the same time, under a concurrency cap.
A browser matrix in one run
Chromium, Chrome, Edge, Firefox and WebKit are shipped. Next: every engine in one command with per-browser results, 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.