Feature Request: Dedicated "Explain Code" Command

Hey, thanks for the detailed feature request!

I see the JetBrains screenshot, so it’s clear what kind of UX you mean. A similar request was already posted on the forum here: Creating a keyboard shortcut to explain the text selection? ( and/or any other prompts ).

Right now there’s no native cursorai.action.explainCode command, but there’s a workaround using custom commands: Commands | Cursor Docs.

How to set it up:

  1. Create a file .cursor/commands/explain.md in your project, or ~/.cursor/commands/explain.md for global access:
# Explain Code

Explain the selected code in detail:
-  What it does
-  How it works step by step
-  Important patterns and techniques used
  1. Then the workflow is: select code, Cmd+L, type /explain, press Enter.

It’s not quite one click like in JetBrains, but you don’t have to type “explain this” every time anymore. You can also create /document, /refactor, and other commands the same way.

I’ll pass the request for a proper command with shortcut support to the team.

2 Likes