Skip to content

Worktree Diff

The Worktree Diff tab runs git diff against the agent’s worktree and renders the results directly in the session view. But this isn’t a read-only diff viewer — it’s a full code review surface. You can switch between view modes, edit files inline, add comments that get sent back to the agent, and accept or reject the entire changeset with a single click.

Worktree diff — review, edit, comment, and accept or reject agent changes

What the diff shows

The diff displays all uncommitted and committed changes in the agent’s worktree relative to its base ref. This includes:

  • New files created by the agent.
  • Modified files with line-by-line additions and deletions.
  • Deleted files removed during the session.
  • Renamed or moved files with path changes.

Each file header shows the path, change stats (+149 -0), and per-file action buttons.

View controls

The diff viewer includes controls that let you customize how changes are displayed:

Split view

Toggle between unified (single column with additions/deletions interleaved) and split (side-by-side with old on the left and new on the right). Split view is especially useful for reviewing large modifications where you want to compare the before and after simultaneously.

Wrap text

Toggle line wrapping on or off. When enabled, long lines wrap within the viewport instead of scrolling horizontally. Useful for reviewing prose-heavy files like documentation, configs, or markdown.

Syntax highlighting

The diff viewer renders code with full syntax highlighting based on file type. TypeScript, Rust, Go, Python, JSON, YAML, markdown, and other common formats are all highlighted, making it easier to read and review agent-generated code.

File-level actions

Each file in the diff has its own action bar:

Edit

Click Edit on any file to open it for inline editing directly in the diff view. If the agent made a small mistake — a typo, a wrong import path, a missing semicolon — you can fix it right here without opening a terminal or editor. Save your edit and the worktree is updated immediately.

This is one of the fastest feedback loops in Valdr: see a problem in the diff, fix it in place, and move on.

Viewed

Check the Viewed checkbox to mark a file as reviewed. This helps you track your progress when reviewing a large changeset with many files — you can see at a glance which files you’ve already looked at.

Accept, reject, and comment

The bottom action bar provides three operations that control what happens to the agent’s changes:

Accept All

Clicking Accept All merges the agent’s worktree branch into the parent branch automatically. This is the happy path — the agent’s work looks good, tests pass, and you want to ship it. One click and the changes are merged.

Reject All

Clicking Reject All discards the agent’s changes. Use this when the approach is fundamentally wrong and you want the agent to start over or when you decide the task should be handled differently.

Send Comments

Add inline comments to specific lines or sections of the diff, then click Send Comments to deliver all your feedback directly to the agent. The agent receives your comments as input and can act on them — fixing issues, adjusting its approach, or re-implementing sections based on your guidance.

This creates a tight feedback loop:

  1. Review the diff.
  2. Add comments where changes are needed.
  3. Click Send Comments.
  4. The agent receives your feedback and makes adjustments.
  5. Check the updated diff.

No copy-pasting. No switching to a chat window. No re-explaining context. Your comments go straight to the agent with the exact file and line context attached.

When to use the diff

During a running session

Check the diff while an agent is still working to see its progress. The diff updates to reflect the current state of the worktree. If you spot an issue early, add a comment and send it before the agent gets further off track.

After completion

Verify the agent made the changes you expected before accepting. Compare the diff against:

  • The task’s acceptance criteria.
  • The plan requirements.
  • Your expectations from the task description.

Quick corrections

If the agent’s work is 95% correct but has a few small issues, use Edit to fix them in place rather than sending the agent back for another full run. This saves time and tokens.

Before a review

Use the diff as evidence when scoring or reviewing a session. It shows exactly what changed — no ambiguity about what the agent touched.

Debugging failures

If a session failed or produced unexpected results, the diff shows what was changed (or not changed) before the failure. Combined with the transcript, this gives you a complete picture of what happened.

Diff vs transcript

The transcript shows how the agent worked — the sequence of decisions, tool calls, and commands. The diff shows what resulted — the actual file changes. Use them together:

QuestionWhere to look
What files were changed?Diff
Why was this file changed?Transcript — find the command or tool call that modified it
Were the changes correct?Diff — review the actual code
Did the agent try something and revert it?Transcript — look for commands that modified then restored files
How do I fix a small mistake?Diff — click Edit on the file
How do I tell the agent to fix it?Diff — add comments and click Send Comments

Next steps

  • Read the Transcript to understand the decisions behind each change.
  • Open the Terminal to run tests or inspect the worktree directly.
  • Check Metadata for the session’s overall stats and model configuration.