
If you already write Python in Visual Studio Code, the quickest way to try Claude is to open a file and ask about a few lines. Anthropic’s Claude Code extension puts that conversation beside the editor. The extension runs on your laptop and contacts the configured model service over the network. A supported account or provider configuration is required.
1. Install the extension published by Anthropic
- Open the desktop version of Visual Studio Code. Check Help → About for your version. Anthropic lists VS Code 1.94.0 or newer.
- Open Extensions with Ctrl+Shift+X on Windows or Linux, or Cmd+Shift+X on macOS.
- Search for
@id:anthropic.claude-code. Open Claude Code for VS Code, check that the publisher is Anthropic, and click Install. You can also open the official Marketplace listing.
2. Open the panel and sign in
Open a folder you created, then open a file in it. Click the Claude spark icon near the upper right of the editor. Another route is the Command Palette (Ctrl+Shift+P or Cmd+Shift+P): type Claude Code and choose Open in New Tab. Follow the sign in prompt in the panel and finish in your browser. Return to VS Code when authentication completes. If your team uses a managed provider, use the sign in method your administrator configured.
3. Check the connection with a tiny Python example
Create example.py in that folder, paste the following code, and save it.
def above_limit(values, limit):
return [value for value in values if value > limit]
print(above_limit([2, 5, 8], 5))In Claude’s panel, type @example.py, choose the file from the suggestions, and ask: What will this print, and why is 5 missing? Explain without editing the file. The expected Python output is [8]. The strict comparison excludes a value equal to the limit. This gives you a quick way to check whether Claude read the right file.
For a first edit, ask Claude to include values equal to the limit. Review the proposed change from > to >=. After accepting it, run python example.py in your Python environment. The output should now be [5, 8].
If the spark icon or terminal command is missing
No icon: Open a file first. In the Command Palette, run Developer: Reload Window. Check the extension is enabled for this workspace. If VS Code shows Restricted Mode, try the example in a folder you created and trust.
The panel works, but the terminal says “claude” is unknown: The extension bundles what its panel needs. The standalone terminal command has a separate installation. You can complete this tutorial entirely in the panel.
No comments:
Post a Comment