noflake update
Read your recent code changes, identify affected tests, and patch them automatically.
š§ Coming in v1.0
Usage
npx noflake update [options]Options
| Flag | Description | Default |
|---|---|---|
--ref <ref> | Git ref to diff against | HEAD~1 |
--staged | Only diff staged changes (for pre-commit hooks) | false |
--auto | Auto-commit the updated test files | false |
How it works
- Diff ā Reads git diff since the specified ref (or staged changes)
- Analyze ā Identifies which test files are affected by the code changes
- Patch ā Sends the diff + existing tests to Claude, gets updated test code
- Verify ā Runs the patched tests to confirm they pass
- 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 --autoThis 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