caw-ai
v1.0.1
Published
caw-ai, Context-Aware Web Testing: plain-language web tests, recorded once by an agent, replayed without AI. Failures assessed as test, app or environment; bug reports taken to a proven fix.
Maintainers
Readme
English · Deutsch
caw-ai
caw· Context-Aware Web TestingAsk Claude Code for a web test in plain words. It records the test once; caw replays it without AI.
How it works
- You ask. In your Claude Code session, say in one sentence what the test should prove.
- Claude Code plans. It looks at your app and writes the steps: what to do, and what should be visible afterwards.
- You approve. A window opens with your app and a chat that shows the plan. Click Approve plan, or ask for changes.
- Claude Code records. It carries out the steps in the browser with caw's fixed commands. caw saves each action as a Playwright locator and each expectation as a check.
- caw checks the recording. A check run replays it without Claude Code. If it passes, you adopt it and the test is
saved in
caw/tests. caw runreplays it. Playwright repeats the saved actions and checks, locally and in CI, without AI.
Tokens are used only while Claude Code plans and records, not for replays.
Get started
You need Node 22.4+, Chrome and Claude Code. Start your app first.
1. Install caw and point it at your app
npm i -D caw-ai
npx caw init --url http://localhost:5173--url is the address your running app has in the browser, for example http://localhost:5173 for a Vite dev
server or http://localhost:3000. Without --url, init asks for it.
caw opens your app in Chrome:
- Go to the page where tests should start.
- Click Done.
caw writes caw.config.json and registers itself with Claude Code in this project.
Does your app have a sign-in? See Getting started.
A Claude Code session can run both commands for you. The window, the test user and a restart of claude stay with
you: Let Claude Code run the setup.
2. Ask Claude Code for a test
Start claude in the project. The first time it asks whether to use caw: say yes. Then write:
Record a test with caw: add a todo for tomorrow, find it with the search and tick it off.
3. Approve the plan and watch
A window opens with your app and a chat. Claude Code shows its plan: what it will do and what it then expects to see.
- Click Approve plan. Claude Code now clicks through your app.
- At the end, click Adopt test plan.
While Claude Code works, you can step in:
- Pause and give a hint: press Pause and write, for example, "The tag is #home, not home." Claude Code reads it before its next action.
- Mark an element: type
/elementin the chat and click the element in your app. It is attached to your next message.
4. Run the test, without AI
npx caw run --all --env localOr ask Claude Code to run it. The same command runs in CI (below).
No app at hand?
examples/errandis a small todo app with a test that runs right away. Getting started walks you through it in ten minutes.
What you can ask Claude Code
| You write | What happens | | --- | --- | | "Record a test: sign in and add a todo for tomorrow." | Plan, your OK, one recording (as above). | | "Run morning-errand." | Replayed without AI; you get pass or fail per step. | | "Why did morning-errand fail?" | caw has already said whether the test, the app or the environment is at fault, with the evidence. | | "Reproduce: searching for 'home' finds nothing. Then fix it." | Bug shown, a test that fails on it, the fix, the test green, kept as a regression test after your OK. | | "Write a test for TCK-1234 from main..feature." | A test for exactly what the ticket's change does. | | "Open first-errand at step S3." | Your app in that state, signed in, ready to look at or to ask about an element. |
Where an answer changes what a test checks, Claude Code asks you in a form only you can confirm.
When a test fails
caw names the likely cause without AI, from the requests and console messages it saw:
- Test: for example, a target is missing on an otherwise unremarkable page.
- App: for example, HTTP 500 or a script error.
- Environment: for example, a slow or missing server, or a lost sign-in.
What you can do then:
- It is your app: one click lets Claude Code find the cause in your code and offer the fix.
- A button was renamed: caw finds it and offers it as the new target, also without AI.
While a step's expectation stays the same, no agent may make its check weaker (how caw judges a step).
From a bug report to a proven fix
Tell Claude Code what is broken. You get a fix and a test that proves it:
- Reproduce: Claude Code tries the report in your app and shows what happened.
- Create test: a test that fails because of the bug.
- Fix: Claude Code changes your code (or you do).
- Test again: the same test now passes.
- Adopt: with your OK it stays as a regression test, with a short report of the fix.
What a test looks like
Claude Code writes it. You can read it, review it in a pull request and change it:
# caw/tests/first-errand.yaml
id: first-errand
role: user
writes: true
steps:
- id: S1
name: Add a todo
do: Add the todo "Feed the raven {{runTag}}" with the tag "#home".
expect: A confirmation shows the number of the new todo, and it is at the top of the list.In CI
- run: npx caw run --all --env staging --headless --report junit=out/caw.xml- Replays send nothing to any AI.
- Test users come from secrets (
CAW_TESTER_USER,CAW_TESTER_PASSWORD).
| Exit code | Meaning |
| --- | --- |
| 0 | pass |
| 1 | fail |
| 2 | environment error |
| 3 | invalid input |
| 4 | needs recording |
| 5 | a person decides |
Details: In CI.
Good to know
- Without Claude Code in your session:
npx caw record <test> --env localopens the same window. Describe the test in its chat or show the way yourself. - Playwright inside: caw replays with Playwright.
npx caw export <test>turns a test into a plain Playwright test. For cross-browser runs or large hand-written suites, use Playwright directly. - Works with plain web apps, React, Vue, Angular, Next.js, Nuxt and server-rendered pages, on Windows and Linux.
- Costs: tokens only while Claude Code records, reproduces or fixes, on your own Claude account.
- Plans: Pro and Max plans are for personal use. For company projects and CI use a Team or Enterprise plan or an API key.
- Your data: passwords stay in
caw/.envand are masked for Claude Code. Production is read-only. No telemetry. Details: Security and data.
Docs
| Page | What it covers | | --- | --- | | Getting started | Set up your project and record a first test, step by step | | Concepts | The words caw uses and how it judges a step | | Guide | Every feature in detail | | Commands · Configuration · Test files | Reference | | Claude Code and the agent | Where the agent runs, and caw's tools in your session | | Workbench | The window, the chat and the keys | | Security and data | What the agent can reach and what leaves your machine | | CHANGELOG | What changed in each version |
Contributing and license
- Issues and pull requests are welcome, see CONTRIBUTING.md.
- MIT, see LICENSE; fonts and graphics: NOTICE.md.
- Claude and Claude Code are trademarks of Anthropic, PBC. caw is not affiliated with or endorsed by Anthropic.
