DEV Community

Cover image for Use Free Claude Code with Opus 5 in VS Code: CLI and Extension Setup
Md. Shafiuddin Shajib
Md. Shafiuddin Shajib

Posted on

Use Free Claude Code with Opus 5 in VS Code: CLI and Extension Setup

If you want to get your first practical experience with Claude Code and Opus 5, this setup is worth trying while free promotional credits are available.

The focus is simple:

Claude Code + Opus 5 + VS Code + CLI + Extension

Get the Free AI Credits

Start here:

šŸ‘‰ Get Free AI Credits for Claude Code

Sign up with GitHub and complete the required verification. If your account is eligible, check the available credits in your dashboard and create an API key.

Keep your API key private. Never commit it to GitHub or share it publicly.

1. Install Node.js

Claude Code requires Node.js 18 or later.

Check your version:

node --version
Enter fullscreen mode Exit fullscreen mode

2. Install Claude Code CLI

Open PowerShell or the VS Code terminal:

npm install -g @anthropic-ai/claude-code@latest
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

claude --version
Enter fullscreen mode Exit fullscreen mode

3. Configure Claude Code

On Windows PowerShell, set the required environment variables:

[Environment]::SetEnvironmentVariable(
  "ANTHROPIC_AUTH_TOKEN",
  "YOUR_AGENTROUTER_API_KEY",
  "User"
)

[Environment]::SetEnvironmentVariable(
  "ANTHROPIC_BASE_URL",
  "https://agentrouter.org",
  "User"
)

[Environment]::SetEnvironmentVariable(
  "ANTHROPIC_MODEL",
  "claude-opus-5",
  "User"
)
Enter fullscreen mode Exit fullscreen mode

Replace YOUR_AGENTROUTER_API_KEY with your own API key.

Then completely restart VS Code.

4. Test Claude Code

Open a new VS Code terminal:

claude -p "Reply with exactly: OK"
Enter fullscreen mode Exit fullscreen mode

If you receive:

OK
Enter fullscreen mode Exit fullscreen mode

the connection is working.

Now start Claude Code:

claude
Enter fullscreen mode Exit fullscreen mode

For your first test, use a read-only request:

List the files in the current directory and tell me whether README.md exists. Do not modify anything.
Enter fullscreen mode Exit fullscreen mode

This is a simple way to confirm that Claude Code can access your project before allowing it to make changes.

5. Use Claude Code in VS Code

You can run Claude Code directly from the VS Code integrated terminal and use the Claude Code VS Code extension for a more integrated workflow.

From there, you can gradually experiment with:

  • Understanding an existing project
  • Explaining unfamiliar code
  • Debugging problems
  • Refactoring code
  • Writing tests
  • Implementing small changes
  • Reviewing your own implementation

Start with small tasks and gradually give the agent more responsibility as you become comfortable with how it works.

6. Keep Codex and Claude Code Separate

If you already use Codex, remember that Claude Code has its own configuration.

Claude Code uses:

ANTHROPIC_AUTH_TOKEN
ANTHROPIC_BASE_URL
ANTHROPIC_MODEL
Enter fullscreen mode Exit fullscreen mode

These are separate from your Codex configuration.

Is It Really Free?

The free usage comes from promotional AI credits, so it should not be considered unlimited or permanently free. Credit availability, model access, eligibility, and usage limits can change.

For learning and getting initial development experience with Claude Code and Opus 5, however, it is a useful opportunity to try an AI coding agent without immediately paying for another subscription.

Start Here

šŸ‘‰ Get Free AI Credits and Try Claude Code

Sign up with GitHub, check your available credits, create your API key, and follow the steps above.

If you are new to Claude Code, this gives you a straightforward way to start experimenting with Opus 5, Claude Code CLI, VS Code, and AI assisted development.

ClaudeCode #Claude #Opus5 #AICoding #CodingAgents #VSCode #AI #SoftwareDevelopment #DeveloperTools

Top comments (0)