Skip to content

Using Qualflare in Claude Code

The Qualflare plugin for Claude Code adds AI-powered test coverage to your development workflow. After a one-time setup, you can generate tests for changed files, run your suite and upload results to Qualflare, and fix failures — without leaving the chat. This is different from the in-app Quo Agent, which analyzes your test suites inside the Qualflare web app.


Before you start

You need:

  • Claude Code — the CLI or desktop app
  • The Qualflare CLI (qf) installed and on your PATH — see Installation
  • A Qualflare account and at least one project

AI Command

Paste this prompt into your AI coding agent to install the required qf CLI automatically:

Install the Qualflare CLI (`qf`) on my machine.

1. Detect my operating system (macOS, Linux, or Windows) and CPU architecture
   (amd64 or arm64).
2. If Homebrew is available (macOS/Linux), run: brew install qualflare/tap/qf
3. Otherwise, open https://github.com/qualflare/qualflare-cli/releases/latest,
   download the asset matching my OS and architecture
   (qf_<version>_<os>_<arch>.tar.gz, or .zip on Windows), extract it, and move
   the `qf` binary into a directory on my PATH.
4. Run `qf version` to confirm the install succeeded.

For other install methods see Installation.


Installing the plugin

Run these two commands in Claude Code:

/plugin marketplace add Qualflare/qualflare-claude-code
/plugin install qualflare@qualflare

The first command registers the plugin from the Qualflare marketplace. The second installs it into the current session. After installation, all /qf-* commands are available.


First-time setup

Run setup once from your project root:

/qf-init

/qf-init does the following:

  1. Detects your tech stack — languages, test frameworks, and file counts — across the project or each workspace in a monorepo.
  2. Confirms the detection with you and accepts corrections.
  3. Writes .qualflare/test-state.md — a persistent context file that every future session reads silently at startup, so /qf-cover and /qf-run are framework-aware from the first message.
  4. Adds a Qualflare section to your project's CLAUDE.md so future sessions load test context automatically.
  5. Asks whether to enable the end-of-session coverage nudge.
  6. Tells you exactly which qf login commands to run.

After setup completes, register each identifier printed by /qf-init:

bash
qf login <identifier> <token>

Get tokens at https://app.qualflare.com/project/<identifier>/settings/access-tokens. In a monorepo, each package gets its own identifier — run qf login once per package.

TIP

/qf-init is safe to re-run at any time. It overwrites .qualflare/test-state.md with fresh detection results and re-prompts for hook preference and authentication.


The daily workflow

Once setup is done, three commands cover the typical cycle:

1. Generate tests for what you changed

After writing or editing source files:

/qf-cover

/qf-cover reads .qualflare/test-state.md to know your frameworks, identifies the source files changed in this session that lack test coverage, proposes test cases, and writes them after your approval. Pass a path or glob to scope it:

/qf-cover src/auth/login.ts
/qf-cover packages/api/src/**

By default /qf-cover only covers code you changed this session. Pass --all to cover an entire file or directory regardless of recent changes:

/qf-cover --all src/utils/

2. Run the suite and upload results

When you're ready to verify:

/qf-run

/qf-run runs your test suite and uploads the results to Qualflare via qf collect. Pass a framework slug or results file to scope the run:

/qf-run jest
/qf-run playwright

WARNING

/qf-run requires each identifier to be registered locally with qf login before it can upload. Run /qf-doctor if the upload fails.

3. Fix failing tests

When tests are red:

/qf-fix

/qf-fix reads the last run's result files from .qualflare/results/, analyzes the failures, and patches your source code until the tests pass. Pass a slug or path to scope which failures to fix:

/qf-fix jest
/qf-fix packages/api

The coverage nudge

When enabled, a quiet message appears at the end of any session where you edited source files without touching tests:

🔍 Qualflare: 3 source file(s) changed without test updates. Run /qf-cover to add coverage.

The nudge only fires for substantive edits — config files, type definitions, and one-line tweaks are excluded. You can toggle it at any time:

/qf-hook on
/qf-hook off

Or check the current setting with /qf-hook (no argument).


Keeping state fresh

Inspect current state:

/qf-state

Shows detected frameworks, file counts, hook setting, and which CLI identifiers are configured locally.

Refresh counts after adding tests:

/qf-update

Faster than a full re-init — re-globs each framework row and updates .qualflare/test-state.md in place. Pass a slug or path to scope the refresh.


Troubleshooting

Run /qf-doctor first when something feels wrong:

/qf-doctor

It checks: qf CLI on PATH, each package's identifier configured locally, .qualflare/test-state.md freshness, file-count drift, and framework tooling availability. It reports ✅/⚠️/❌ per check with actionable fix commands.

TIP

Most issues are a missing CLI or a missing qf login. Fix what the doctor flags and re-run.


Updating the plugin

Pull the latest version at any time:

/plugin update qualflare

See Also