Add "Diff of Staging Area" to @git command

Currently, the @git command provides two useful options:

  1. Diff with Main Branch
  2. Diff of Working State

These are great for quickly viewing differences between the current file and the main branch or the working state.

However, I think it would be incredibly beneficial to also include an option to view the diff of the Git staging area (eg. git diff --cached / git diff --staged). This would be particularly useful when asking the AI assistant to generate commit messages based on the staged changes, or just as a way to point Cursor to the diff of certain files.

By having access to the diff of the staging area, the AI can provide more accurate and contextual commit messages, taking into account only the changes that are currently staged for committing.

5 Likes

I have the exact same use case. Cursor is really handy in generating commits especially when combined with rules for ai. I would love to have an additional @Staged command since right now I am unstaging, using the diff context and then staging my changes again.

1 Like

I would also love to see this implemented, for a very important reason: the working tree does not include new, untracked files. Therefore, there is no way (AFAIK) to ask Cursor to conduct a code review of a diff that includes new files.

The intuitive approach is to add everything to staging and ask Cursor to review the diff in staging.

2 Likes