Skip to content

Instantly share code, notes, and snippets.

@simrotion13
Created May 14, 2026 19:06
Show Gist options
  • Select an option

  • Save simrotion13/37b329da1372368328c80b753ed65b8b to your computer and use it in GitHub Desktop.

Select an option

Save simrotion13/37b329da1372368328c80b753ed65b8b to your computer and use it in GitHub Desktop.
claude-code-free

Installation Steps for Claude Code Free Setup

Quick reference guide for setting up Claude Code with OpenCode

What is OpenCode?

OpenCode is an AI-powered coding assistant CLI tool that helps with software engineering tasks. It uses various LLM providers including Anthropic Claude.

Website: https://opencode.ai/

What is Claude Code?

Claude Code is Anthropic's official CLI tool for interacting with Claude AI. It can be configured to use OpenCode's free API endpoint instead of Anthropic's direct API.

Product Page: https://claude.com/product/claude-code

Prerequisites

  • Windows 10/11 Machine Running WSL2 Linux Ubuntu Machine
  • Node.js
  • OpenCode Zen account

Linux Installation

1. Upgrade the OS

sudo apt update

2. Install Node.js

sudo apt install nodejs npm

3. Install Claude Code

sudo npm install -g @anthropic-ai/claude-code

4. Configure Settings

Edit ~/.claude/settings.json:

code ~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://opencode.ai/zen",
    "ANTHROPIC_MODEL": "minimax-m2.5-free",
    "ANTHROPIC_API_KEY": "opencode-api-key",
    "ENABLE_TOOL_SEARCH": "true"
  }
}

Environment Variables

Variable Value Description
ANTHROPIC_BASE_URL https://opencode.ai/zen OpenCode API endpoint
ANTHROPIC_MODEL minimax-m2.5-free Model to use
ANTHROPIC_API_KEY opencode-api-key Your OpenCode API key
ENABLE_TOOL_SEARCH true Enable tool search feature

Quick Commands

Command Description
claude -helps To check available commands
claude -p "<prompt>" Run single prompt
claude --version To check current version

Windows Installation

1. Install Node.js

Download from https://nodejs.org/en/download and run the installer.

2. Install Claude Code

npm install -g @anthropic-ai/claude-code

3. Configure Settings

Edit %USERPROFILE%\.claude\settings.json:

code $env:USERPROFILE\.claude\settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://opencode.ai/zen",
    "ANTHROPIC_MODEL": "minimax-m2.5-free",
    "ANTHROPIC_API_KEY": "opencode-api-key",
    "ENABLE_TOOL_SEARCH": "true"
  }
}

Troubleshooting

  • Node not found: Restart terminal after installation or add Node.js to PATH
  • Permission denied: Use sudo on Linux or run as administrator on Windows
  • API errors: Verify your ANTHROPIC_BASE_URL is correctly set to https://opencode.ai/zen

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment