You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Claudetainer
1
+
# Codetainer
2
2
3
3
A hardened Docker container that runs [Claude Code](https://claude.ai/code) on [Fly.io](https://fly.io), accessible via SSH. Designed for long-running, autonomous coding sessions with container hardening and strict network isolation.
4
4
@@ -93,7 +93,7 @@ Pick the [Fly.io region](https://fly.io/docs/reference/regions/) closest to you
93
93
**Option A: Prebuilt image (fastest)**
94
94
95
95
```bash
96
-
fly machine run ghcr.io/perezd/claudetainer:latest \
96
+
fly machine run ghcr.io/perezd/codetainer:latest \
97
97
--app <your-app-name> \
98
98
--region <your-region> \
99
99
--restart no \
@@ -108,7 +108,7 @@ fly machine run ghcr.io/perezd/claudetainer:latest \
108
108
To give Claude an immediate task, add an initialization prompt:
109
109
110
110
```bash
111
-
fly machine run ghcr.io/perezd/claudetainer:latest \
111
+
fly machine run ghcr.io/perezd/codetainer:latest \
112
112
--app <your-app-name> \
113
113
--region <your-region> \
114
114
--restart no \
@@ -128,8 +128,8 @@ Claude will begin working on the prompt as soon as the container is ready, befor
128
128
If you want to customize the image (e.g. change installed tools or network allowlists), clone the repo and build directly:
@@ -168,7 +168,7 @@ Fine-grained tokens are recommended when the target repo belongs to a GitHub **o
168
168
**How to create a fine-grained token (recommended):**
169
169
170
170
1. Log into the robot GitHub account and go to [github.com/settings/tokens](https://github.com/settings/tokens?type=beta). Click **Generate new token** (fine-grained)
171
-
2. Give it a descriptive name (e.g. `claudetainer - my-repo`)
171
+
2. Give it a descriptive name (e.g. `codetainer - my-repo`)
172
172
3. Under **Resource owner**, select the org or user that owns the repo
173
173
4. Under **Repository access**, select **Only select repositories** and pick the single repo you want Claude to work in
174
174
5. Under **Repository permissions**, grant exactly these:
@@ -230,15 +230,15 @@ See [Telemetry](#telemetry-optional) below for what gets exported and privacy co
230
230
231
231
These are set via `--env` flags on `fly machine run`. They are not sensitive and don't need to be secrets.
|`GIT_USER_NAME`| No |`claudetainer`| Git commit author name |
236
-
|`GIT_USER_EMAIL`| No |`claudetainer@noreply.github.com`| Git commit author email |
237
-
|`REPO_URL`| No |_(none)_| HTTPS URL of a GitHub repo to clone on startup. Cloned to `/workspace/repo`. Must be accessible with the `GH_PAT`. |
238
-
|`CLAUDE_PROMPT`| No |_(none)_| Initialization prompt for Claude Code. When set, Claude immediately begins working on this prompt at boot. Typically a GitHub issue URL (e.g., `https://github.com/org/repo/issues/42`). Visible via `fly machine status` — do not include secrets. |
239
-
|`OTEL_LOG_USER_PROMPTS`| No |`1`| Set to `0` to exclude user prompt content from telemetry events (only prompt length is recorded). Requires Grafana Cloud telemetry to be enabled. |
240
-
|`OTEL_LOG_TOOL_DETAILS`| No |`1`| Set to `0` to exclude tool parameters from telemetry events (only tool name is recorded). Requires Grafana Cloud telemetry to be enabled. |
241
-
|`OTEL_RESOURCE_ATTRIBUTES`| No |_(auto: Fly identity)_| Comma-separated `key=value` pairs added to all metrics and events. `fly.app_name` and `fly.machine_id` are auto-injected; operator values are appended. Requires Grafana Cloud telemetry to be enabled. |
|`GIT_USER_NAME`| No |`codetainer`| Git commit author name |
236
+
|`GIT_USER_EMAIL`| No |`codetainer@noreply.github.com`| Git commit author email |
237
+
|`REPO_URL`| No |_(none)_| HTTPS URL of a GitHub repo to clone on startup. Cloned to `/workspace/repo`. Must be accessible with the `GH_PAT`. |
238
+
|`CLAUDE_PROMPT`| No |_(none)_| Initialization prompt for Claude Code. When set, Claude immediately begins working on this prompt at boot. Typically a GitHub issue URL (e.g., `https://github.com/org/repo/issues/42`). Visible via `fly machine status` — do not include secrets. |
239
+
|`OTEL_LOG_USER_PROMPTS`| No |`1`| Set to `0` to exclude user prompt content from telemetry events (only prompt length is recorded). Requires Grafana Cloud telemetry to be enabled. |
240
+
|`OTEL_LOG_TOOL_DETAILS`| No |`1`| Set to `0` to exclude tool parameters from telemetry events (only tool name is recorded). Requires Grafana Cloud telemetry to be enabled. |
241
+
|`OTEL_RESOURCE_ATTRIBUTES`| No |_(auto: Fly identity)_| Comma-separated `key=value` pairs added to all metrics and events. `fly.app_name` and `fly.machine_id` are auto-injected; operator values are appended. Requires Grafana Cloud telemetry to be enabled. |
242
242
243
243
## Usage
244
244
@@ -281,7 +281,7 @@ The machine is configured with `--restart no` and `--autostart=false`, so it sta
281
281
282
282
## Telemetry (Optional)
283
283
284
-
Claudetainer can export Claude Code's native OpenTelemetry metrics and events to [Grafana Cloud](https://grafana.com/products/cloud/) via direct OTLP push. This gives you dashboards for token usage, costs, session activity, and full prompt-level event traces — all in Grafana.
284
+
Codetainer can export Claude Code's native OpenTelemetry metrics and events to [Grafana Cloud](https://grafana.com/products/cloud/) via direct OTLP push. This gives you dashboards for token usage, costs, session activity, and full prompt-level event traces — all in Grafana.
285
285
286
286
The feature is **opt-in** and **disabled by default**. It activates only when all three Grafana Cloud secrets are set (`GRAFANA_INSTANCE_ID`, `GRAFANA_API_TOKEN`, `GRAFANA_OTLP_ENDPOINT`). When off, there is zero telemetry, zero outbound traffic, and no behavior change.
287
287
@@ -397,7 +397,7 @@ Edit `claude-settings.json` to add entries under `mcpServers`. The default confi
397
397
|`shared-cpu-2x` / 4GB | Heavy | Large repos, parallel builds |
398
398
399
399
```bash
400
-
fly machine run ghcr.io/perezd/claudetainer:latest \
400
+
fly machine run ghcr.io/perezd/codetainer:latest \
401
401
--vm-memory 2048 \
402
402
--vm-size shared-cpu-2x \
403
403
...
@@ -432,7 +432,7 @@ fly machine run ghcr.io/perezd/claudetainer:latest \
432
432
### Source Repository Layout
433
433
434
434
```
435
-
claudetainer/
435
+
codetainer/
436
436
├── network/ # Network isolation layer
437
437
│ ├── domains.conf # Domain allowlist (one per line)
438
438
│ └── Corefile.template # CoreDNS base config (catch-all NXDOMAIN)
@@ -516,10 +516,10 @@ All scripts live in `scripts/` and are copied to `/usr/local/bin/` during the Do
516
516
The GitHub Actions workflow (`.github/workflows/build.yml`) builds and pushes the container image to GHCR on every push to `main`:
517
517
518
518
```
519
-
ghcr.io/perezd/claudetainer:latest
519
+
ghcr.io/perezd/codetainer:latest
520
520
```
521
521
522
-
The GHCR package must be set to **public** visibility so Fly.io can pull it without registry credentials. To set this, go to the GitHub repo → Packages → `claudetainer` → Package settings → Change visibility → Public.
522
+
The GHCR package must be set to **public** visibility so Fly.io can pull it without registry credentials. To set this, go to the GitHub repo → Packages → `codetainer` → Package settings → Change visibility → Public.
Copy file name to clipboardExpand all lines: docs/accepted-risks.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,9 +51,9 @@ Each entry includes: risk title, affected layer(s), why it can't be resolved, co
51
51
### Single PAT for GitHub API and npm registry auth
52
52
53
53
-**Affected layer:** Container Hardening
54
-
-**Description:** Both `GH_TOKEN` (GitHub API / git credential helper) and `CLAUDETAINER_NPM_TOKEN` (GitHub Packages npm registry) are derived from the same `GH_PAT` at runtime. Compromise of either access path exposes the full PAT, which may have scopes beyond what each consumer needs individually.
54
+
-**Description:** Both `GH_TOKEN` (GitHub API / git credential helper) and `CODETAINER_NPM_TOKEN` (GitHub Packages npm registry) are derived from the same `GH_PAT` at runtime. Compromise of either access path exposes the full PAT, which may have scopes beyond what each consumer needs individually.
55
55
-**Why it can't be resolved:** GitHub fine-grained PATs do not yet support the scope separation needed to create two tokens with disjoint permissions for `gh` CLI operations vs. npm registry access. The operational complexity of managing two classic PATs with minimal-overlap scopes exceeds the security benefit in a single-purpose container.
56
-
-**Compensating controls:** The `CLAUDETAINER_NPM_TOKEN` abstraction allows a future split to separate tokens without changing consumer code. Network isolation limits where either token can be used. Operators should follow least-privilege guidance: prefer fine-grained PATs with minimal scopes.
56
+
-**Compensating controls:** The `CODETAINER_NPM_TOKEN` abstraction allows a future split to separate tokens without changing consumer code. Network isolation limits where either token can be used. Operators should follow least-privilege guidance: prefer fine-grained PATs with minimal scopes.
57
57
-**Severity:** Low
58
58
-**Date identified:** 2026-04-02 (identified during panel review of #32)
0 commit comments