{"id":31761423,"url":"https://github.com/nezhar/claude-container","last_synced_at":"2026-03-05T11:06:40.835Z","repository":{"id":309181882,"uuid":"1035400085","full_name":"nezhar/claude-container","owner":"nezhar","description":"Container workflow for Claude Code. Complete isolation from host system while maintaining persistent credentials and workspace access.","archived":false,"fork":false,"pushed_at":"2026-02-21T08:31:42.000Z","size":268,"stargazers_count":128,"open_issues_count":5,"forks_count":17,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-21T16:08:49.138Z","etag":null,"topics":["claude","claude-ai","claude-code","docker","hacktoberfest","llm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nezhar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-10T10:12:15.000Z","updated_at":"2026-02-21T08:30:46.000Z","dependencies_parsed_at":"2025-08-10T12:22:57.778Z","dependency_job_id":"b97fbf9b-d763-45d0-ad87-86fd351310c8","html_url":"https://github.com/nezhar/claude-container","commit_stats":null,"previous_names":["nezhar/claude-container"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/nezhar/claude-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezhar%2Fclaude-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezhar%2Fclaude-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezhar%2Fclaude-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezhar%2Fclaude-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nezhar","download_url":"https://codeload.github.com/nezhar/claude-container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezhar%2Fclaude-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30121125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T10:44:24.758Z","status":"ssl_error","status_checked_at":"2026-03-05T10:44:15.079Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","claude-ai","claude-code","docker","hacktoberfest","llm"],"created_at":"2025-10-09T21:50:47.139Z","updated_at":"2026-03-05T11:06:40.768Z","avatar_url":"https://github.com/nezhar.png","language":"Shell","funding_links":[],"categories":["claude-code"],"sub_categories":[],"readme":"# Claude Container\n\nA Docker container with Claude Code pre-installed and ready to use.\n\nThis container includes all necessary dependencies and provides an easy way to run Claude Code in an isolated environment.\n\nAn optional proxy can be enabled to track all the requests made by Claude Code in a local SQLite database.\n\n## Available Images\n\nThree Docker images are available on Docker Hub, all released with matching version tags:\n\n| Image | Purpose | Base |\n|-------|---------|------|\n| [nezhar/claude-container](https://hub.docker.com/r/nezhar/claude-container) | Main container with Claude Code CLI pre-installed | Node.js 22 Alpine |\n| [nezhar/claude-proxy](https://hub.docker.com/r/nezhar/claude-proxy) | Optional HTTP proxy that logs all API requests to SQLite | Python 3.12 Alpine |\n| [nezhar/claude-datasette](https://hub.docker.com/r/nezhar/claude-datasette) | Optional web UI for visualizing and querying logged requests | Datasette + plugins |\n\n### Architecture Overview\n\nWhen using all three images together, the request flow looks like this:\n\n```\n┌─────────────────┐      ┌──────────────────┐      ┌─────────────────────┐\n│ claude-container│─────▶│  claude-proxy    │─────▶│  api.anthropic.com  │\n│  (Claude Code)  │      │   (HTTP Proxy)   │      │   (Anthropic API)   │\n└─────────────────┘      └────────┬─────────┘      └─────────────────────┘\n                                  │\n                                  ▼\n                         ┌─────────────────┐\n                         │  requests.db    │\n                         │   (SQLite)      │\n                         └────────┬────────┘\n                                  │\n                                  ▼\n                         ┌─────────────────┐\n                         │claude-datasette │\n                         │   (Web UI)      │\n                         └─────────────────┘\n                         http://localhost:8001\n```\n\n**Standalone Usage:**\n- Use **claude-container** alone for basic Claude Code functionality\n- Add **claude-proxy** when you need API request logging\n- Add **claude-datasette** when you want to visualize and analyze logs\n\n## Compatibility Matrix\n\n**Latest Release:** 1.6.10 (Claude Code 2.1.50)\n\n| Container Version | Claude Code Version |\n|-------------------|---------------------|\n| 1.0.x             | 1.0.x               |\n| 1.1.x             | 2.0.x               |\n| 1.2.x             | 2.0.x               |\n| 1.3.x             | 2.0.x               |\n| 1.4.x             | 2.0.x               |\n| 1.5.x             | 2.1.x               |\n| 1.6.x             | 2.1.x               |\n\n## Quick Start\n\n### Using the Helper Script (Recommended)\n\nThe easiest way to run Claude Container is using the provided bash script. Download and install it with:\n\n```bash\n# Download the script directly from GitHub\ncurl -o ~/.local/bin/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/bin/claude-container\n\n# Make it executable\nchmod +x ~/.local/bin/claude-container\n\n# Run Claude Code\nclaude-container\n```\n\nMake sure `~/.local/bin` is in your PATH. Alternatively, install to `/usr/local/bin`:\n\n```bash\n# Download and install system-wide (requires sudo)\nsudo curl -o /usr/local/bin/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/bin/claude-container\nsudo chmod +x /usr/local/bin/claude-container\n```\n\nThe script handles all Docker configuration automatically and supports additional features like API logging. Run with `--help` to see all available options:\n\n```bash\nclaude-container --help\n```\n\n#### Optional: Enable Tab Completion\n\nTo enable bash tab completion for the `claude-container` command:\n\n```bash\n# Download and install completion script\nmkdir -p ~/.local/share/bash-completion/completions\ncurl -o ~/.local/share/bash-completion/completions/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/completions/claude-container\n\n# Reload your shell or start a new terminal session\nsource ~/.bashrc\n```\n\nOnce installed, you can use tab completion with `claude-container --\u003cTAB\u003e` to see all available options\n\n#### Updating to the Latest Version\n\nTo update to the latest version, simply re-download the helper script and completions:\n\n```bash\n# Update helper script (user install)\ncurl -o ~/.local/bin/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/bin/claude-container\n\n# Or for system-wide install\nsudo curl -o /usr/local/bin/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/bin/claude-container\n\n# Update completions (if installed)\ncurl -o ~/.local/share/bash-completion/completions/claude-container https://raw.githubusercontent.com/nezhar/claude-container/main/completions/claude-container\n\n# Verify the new version\nclaude-container --version\n```\n\nThe helper script will automatically pull the latest Docker images when needed.\n\n### Using Docker Compose\n\nCreate a `compose.yml` file as provided in the example folder. \n```bash\ndocker compose run claude-code claude\n```\n\nYou will need to login for the first time, afterwards your credentials and configurations will be stored inside a bind mount volume, make sure this stays in your `.gitignore`.\n\n### Using Docker directly\n\n\n```bash\ndocker run --rm -it -v \"$(pwd):/workspace\" -v \"$HOME/.config/claude-container:/claude\" -e \"CLAUDE_CONFIG_DIR=/claude\" nezhar/claude-container:latest claude\n```\n\nThis will store the credentials in `$HOME/.config/claude-container` and will be able to reuse them after the first login.\n\n## How does the authentication work\n\nWhen you run the container for the first time, you'll go through the following authentication steps:\n\n1. **Choose Color Schema**: Select your preferred terminal color scheme\n\n   ![Color Schema Selection](docs/auth1.png)\n\n2. **Select Login Method**: Choose between Subscription or Console login (this example uses Subscription)\n\n   ![Login Method Selection](docs/auth2.png)\n\n3. **Generate Token**: Open the provided URL in your browser to generate an authentication token, then paste it into the prompt\n\n   ![Token Generation](docs/auth3.png)\n\n4. **Success**: You're authenticated and ready to use Claude Code\n\n   ![Authentication Success](docs/auth4.png)\n\n## Integration with Existing Projects\n\nTo integrate Claude Container into an existing Docker Compose project, create a `compose.override.yml` file:\n\n```yaml\nservices:\n  claude-code:\n    image: nezhar/claude-container:latest\n    volumes:\n      - ./workspace:/workspace\n      - ./claude-config:/claude\n    environment:\n      CLAUDE_CONFIG_DIR: /claude\n    profiles:\n      - tools\n```\n\nThen run Claude Code with:\n\n```bash\n# Using profiles to avoid starting by default\ndocker compose --profile tools run claude-code claude\n```\n\nThis approach keeps Claude Code separate from your main application services while allowing easy access when needed.\n\n## API Request Logging Proxy\n\nThis repository includes an optional logging proxy that captures all Anthropic API requests and responses to a SQLite database. This is useful for:\n\n- Debugging API interactions\n- Monitoring token usage and costs\n- Analyzing request/response patterns\n- Building custom analytics tools\n\n### Running with Docker\n\n**Run Claude Container directly:**\n```bash\ndocker run --rm -it \\\n  -v \"$(pwd):/workspace\" \\\n  -v \"$HOME/.config/claude-container:/claude\" \\\n  -e \"CLAUDE_CONFIG_DIR=/claude\" \\\n  nezhar/claude-container:latest claude\n```\n\n**Run with logging proxy:**\n```bash\n# 1. Create a Docker network\ndocker network create claude-network\n\n# 2. Start the proxy container\ndocker run -d --name claude-proxy \\\n  --network claude-network \\\n  -v \"$(pwd)/proxy-data:/data\" \\\n  -p 8080:8080 \\\n  nezhar/claude-proxy:latest\n\n# 3. Run Claude Code (configured to use the proxy)\ndocker run --rm -it \\\n  --network claude-network \\\n  -v \"$(pwd):/workspace\" \\\n  -v \"$HOME/.config/claude-container:/claude\" \\\n  -e \"CLAUDE_CONFIG_DIR=/claude\" \\\n  -e \"ANTHROPIC_BASE_URL=http://claude-proxy:8080\" \\\n  nezhar/claude-container:latest claude\n\n# 4. Cleanup when done\ndocker stop claude-proxy\ndocker rm claude-proxy\ndocker network rm claude-network\n```\n\n### Proxy Configuration\n\nThe proxy supports the following environment variables:\n\n- `PROXY_PORT`: Port to listen on (default: `8080`)\n- `TARGET_API_URL`: Target API URL (default: `https://api.anthropic.com`)\n- `DB_PATH`: SQLite database path (default: `/data/requests.db`)\n\n## Data Visualization with Datasette\n\nThis repository includes a Datasette container for exploring and visualizing the API request logs captured by the proxy. Datasette provides a web-based interface to explore your SQLite database with filtering, sorting, and export capabilities.\n\n### Features\n\n- **Browse Request Logs**: View all API requests with filtering and sorting\n- **JSON Visualization**: Pretty-print JSON request/response bodies\n- **Analytics**: Analyze request patterns, response times, and error rates\n- **Export Data**: Export filtered results to CSV, JSON, or Excel\n- **SQL Queries**: Run custom SQL queries against your data\n\n### Running with Datasette\n\nWhen using Docker Compose, you can add the Datasette service to visualize your proxy data:\n\n```yaml\nservices:\n  claude-proxy:\n    image: nezhar/claude-proxy:latest\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - ./proxy-data:/data\n\n  claude-datasette:\n    image: nezhar/claude-datasette:latest\n    ports:\n      - \"8001:8001\"\n    volumes:\n      - ./proxy-data:/data:ro\n    depends_on:\n      - claude-proxy\n\n  claude-code:\n    image: nezhar/claude-container:latest\n    volumes:\n      - ./workspace:/workspace\n      - ./claude-config:/claude\n    environment:\n      CLAUDE_CONFIG_DIR: /claude\n      ANTHROPIC_BASE_URL: http://claude-proxy:8080\n    depends_on:\n      - claude-proxy\n```\n\nStart the services:\n```bash\ndocker compose up -d claude-proxy claude-datasette\ndocker compose run claude-code claude\n```\n\nThen access Datasette at http://localhost:8001 to explore your API request logs.\n\n### Using Datasette\n\nOnce Datasette is running:\n\n1. **View All Requests**: Navigate to the `request_logs` table to see all captured API requests\n2. **Filter Data**: Use the faceted filters to narrow down by HTTP method, status code, etc.\n3. **Examine Details**: Click on individual requests to see full headers and JSON bodies\n4. **Run Queries**: Use the SQL interface to run custom analytics queries\n5. **Export Results**: Export filtered data in various formats for further analysis\n\nExample queries you might run:\n\n```sql\n-- Average response time by endpoint\nSELECT path, AVG(duration_ms) as avg_duration, COUNT(*) as request_count\nFROM request_logs\nGROUP BY path\nORDER BY avg_duration DESC;\n\n-- Requests with errors\nSELECT timestamp, method, path, response_status, duration_ms\nFROM request_logs\nWHERE response_status \u003e= 400\nORDER BY timestamp DESC;\n\n-- Token usage over time (if captured in request_body)\nSELECT\n  DATE(timestamp) as date,\n  SUM(json_extract(response_body, '$.usage.input_tokens')) as input_tokens,\n  SUM(json_extract(response_body, '$.usage.output_tokens')) as output_tokens\nFROM request_logs\nWHERE json_extract(response_body, '$.usage') IS NOT NULL\nGROUP BY date\nORDER BY date DESC;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnezhar%2Fclaude-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnezhar%2Fclaude-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnezhar%2Fclaude-container/lists"}