Worktree Diff
The Worktree Diff tab renders changes from the agent’s worktree directly in the session view. Switch between view modes, edit files, apply the changes to your repository checkout, or send comments and rejection feedback to the agent.
What the diff shows
The diff includes committed, uncommitted, and newly created files. Check the comparison base when reviewing an older session so you know which changes are included. You can inspect:
- 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
Accept All applies the session’s changes to the current branch in your main repository checkout. Check that checkout and branch before accepting. Review and commit the applied changes through your normal Git process; accepting does not merge branches or create a commit.
If your local changes conflict, resolve them before trying again. The error includes a saved patch path you can inspect.
Reject All
Reject All asks for a required explanation, then sends the rejected file list and any inline comments to the agent as feedback. It leaves the worktree files in place. Use it to request a different approach or specific corrections, then inspect the agent’s response and updated diff.
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:
- Review the diff.
- Add comments where changes are needed.
- Click Send Comments.
- The agent receives your feedback and makes adjustments.
- 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:
| Question | Where 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.