Stagent Review
Launch stagent in a tmux split for the user to interactively review unstaged git changes.
User Actions
The user can:
- •Stage approved hunks (
y) - add the hunk to the git index - •Skip hunks (
n) - leave the hunk unstaged - •Edit hunks (
e) - modify the code before staging - •Add comments (
c) - leave feedback for Claude to address - •Split hunks (
s) - break large hunks into smaller pieces - •Quit (
q) - finish the review session
Steps
- •
Run stagent in spawn mode with feedback output:
bashstagent --spawn --output /tmp/stagent-feedback.diff
- •
Tell the user that stagent is now open in a split pane and explain the key bindings.
- •
Wait for the command to complete (the user will stage hunks and quit when done).
- •
Read
/tmp/stagent-feedback.difffor any edit suggestions or comments the user left. - •
If feedback exists:
- •Edits: Apply the suggested changes to the staged code
- •Comments: Address the review comments on the staged code
- •
Report what was staged and what feedback was processed.
Example Output Format
The feedback file contains unified diff format for edits and positioned comments:
diff
# FILE: src/main.rs # HUNK: @@ -10,5 +10,6 @@ fn main() # COMMENT at line 3: Consider adding error handling here # COMMENT at line 5: This function name could be more descriptive
Notes
- •Requires tmux (stagent is a TUI that runs inside tmux)
- •The
--spawnflag handles opening the split and waiting for completion