Review changes like a PR, without leaving terminal. tdiff is a local review canvas where humans and agents talk on top of a diff.
Threads attach to changed lines/ranges, persist in the repo, and are available to agents as JSON/events.
Use r to start a multi-line select then a to start a thread.
Toggle syntax on and off with x.
go install github.com/owenps/tdiff@latest
tdiffDefault view shows branch changes plus staged/unstaged/untracked working tree changes.
For GitHub integration, install the gh CLI.
There is no included skill, just tell your agent to use tdiff and it will learn through the CLI.
To monitor and react to events, tell your agent:
Use tdiff for review comments. Run `tdiff agent help`, then wait for my tdiff review events and respond in threads.
Agent loop:
tdiff agent inbox --json
tdiff review watch
tdiff thread reply T123 --actor agent --body "Fixed; added test"
tdiff agent waittdiff review watch emits compact text events. Use --json for JSONL.
tdiff agent wait waits until the current diff is approved or blocking review threads appear. It always prints final status. Exit codes: 0 approved, 2 blocked, 124 timeout, 1 error.
tdiff --base main
tdiff --staged
tdiff --unstaged
tdiff --offline
tdiff --debug # write .git/tdiff/debug.log
tdiff agent help
tdiff agent inbox --json
tdiff agent inbox 5 --json
tdiff agent wait # exits 0 when current diff is approved
tdiff agent wait --timeout 30m
# agent/review API
tdiff review status --json
tdiff review context --json
tdiff review approve
tdiff review unapprove
tdiff review watch
# event history / JSONL if needed:
tdiff review events
tdiff review watch --json
tdiff thread list --json
tdiff thread show T123 --json
tdiff thread add --file internal/foo.go --line 42 --side new --body "Needs nil check"
tdiff thread reply T123 --actor agent --body "Fixed and added test"
tdiff thread resolve T123
tdiff thread reopen T123
# use --body - to read long thread text from stdin
tdiff stores review data locally in your repo:
.git/tdiff/review.json
.git/tdiff/events.jsonlThis includes review approval, threads, messages, viewed-file state, and GitHub PR metadata.
Run tdiff --debug to write integration/debug failures to .git/tdiff/debug.log.
- ? show/hide keybind help modal
- q quit
- j/k move line
- gg/G jump top/bottom
- ]h/[h next/previous hunk
- ]t/[t next/previous thread
- :line jump to file line in current diff
- n/p move file
- v toggle viewed; marking viewed jumps to next unviewed file
- A approve/unapprove current review snapshot
- u hide/show viewed files
- m show files with threads only
- y copy selected thread
- Y copy all threads JSON
- W toggle whitespace handling/reload diff
- R refresh diff and sync GitHub PR threads
- s toggle split/unified placeholder
- # attach/change GitHub PR (disabled with
--offline) - b show/hide left sidebar
- i show/hide inline threads
- x toggle syntax highlighting
- c toggle context dimming
- w wrap cursor line
- L toggle line numbers
- r start/cancel line range
- a add/edit thread on selected line/range
- z resolve/reopen selected thread, including GitHub threads
- enter reply to selected thread
- e edit thread on selected line/range
- d delete thread on selected line/range
- ⌥+enter save thread
- esc cancel thread
go run .
go test ./...


