grove

Debug trace

Printf debugging as an agent primitive. Instead of an agent editing console.log lines into your code, running the tests, and (hopefully) cleaning up after itself, Grove gives agents a debug_trace MCP tool that does the loop atomically:

  1. Inject a tagged print after a chosen file:line, evaluating the expression the agent wants to observe.
  2. Run the command the agent specifies (a test, the binary, a script) in the task's worktree.
  3. Parse the tagged values out of the output.
  4. Revert the file — always, even on a crash or timeout. No stray debug lines ever land in your diff.

Each trace appends a record — values, command, duration, exit status — to a per-task debug.jsonl that lives with the task's notes, so the debugging session is itself an inspectable artifact: you can open it and see exactly what the agent observed on its way to a conclusion.

Why it exists

Agents debug by guessing from static reads far more than they should — the friction of "add a print, run, find the output, remove the print" is just high enough that they skip it. Making the loop one tool call (and making the cleanup unconditional) means agents actually observe runtime values instead of theorizing about them.

Details

  • Supported languages: Rust, JS/TS, Python, Go.
  • The injected print is wrapped to tolerate evaluation failures, so a bad expression reports rather than crashing the run.
  • If the trace point is never reached, the record says so — itself a useful signal.
  • Commands time out (2 minutes by default; the agent can extend).
  • Traces are agent-driven via MCP — there's no UI button to start one. You'll see them in the task's debug.jsonl.