What is Claude Code?
Claude Code is a command-line AI agent built by Anthropic. Unlike a chat assistant, it operates autonomously in your codebase: reads files, writes and runs code, manages git commits, executes terminal commands, and completes multi-step engineering tasks with minimal input. It runs on Claude Sonnet and connects directly to your local environment — meaning it has real access to your files and terminal, not a sandboxed simulation.
Requirements before you start
The standard CLI setup requires: Node.js 18 or higher (check with node --version), npm or a compatible package manager, an Anthropic API key (create one at console.anthropic.com), a Unix-based terminal (macOS, Linux, or WSL2 on Windows), and billing enabled on your Anthropic account — Claude Code uses the API and token costs apply. Windows without WSL2 is not officially supported.
Installing Claude Code via CLI
Run: npm install -g @anthropic-ai/claude-code. After the install completes, run: claude. On first launch it asks for your Anthropic API key — paste it in and press enter. It gets stored locally in ~/.claude/. To verify the install worked, run: claude --version. Start a session by navigating to a project folder and running: claude. The agent will read your project structure and wait for instructions.
Common setup problems and fixes
Permission errors on npm install: run with sudo on Mac/Linux, or fix npm permissions by changing the global install directory. 'command not found' after install: your npm global bin is not in PATH — add $(npm config get prefix)/bin to PATH in ~/.zshrc or ~/.bashrc and restart your terminal. API key not accepted: make sure you are using an API key (starts with sk-ant-api), not an OAuth token. Billing errors: add a payment method at console.anthropic.com — Claude Code requires a paid Anthropic account. Slow or hanging on first run: Claude Code downloads model metadata on first use, give it 30–60 seconds before assuming it crashed.
The no-setup alternative: managed hosting
If the CLI setup does not fit your workflow — you are on a managed machine, you do not want to install Node.js, or you simply want it running in 60 seconds — managed hosting is the other path. OpenClaw's hosted Claude Code service provisions a dedicated agent in the cloud. You bring your Anthropic API key, select a plan, and get a browser dashboard and Telegram interface immediately. No npm, no PATH configuration, no VPS to maintain. The trade-off is a hosting fee on top of API costs. For non-developers or people who want 24/7 uptime without keeping a laptop running, it is the practical choice.
Which setup method is right for you
Choose the CLI if: you are a developer comfortable with the terminal, you want direct integration into existing dev workflows, you need to use Claude Code locally without a cloud dependency, or you want the lowest possible cost (API only, no hosting fee). Choose managed hosting if: you are not a developer, you want Claude Code accessible from Telegram or browser, you need it running 24/7 without keeping your machine on, you want multiple specialized agents running in parallel, or you want automatic updates and zero infrastructure maintenance. Both options use the same underlying Claude model — the difference is entirely in setup complexity and where the compute runs.
Ready to put this into practice?
Claw gives you a full AI team that handles this kind of work automatically.