Debugging
Agent is highly effective at diagnosing and fixing bugs. The most effective pattern is to give it the actual error output, not just a description of the problem.
Error-driven debugging
The fastest way to debug with Agent is to paste the full error. That means:
- Stack traces from crash logs
- Console output from failed tests
- Compiler or type-checker error messages
- Browser console errors
Agent reads the error, traces it back through your codebase, identifies the root cause, and proposes a targeted fix — not a guess.
# Example: paste the full npm test output
FAIL src/auth/session.test.ts
● AuthSession › should refresh token after expiry
TypeError: Cannot read properties of undefined (reading 'refreshToken')
at AuthSession.refresh (src/auth/session.ts:42:28)
at Object.<anonymous> (src/auth/session.test.ts:18:18)Use @Terminals in the chat input to automatically attach the last output from your terminal. This is faster than copy-pasting.
Debugging strategies
Add logging first
Ask Agent to add strategic console.log statements, then run the code and share the output. This is often faster than reading static code.
Trace the call stack
Ask Agent to explain the call chain from entry point to the failing line. Understanding the flow usually reveals where assumptions break down.
Reproduce in isolation
Ask Agent to write a minimal reproduction of the bug in a test file. Isolated reproduction removes environment variables and makes the problem concrete.
Check git history
Ask Agent to @Branch diff to compare the broken branch against main and identify which commit introduced the regression.
Using terminal output
Shell Mode
Shell Mode is the most powerful debugging workflow. Enable it by typing vyre shell in your terminal. In Shell Mode:
- Every command you run is visible to the agent.
- When a command fails, Agent automatically reads the error and proposes a fix.
- You can type
fix thisorexplain this errorwithout any copy-pasting.
Attaching terminal output manually
In the chat input, type @Terminals and select a terminal session. This attaches the last ~200 lines of output from that terminal to your message so Agent has full context.
Running tests and interpreting results
Ask Agent to run your test suite and interpret the results:
"Run
npm testand fix any failing tests. Explain what each failure was and why your fix addresses the root cause."
Common patterns
Type errors
"Fix the TypeScript errors in
src/api/client.ts. Don't cast toany— find the correct types."
Test failures
"The test
AuthService › should validate JWTis failing. Run it, read the output, find the root cause, and fix it."
Runtime crashes
"
npm startcrashes with the following error. Find the bug and fix it: [paste error]"
"The app is broken" gives Agent nothing to work with. Always include the exact error message, the steps to reproduce, and ideally the expected vs actual output.