Cursor · stable

Cursor Testing Plugin.
afterFileEdit hook fires the test cycle.

tailtest-cursor hooks into Cursor IDE's afterFileEdit event. After every file Cursor's AI agent writes or edits, tailtest queues the file, generates scenarios via the R1-R15 rule layer, runs them with your existing test runner, and surfaces failures back to the agent. Open source. MIT. 181 plugin tests.

Install via Cursor Marketplace

Open the Cursor Marketplace (Cmd+Shift+X). Search for "tailtest" and click Install. Cursor handles the rest: clones the plugin, registers the hooks, restarts Cursor.

Manual install (if you prefer):

$ git clone https://github.com/avansaber/tailtest-cursor ~/.cursor/plugins/local/tailtest-cursor

# Restart Cursor. afterFileEdit hook now fires the test cycle automatically.

How tailtest hooks into Cursor

Cursor exposes file-lifecycle hooks: sessionStart, afterFileEdit, stop. tailtest registers all three.

afterFileEdit is the workhorse. Fires synchronously every time Cursor's agent writes to a file. The hook receives the file path on stdin. tailtest applies the intelligence filter (skip tests, skip generated code, skip vendored), checks the language and runner, and queues the file in .tailtest/session.json.

stop is the turn-end safety net. Sweeps the project for any file modified during the turn that afterFileEdit missed. Catches files Cursor wrote indirectly (shell commands, build steps). Returns the queued list to the agent for testing before the turn closes.

Notes on Cursor's hook quirks

Cursor 1.7 added PostToolUse and PreToolUse hooks similar to Claude Code's. There is a known upstream bug where PostToolUse's additional_context field accepts injection but is not surfaced to the model. Until that's fixed, tailtest-cursor stays on the reliable afterFileEdit + stop pair.

When the PostToolUse context-injection bug is resolved upstream, we'll evaluate migrating; today's path works reliably so there's no reason to chase the new hook surface.

What you get

Per-edit firing via afterFileEdit

No matter how Cursor's agent generates code -- composer, agent mode, multi-file edit -- tailtest fires on the file-write side.

Same rule layer as Claude Code variant

R1-R15 ports across all four tailtest plugins. If you switch hosts, the generated scenarios feel identical.

Adversarial mode (R15)

Same 8 breakage categories. Turn on with "depth": "adversarial".

181 plugin tests

tailtest-cursor's own dogfood test suite. Tests that the plugin itself behaves correctly across edge cases.

Common questions

Does this work with Cursor's tab autocomplete?

Yes for file-write events. Tab completion that doesn't write to disk doesn't trigger afterFileEdit. Composer/Agent mode writes do trigger it.

What if I'm using Cursor's chat sidebar instead of agent mode?

If chat applies a diff to a file, that's a file-write event -- afterFileEdit fires. tailtest queues it the same way.

I use both Cursor and Claude Code. Do I need both plugins?

Yes, install both. Same rule layer underneath, different hook integration per host. The .tailtest/ state directory is shared so switching between hosts in the same project is seamless.

Install in your Cursor project