noflake update

Read your recent code changes, identify affected tests, and patch them automatically.

🚧 Coming in v1.0

Usage

npx noflake update [options]

Options

FlagDescriptionDefault
--ref <ref>Git ref to diff againstHEAD~1
--stagedOnly diff staged changes (for pre-commit hooks)false
--autoAuto-commit the updated test filesfalse

How it works

  1. Diff — Reads git diff since the specified ref (or staged changes)
  2. Analyze — Identifies which test files are affected by the code changes
  3. Patch — Sends the diff + existing tests to Claude, gets updated test code
  4. Verify — Runs the patched tests to confirm they pass
  5. Commit (with --auto) — Auto-commits the updated tests

Git Hook Integration

When you run noflake init --hook, a post-commit hook is installed that automatically runs:

#!/bin/sh
# NoFlake auto-update hook
npx noflake update --ref HEAD~1 --auto

This means every time you commit, your tests automatically update to match your code changes. Zero friction.

Example (preview)

$ npx noflake update

šŸ”„ NoFlake — Update Tests

šŸ” Reading changes...
āœ… Found changes in 3 files

šŸ” Scanning codebase context...
āœ… Context loaded

šŸ”§ Identifying affected tests and patching...
  āœ… user-login-flow (patched)
  āœ… dashboard-crud-operations (patched)
  ā­ļø  api-auth-guard (no changes needed)

āœ… 2 tests updated, 1 unchanged