Table of Contents
- Why does the machine Claude Code runs on matter so much?
- How do you install and run Claude Code locally?
- Which account or API key do you need to run Claude Code?
- Why would you run Claude Code on a hosted server instead of your laptop?
- Can you run Claude Code entirely from a browser with Agent 37?
- Should you run Claude Code in headless mode for scheduled jobs?
- Which safeguards keep your API key and code protected on a hosted container?
- When should you still run Claude Code locally?
- Which criteria separated local, VPS, and managed container in our comparison?
- What are the first steps to put Claude Code on an Agent 37 container?
- Which Claude Code setup questions come up most often?
- How do I run Claude Code for the first time?
- Do I need a Claude subscription to run Claude Code?
- Can I run Claude Code on a server so it keeps working when my laptop is closed?
- Does Agent 37 include Claude Code or Anthropic usage in its price?
- How do I run Claude Code without the interactive terminal?
Do not index

To run Claude Code you need Node.js 18 or newer, the CLI installed with npm, and either a Claude subscription or an Anthropic API key; then you open a terminal in a project folder and type claude. If you want it to keep working after you close your laptop, we recommend Agent 37, a managed container starting at $3.99 per month with a full browser terminal, file browser, and live Linux desktop. Agent 37 is not Claude Code, not an Anthropic reseller, and does not sell Claude usage: you bring your own API key, and it goes directly to Anthropic.
Key takeaways
- Local install: Claude Code runs from the terminal after npm install -g @anthropic-ai/claude-code on macOS, Linux, or Windows, and requires Node.js 18 or newer.
- Two ways to authenticate: a Claude Pro or Max subscription covers interactive use, while an Anthropic API key is the better fit for servers, automation, and scheduled jobs.
- Always-on option: Agent 37 gives you an isolated Linux container from $3.99 per month with a browser-based TTY terminal, so long-running Claude Code tasks are not tied to a sleeping laptop.
- Key handling: on Agent 37, API keys go directly to Anthropic and the company never touches them, which keeps the hosting layer out of your credential path.
- Headless mode: claude -p runs a single non-interactive task and exits, which is how you wire Claude Code into cron, CI, or a task board.
Why does the machine Claude Code runs on matter so much?
Running Claude Code means launching Anthropic's terminal-based coding agent inside a project directory so it can read files, edit code, run shell commands, and commit changes on your behalf. It is a command line tool, not a chat window, and it needs Node.js, a shell, and either a Claude subscription or an Anthropic API key.
The practical difference from using Claude in a browser tab is agency. Claude Code can grep your repo, run your test suite, and open a pull request without you pasting anything in. That is why the question of where it runs matters more than it does for a chat assistant.
There are three common answers: your own laptop, a cloud VM you administer yourself, or a managed container like Agent 37 that you reach through the browser. Each one trades convenience for control in a different way, and the rest of this guide walks through when each makes sense. If you are weighing Claude Code against a simpler no-code option, our breakdown of Claude Code versus Custom GPT covers that decision.
How do you install and run Claude Code locally?
Install Claude Code locally by installing Node.js 18 or newer, running npm install -g @anthropic-ai/claude-code, opening a terminal in your project folder, and typing claude. The first launch asks you to sign in with a Claude account or paste an Anthropic API key. On Windows you can use WSL or the native installer.
Here is the sequence we use on a fresh machine:
- Install Node.js 18 or newer (check with node --version).
- Run npm install -g @anthropic-ai/claude-code.
- cd into the repository you want Claude Code to work on.
- Type claude and complete the sign-in prompt.
- Give it a task, for example "explain the auth flow in this repo", and approve the file reads it requests.
Two details trip people up. First, Claude Code only sees the directory you launch it from, so starting it in your home folder is a mistake. Second, it asks permission before edits and shell commands by default; leave those prompts on until you trust the project setup.
Which account or API key do you need to run Claude Code?
You can run Claude Code with either a Claude Pro or Max subscription, which includes Claude Code usage, or with an Anthropic API key billed per token through the Anthropic Console. Subscriptions suit interactive daily use; API keys suit servers, automation, and shared machines where you want usage tied to a specific project budget.
Claude Pro is listed at $20 per month on Anthropic's pricing page; confirm current limits and pricing there, because subscription usage caps change. API billing has no monthly floor, which is why it is the common choice for headless and hosted setups.
If you go the API route, generate the key in the Anthropic Console and set it as the ANTHROPIC_API_KEY environment variable before launching Claude Code. On Agent 37 the same key can also power your OpenClaw agent; the walkthrough on setting up OpenClaw with a Claude API key shows where it goes in the dashboard.

