Skip to content

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

@shaikhspeare

Description

@shaikhspeare

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions