Phew Install

Fix failing tests and errors with AI in VS Code

Updated · 2 min read

Phew it! turns an error into a fix: the agent reads the error, finds the cause, changes the code, and runs your check again until it passes. You review each change before you keep it.

1. Tell Phew how to check

Set phew.verify.command to the command that proves a fix, for example npm test, pytest -q, or go test ./.... After the agent changes code, Phew runs it. If it fails, the agent gets the output and tries again, up to phew.verify.maxAttempts times.

2. Start from the error

  • An error in the editor: put the cursor on it and press Ctrl+Alt+. (Cmd+Alt+. on macOS), or click the light bulb and choose Phew it!
  • All errors in a file: run Phew it! Fix All Errors in File.
  • A failed command in the terminal: Phew offers Phew it! when a command fails, or run Phew it! Fix Last Failed Terminal Command.
  • In the chat: describe it, for example “The login tests fail after my refactor. Fix them.”

3. Watch it work

The agent reads the code, runs the tests in your own terminal, changes what is wrong, and runs the check again. You see each command live and can type at any time. When the check passes, the task ends with a summary of the changed files.

Phew fixed a login bug: the tests pass, and a summary card shows two changed files with Keep all and Undo all
When the check passes, the task ends with the changed files, ready to keep or undo.

4. Keep or undo

Each change shows in the editor with Keep and Undo. The bar above the input lists the files to review. If a fix goes the wrong way, Restore checkpoint brings back the files as they were before the request.

Tips for better fixes

  • Keep the check fast: run the failing test file instead of the whole suite.
  • Put the conventions of your project in AGENTS.md. Phew follows it, and /init writes one for you.
  • Use Debug mode when the cause is unclear: the agent looks for the cause before it changes code.