Use your Claude API key in VS Code as a coding agent
Claude is one of the strongest models for agentic coding. Stoat lets you use it in the VS Code you already have, with your own Anthropic API key, paying only for what you use.
1. Get an Anthropic API key
- Sign in at console.anthropic.com, add billing, and create an API key.
What about Claude Pro or Max? A subscription can't be used here. Anthropic only allows subscription logins in Claude.ai and Claude Code; other tools, including Stoat, must use an API key (or Claude through your company's cloud such as AWS Bedrock, Google Vertex or Microsoft Foundry).
2. Install Stoat
- Install Stoat. In VS Code open Extensions (Ctrl+Shift+X), search Stoat and install Stoat – AI Coding Agent. (Cursor, Windsurf and VSCodium find it on Open VSX the same way.)
- Open your project folder and click the Stoat icon in the activity bar (or press Ctrl+Shift+L).
3. Connect Claude
- In Connect a model, pick Anthropic (Claude).
- Paste the key and click Save & connect.
- Pick a Claude model in the model menu at the top of the panel.
4. Let it work, then review
Use Plan mode to agree on an approach first, then Build, or go straight to Agent mode.
When the agent finishes, a review bar lists every file it changed. Click a file to see the diff, then
Keep or Undo it (or Keep all / Undo all). Commands such as
npm test or dotnet build always wait for your approval first.
Keeping costs in check
- Turn on Settings → Show Metrics to see the cost of every reply.
- Stoat orders its prompts so Claude's prompt caching applies, which lowers the cost of long sessions.
- Add a cheaper provider too (DeepSeek, Gemini) and switch per message for simple tasks.
FAQ
Can I use my Claude Pro subscription in VS Code extensions?
No. Anthropic allows subscription logins only in Claude.ai and Claude Code. Third-party tools like Stoat need an API key from console.anthropic.com.
Where is my Anthropic key stored?
In VS Code's secret storage on your machine. It is never written to a settings file and is sent only to Anthropic.
Stoat is free and open source. Small agent, takes on the big ones.
More guides: How to use DeepSeek as a coding agent in VS Code · Run a free, local AI coding agent in VS Code with Ollama · Use Gemini, Groq or OpenRouter as a coding agent in VS Code · An open-source Cursor alternative for VS Code