C

Claude Code

by Anthropic

Use Claude Code remotely via CloudForge - code from anywhere with AI assistance

What is Claude Code?

Claude Code is Anthropic's official terminal-based AI coding assistant. It can understand your codebase, write code, run commands, and help you build software.

Prerequisites

  • CloudForge Agent installed and connected (setup guide)
  • A Claude subscription (Pro, Max 5x, or Max 20x) or Anthropic API key

Step 1: Install Claude Code

Connect to your server via CloudForge terminal and install Claude Code:

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

Or with npx (no installation required):

npx @anthropic-ai/claude-code

Step 2: Authenticate

Claude Code supports two authentication methods:

Option A: Subscription (Recommended)

If you have a Claude Pro or Max subscription, authenticate with your Anthropic account. This gives you the best experience and usage limits.

claude /login

Remote Authentication

The /login command opens a browser for OAuth. On a remote server without a display, you'll see a URL to open on your local machine. Complete the auth there, then paste the code back.

Option B: API Key

If you prefer to use an Anthropic API key (pay-as-you-go):

export ANTHROPIC_API_KEY=sk-ant-xxx
claude

To persist the API key, add it to your shell profile:

echo 'export ANTHROPIC_API_KEY=sk-ant-xxx' >> ~/.bashrc
source ~/.bashrc

Step 3: Start Coding!

Navigate to your project and start Claude Code:

cd ~/my-project
claude

You can also start with a specific task:

claude "Add a login form to the homepage"

Usage Tips

Subscription Plans

PlanPriceUsage (5h window)Best For
Pro$20/mo10-40 promptsCasual use
Max 5x$100/mo50-200 promptsRegular coding
Max 20x$200/mo200-800 promptsHeavy use / Teams

Useful Commands

CommandDescription
claudeStart interactive mode
claude "task"Start with a specific task
claude /loginAuthenticate with Anthropic
claude /logoutLog out
claude /helpShow help
/clearClear conversation (in session)
/compactSummarize conversation (in session)

Configuration File

Create a CLAUDE.md file in your project root to give Claude context about your project:

# My Project

## Overview
This is a SvelteKit web app with Supabase backend.

## Tech Stack
- SvelteKit
- TypeScript
- Tailwind CSS
- Supabase

## Development
- `pnpm dev` - Start dev server
- `pnpm build` - Build for production
- `pnpm test` - Run tests

Troubleshooting

Authentication Issues

If /login fails on a remote server, you can authenticate on your local machine and copy the auth file to the server:

On your local machine:
cat ~/.config/claude-code/auth.json
Copy the content and on your server:
mkdir -p ~/.config/claude-code
nano ~/.config/claude-code/auth.json
Paste the content and save

Rate Limits

If you hit rate limits, wait for the cooldown period or upgrade to a higher plan. The Max plans have significantly higher limits.

Connection Issues

Claude Code needs internet access. Ensure your server can reach api.anthropic.com.