Why would you run Claude Code on a hosted server instead of your laptop?
A hosted server keeps Claude Code running after you close your laptop, so long refactors, scheduled jobs, and background tasks finish without a sleeping machine killing the session. It also gives you one consistent Linux environment reachable from any browser, which matters if you switch between a desktop, a tablet, and a phone during the day.
The second reason is reproducibility. A hosted container has one Node version, one set of tools, and one working directory, so Claude Code behaves the same way every time. That consistency is what Gartner points to when it warns that over 40 percent of agentic AI projects will be canceled by 2027, often because of unclear scope and cost control rather than model quality.
The third reason is access. A browser terminal means you can check on a running job from your phone, which a local terminal cannot offer. Our comparison of SSH versus browser access for remote Claude Code goes deeper on that choice.
Can you run Claude Code entirely from a browser with Agent 37?
On Agent 37, you deploy a managed container with one click, open the browser-based TTY terminal, install Claude Code with npm, and authenticate with your Anthropic API key. The key is sent directly to Anthropic, never touched by Agent 37, and because the container stays online, a job you start in tmux keeps running after you close the tab.
The setup mirrors the local install, just inside the hosted terminal:
- Deploy a container from the Agent 37 dashboard; the full agent stack is live instantly.
- Open the browser terminal and confirm node --version shows 18 or newer.
- Run npm install -g @anthropic-ai/claude-code.
- Export ANTHROPIC_API_KEY, then run claude inside your project folder.
- For long tasks, start a tmux session first so the process survives a dropped connection.
What you get beyond the terminal is the rest of the Agent 37 toolset: a visual file browser for reviewing what Claude Code changed, a live Linux desktop via noVNC when you need a GUI, and a task board for assigning work, reviewing outputs, and scheduling recurring jobs. The platform also handles automatic runtime updates and security patches, so you are not maintaining a server to keep a coding agent alive.
To be clear about scope: Agent 37 is a managed host for OpenClaw and Hermes agents, and Claude Code runs there because the container is a standard Linux environment you fully control. It is not a replacement for Anthropic's own web version of Claude Code, and it does not include Claude usage in the price.
Should you run Claude Code in headless mode for scheduled jobs?
Yes, when the work is repeatable. Claude Code's print mode, claude -p "your prompt", runs a single non-interactive task and exits, which makes it easy to call from cron, CI pipelines, or a task scheduler. Pair it with an API key rather than a subscription login so the job never waits on a browser sign-in.
Good candidates for headless runs are tasks with a clear input and a checkable output: nightly dependency audits, test generation for files changed that day, changelog drafts from merged commits. Bad candidates are open-ended tasks like "improve the codebase", which burn tokens with no stopping rule.
On Agent 37, the built-in task board handles the scheduling side, so you can set a recurring job and review its output in the same place. The guide to running Claude Code as a background agent covers prompt structure and guardrails for unattended runs.

Which safeguards keep your API key and code protected on a hosted container?
It is safe when the container is isolated, your API key never passes through a third party, and Claude Code's permission prompts stay enabled for destructive actions. Agent 37 runs each workspace in its own isolated container and routes keys directly to Anthropic, which removes the host as a place where credentials could leak.
Container isolation is the baseline, not a bonus. The NIST Application Container Security Guide (SP 800-190) lists shared kernels, image vulnerabilities, and over-privileged containers as the main risks, and a managed platform that applies security patches automatically addresses two of the three for you.
Three habits close the remaining gap. Use a project-scoped API key with a spend limit set in the Anthropic Console. Keep Claude Code's permission prompts on for shell commands and file deletes. And do not mount production secrets into the container unless the task genuinely needs them.
When should you still run Claude Code locally?
Run Claude Code locally when your codebase is large and already on your machine, when you need native GUI tools or device-specific builds, or when company policy forbids code leaving managed laptops. Local runs also cost nothing beyond your Anthropic usage, which makes them the right default for quick, one-off edits.
Mobile and desktop app development is the clearest case: an iOS build needs Xcode on a Mac, and no Linux container will substitute for that. Regulated teams with device-only data policies are the second case, and a laptop with disk encryption is simpler to audit than a cloud host.
If you want full control of the host but still want it always on, a self-managed VPS from providers like Hetzner or DigitalOcean sits between local and managed; pricing for both is published on their sites. The trade-off is that you own patching, backups, and uptime. We lay out those options in our guide to self-hosting Claude Code.
Which criteria separated local, VPS, and managed container in our comparison?
We compared three ways to run Claude Code: a local install, a self-managed cloud VM, and a managed container on Agent 37. For each, we looked at published setup requirements, the published monthly price where one exists, whether sessions persist after disconnect, and how the Anthropic API key is stored and transmitted.
We did not run benchmark timings, and Claude Code itself behaves the same on all three; the differences are entirely about uptime, access, and who maintains the machine.
What are the first steps to put Claude Code on an Agent 37 container?
Create an Agent 37 account, deploy a managed container starting at $3.99 per month, open the browser terminal, install Claude Code, and paste your Anthropic API key. The whole path takes a few minutes and needs no server administration, because runtime updates and security patches are handled for you by the platform.
If you are ready to run Claude Code somewhere that stays online, deploy your first Agent 37 container and have a browser terminal open in the time it takes to read this sentence.
Which Claude Code setup questions come up most often?
How do I run Claude Code for the first time?
Install Node.js 18 or newer, run npm install -g @anthropic-ai/claude-code, open a terminal inside the project you want to work on, and type claude. The first launch asks you to sign in with a Claude account or provide an Anthropic API key, then you can give it a task in plain English.
Do I need a Claude subscription to run Claude Code?
No. You can run Claude Code with a Claude Pro or Max subscription, which includes Claude Code usage, or with an Anthropic API key billed per token. API keys are the better fit for servers and scheduled jobs because nothing waits on a browser sign-in.
Can I run Claude Code on a server so it keeps working when my laptop is closed?
Yes. Install it on any Linux machine with Node.js 18 or newer and start long tasks inside tmux or screen. Agent 37 offers this as a managed container from $3.99 per month with a browser terminal, so you do not have to administer the server yourself.
Does Agent 37 include Claude Code or Anthropic usage in its price?
No. Agent 37 is a managed hosting platform for OpenClaw and Hermes agents starting at $3.99 per month. You bring your own Anthropic API key, which goes directly to Anthropic, and Claude Code is installed in the container like on any Linux machine.
How do I run Claude Code without the interactive terminal?
Use print mode: claude -p "your prompt" runs one non-interactive task and exits. Set ANTHROPIC_API_KEY in the environment first, then call it from cron, a CI pipeline, or a scheduler such as the Agent 37 task board for recurring jobs.