Skip to content

Latest commit

Β 

History

History
59 lines (44 loc) Β· 1.32 KB

File metadata and controls

59 lines (44 loc) Β· 1.32 KB

Claude Code Docker Server

HTTP API wrapper for Claude Code CLI in a Docker container.

Features

  • 🐳 Fully containerized Claude Code CLI
  • πŸ” OAuth (subscription) authentication via Claude CLI
  • πŸ’Ύ Authentication persists permanently using Docker volumes
  • πŸ“ Optional workspace mounting for code access
  • πŸ›‘οΈ Simple HTTP API interface
  • πŸ“Š Human-friendly logging with clear sections
  • πŸ” Shows full prompts, verbose Claude output, and responses
  • ⏱️ Performance metrics and duration tracking

Quick Start

docker compose up -d

First-time auth (follow OAuth URL in logs):

# Access the container shell interactively
docker compose exec -it claude-code-server /bin/bash

# Inside the container, run:
claude login

# Follow the authentication prompts (it will provide a URL to authenticate in your browser)
# Exit the container when done
exit

Test request:

curl -X POST http://localhost:8888/claude \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"hello world"}'

API

POST /claude

{"prompt": "Your prompt", "args": ["--optional"], "cwd": "/workspace"}

GET /healthz - Health check

Configuration

Mount workspace in docker-compose.yml:

volumes:
  - ./your-project:/workspace

Reset auth: docker volume rm claude-code-server_claude-auth