How to stop the Claude Code VS Code extension from attaching your selected code
The Claude Code extension for VS Code automatically adds text you've selected in the editor to your message. The prompt box footer shows how many lines are selected. If you don't want a stray selection going along with every message, turn this off.
To leave it out just once, click the X on the selection indicator. It comes back when you select other text.
To turn it off for good, use the claudeCode.attachSelection setting added in 2.1.300 (October 14). Open VS Code settings (Cmd+, on Mac, Ctrl+, on Windows/Linux), search for that name and switch it off. It's only in the changelog so far, not in the extension settings table in the docs, so follow what the settings screen shows for its value. The extension must be 2.1.300 or later for it to appear.
To point Claude at a selection by file path and line numbers, press Option+K (Mac) / Alt+K (Windows/Linux). It inserts a mention like @app.ts#5-10.
@app.ts#5-10 find where this function misses null handling
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.