jesseduffield / jesseduffield/lazygit

Auto-follow latest changed file in Files panel ("follow mode")

Open
#5,337 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Is your feature request related to a problem? Please describe.

I've been using AI agents and have been experimenting with a split-terminal setup in which I run my agent eg. Claude Code in one pane and observe changes in another pane. I'd like to use Lazygit to observe the diff of the last file that was changed in realtime ie. the Unstaged changes diff view will show what's last changed.

Basically similar to the [follow-along mode](https://antigravity.google/docs/conversation-view) in Antigravity.

### Describe the solution you'd like

An option to auto-focus the most recently modified file in the Files panel, so the Unstaged Changes panel automatically shows the diff of the latest changed file. This could be:

- A config option like `gui.autoSelectLatestChange: true`
- Or a keybinding to toggle "follow mode" (similar to `tail -f` for diffs)

When enabled, whenever the file list refreshes and detects a new or updated file, it would automatically move the cursor to that file and display its diff.

### Describe alternatives you've considered

- **Manually navigating with `j`/`k`** — works but defeats the purpose of real-time monitoring, especially when an agent is rapidly changing multiple files.
- **Using `watch git diff` in a separate terminal** — gives raw real-time output but lacks lazygit's structured UI and navigation.
- **Diffview.nvim** — offers a diff browser but doesn't auto-follow latest changes either and is tied to Neovim.
- **A custom command using lazygit's custom command system** — explored this but there's no hook for "on file list change" to trigger a cursor move.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.