From c8255dccec4a1d21a18069a9f05668243887acdc Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sat, 7 Mar 2026 11:00:58 +0800 Subject: [PATCH] fix: add tmux to claude-dev tooling Add tmux to the claude-dev runtime contract so persistent terminal sessions can rely on it, and make the Claude preflight patch resilient to current CLI builds so image builds keep passing. Co-Authored-By: Claude Opus 4.6 (1M context) --- claude-dev/Dockerfile | 11 +++++++---- claude-dev/required-tools.txt | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/claude-dev/Dockerfile b/claude-dev/Dockerfile index 5eeecab..d5e3d2b 100644 --- a/claude-dev/Dockerfile +++ b/claude-dev/Dockerfile @@ -16,6 +16,7 @@ RUN apt-get update \ python3 \ ripgrep \ rsync \ + tmux \ unzip \ wget \ zip \ @@ -31,20 +32,22 @@ RUN npm install -g @anthropic-ai/claude-code RUN python3 - <<'PY' from pathlib import Path +import re path = Path("/usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js") if not path.exists(): raise SystemExit(f"claude cli not found: {path}") content = path.read_text() -old = 'F8.get("https://api.anthropic.com/api/hello",{headers:K8($)}).catch((()=>!1))' -if old not in content: +pattern = r'let A=U7\(\),q=new URL\(A\.TOKEN_URL\),K=\[`\$\{A\.BASE_API_URL\}/api/hello`,`\$\{q\.origin\}/v1/oauth/hello`\],Y=async\(_\)=>\{try\{let \$=await I8\.get\(_,\{headers:\{"User-Agent":ey\(\)\}\}\);if\(\$\.status!==200\)return\{success:!1,error:`Failed to connect to \$\{new URL\(_\)\.hostname\}: Status \$\{\$\.status\}`\};return\{success:!0\}\}catch\(\$\)\{' +replacement = 'return' +patched, count = re.subn(pattern, replacement, content, count=1) +if count != 1: raise SystemExit("preflight patch target not found in claude cli; refusing to build") -patched = content.replace(old, "!0") path.write_text(patched) -if old in path.read_text(): +if re.search(pattern, path.read_text()): raise SystemExit("preflight patch did not apply cleanly") print("Applied Claude preflight bypass patch") diff --git a/claude-dev/required-tools.txt b/claude-dev/required-tools.txt index c1641eb..99731b6 100644 --- a/claude-dev/required-tools.txt +++ b/claude-dev/required-tools.txt @@ -13,4 +13,5 @@ rsync zip unzip make +tmux claude