DOCS

You talk. Your agent runs the commands.

What Witness is, how your agent installs and drives it for you, and exactly what lands in the evidence package.

docs
01 · What it is

A black box for product QA.

Witness records a human using a web product and turns it into causal evidence an AI coding agent can act on. You talk and point; it keeps the books. One continuous take can hold many issues — segmentation is optional.

VOICE

Continuous speech

Live streaming ASR (Doubao web → IME → browser SR fallback, all free). Every spoken observation lands on the timeline verbatim — corrections never overwrite the original.
OPS

Causal bursts

Each click captures its ~1.8s aftermath: requests, response bodies, console errors, DOM mutations. A click with no aftermath is recorded as evidence of a dead button.
STATE

Page forensics

rrweb full replay, event-driven screenshots, DOM snapshots, element marks with React/Vue component chains. No source-line mapping needed — selectors + components are enough.

Stopping produces a local evidence package under .witness/sessions/<timestamp>/ — nothing leaves your machine unless you hand it to an agent.

install
02 · Install

You don't install it. Your agent does.

The intended flow: you give the instruction, the agent types the commands. Witness is a CLI (wit) that drives your system Edge/Chrome — no browser download, no cloud account, no keys.

say this to your agent
Install witness: `npm i -g github:wookat/witness`,
verify with `wit --version`. Requires Node 18+.

What lands on your machine

the wit CLI — recorder, session renderer, transcriber, MCP server in one binary. Config at ~/.witness/config.json, ASR creds at ~/.witness/doubao-creds.json. Evidence always lands in the current project's .witness/sessions/.

Teach an agent that doesn't know it

The repo ships skills/witness/SKILL.md — a ready-made skill file. Drop it into CLAUDE.md / .cursor/rules/ / AGENTS.md and phrases like "帮我录一段" trigger the whole workflow. View it ↗
what the agent actually runs
# for transparency — under the hood your agent does:
npm i -g github:wookat/witness
wit --version
config
03 · Configure

Zero-config by default; switches when you want them.

Live ASR engine

wit config asr persists to ~/.witness/config.json; --asr / WIT_ASR override per run. Agents can flip it live via the set_asr MCP tool.
auto         doubao-web → doubao-ime → sr
doubao-web   best punctuation (default pick)
doubao-ime   per-sentence timestamps, ITN digits
sr           browser SpeechRecognition (offline)
off          no live subtitles (final transcript only)

Optional keys & env

Everything works with none of these — they're upgrades, not requirements:
OPENAI_API_KEY   whisper-1 word timestamps
ZHIPU_API_KEY    GLM-4 say-correction + associate
WIT_ASR          engine override for one run
WIT_NO_BODIES=1  skip response-body capture
WIT_CDP=<port>   expose CDP so an agent can drive
                 the recorded browser as the tester
record● REC
04 · Use it

Three sentences. That's the whole loop.

the conversation
you → "record http://localhost:5173 for me"
agent → runs `wit start`, managed browser opens you → use the product, talk out loud, mark problems you → press ■ (or tell the agent "stop") you → "fix the issues from that recording"
agent → reads session.md, fixes from the evidence
YOUR PART — inside the browser

Talk & point

speak        every observation → timestamped SAY
Ctrl+Click   mark an element (selector + shot + DOM)
M            inspect mode — hover-pick or drag a region
N            new issue boundary (optional)
P            pause/resume — freezes evidence AND mic
■ / Alt+Shift+R   stop
AGENT'S PART — commands it may run

The CLI surface

wit start <url>        record (agent launches it)
wit list / open        browse sessions
wit transcribe <dir>   re-run transcription
wit correct <dir>      LLM polish (verbatim kept)
wit associate <dir>    LLM picks evidence per SAY
wit recover <dir>      rebuild after a crash
wit mcp [dir]          serve evidence over MCP
wit config asr …       engine: auto|doubao-web|ime|sr|off
package
05 · What you get

One package, two audiences.

For you: a visual replay. For your agent: a structured handoff it can fix from.

.witness/sessions/<ts>/
├─ review.html → FOR HUMANS — timeline replay: audio + shots + events, click anything to seek
├─ PROMPT.md → FOR AGENTS — handoff doc: how to read this evidence
├─ session.md → FOR AGENTS — the timeline: every SAY + its causal burst
├─ events.jsonl → raw event stream (1189 events in a real run)
├─ transcript.json → final speech transcript, segment timestamps
├─ audio.webm → the recording, seekable
├─ shots/ → screenshots — marks get red boxes, regions are crops
├─ bodies/ → request/response payloads
├─ dom/ → DOM snapshots at key moments
├─ rrweb.jsonl → full replay stream
└─ session.json → meta: url, duration, asr engine, counts

PROMPT.md

The paste-this-to-your-agent doc. Teaches it the format: causal-burst indentation, "no aftermath = evidence", component chains, never infer intent without a SAY.

session.md

The evidence timeline. Each SAY block carries your verbatim words plus what the page did at that second.

wit mcp

Serves the session over stdio MCP: session_overview · list_says · session_md · events_around · get_errors · get_shot · get_dom_state · get_body · get_asr · set_asr.
handoff
06 · Tell your agent

Three ways to hand over evidence.

EASIEST

Point at the directory

"I recorded a session —
evidence is in .witness/sessions/<ts>.
Read session.md and fix the issues."
FOR ANY AGENT

Paste PROMPT.md

The file teaches an unfamiliar agent how to read the package. Copy its contents plus the directory path — works with agents that don't know Witness.
PERMANENT

Wire the MCP

{ "mcpServers": { "witness": {
  "command": "wit", "args": ["mcp"]
} } }
Agent pulls evidence on demand — and can flip the ASR engine itself.

And to make an agent record: "use witness to record http://localhost:5173 — I'll talk through the issues". With WIT_CDP set, an agent can even be the tester inside the recorded browser.

demo■ STOP
07 · Try it in two minutes

Record the demo page.

A tiny broken product ships with the site — it has a dead button, a console error and a bad API response waiting to be caught:

terminal
wit start https://witness.zalize.com/demo-app.html --duration 60
# click the Pay button, say "点了没反应", stop → open review.html