Detailed Analysis
9lives is a newly released open-source CLI tool addressing a specific pain point in automated testing: the tendency of coding agents (and human developers) to "fix" broken tests by rewriting them rather than investigating whether the underlying application logic has actually changed in a meaningful way. The tool's core mechanism is a tiered healing system. Tier 1 operates entirely offline and deterministically — when a Playwright test fails because a selector no longer matches, 9lives inspects the page snapshot captured at the moment of failure and re-anchors the locator using a prioritized hierarchy (data-testid, id, aria-label, text, class). This requires no LLM call, no network access, and no account, making it fast and free for the most common category of test breakage: cosmetic or structural DOM drift that has nothing to do with actual behavior changes.
Tier 2 is where large language models enter the picture, and notably, 9lives is designed to piggyback on tools developers already pay for rather than requiring a new subscription or API key. It shells out to locally installed CLI agents — Claude Code, Codex, or OpenCode — in headless mode to handle more complex structural changes that can't be resolved deterministically. This is a pragmatic design choice reflecting the current state of the AI coding tool ecosystem: many developers already have Claude subscriptions through Anthropic's coding agent products, and 9lives treats those as infrastructure to be reused rather than duplicated. Raw API keys for Anthropic or OpenAI are also supported as a fallback. All Tier 2 fixes surface as a unified diff requiring human approval by default, with a `--yes` flag for CI environments where trust has been established.
The most consequential design decision, and the one the author explicitly foregrounds, is that 9lives refuses to heal failing assertions — only failing selectors. This distinction matters because it draws a hard line between test brittleness (a selector broke because a button was renamed, which is noise) and genuine regressions (an assertion failed because behavior actually changed, which is signal). Many self-healing test tools in the market, including established players like Healenium, have been criticized for quietly rewriting tests to force green results, effectively laundering real bugs into passing CI pipelines. By hard-coding a refusal to touch assertions and instead flagging them as "needs-human," 9lives positions itself as a tool that preserves the integrity of test suites rather than optimizing purely for pipeline throughput — a meaningful stance given how easy it would be to build a tool that simply maximizes green checkmarks.
This release is emblematic of a broader shift happening in developer tooling as AI coding agents become embedded in everyday workflows. As agents like Claude Code increasingly write and modify code autonomously, new failure modes emerge — agents breaking tests incidentally while pursuing unrelated tasks, then "fixing" them in ways that erode test suite reliability over time. Tools like 9lives represent a second-order response to this dynamic: infrastructure built specifically to keep AI-assisted development honest by constraining what agents are allowed to auto-correct. The integration points are telling — an MCP server so agents like Claude Code or Cursor can call `heal_test` mid-session, a pre-commit hook, and a GitHub Action for CI — all signal that the tool is designed to slot directly into agentic development loops rather than function as a standalone utility. The MIT license, small codebase (~2.5k lines), lack of telemetry, and offline-reproducible demo also reflect a trust-building strategy common among developer tools trying to gain adoption in a space increasingly wary of opaque, cloud-dependent AI tooling that could introduce security risks, particularly given the tool's own acknowledgment that failure-page content becomes model input during Tier 2 operations.
Read original article →