Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .claude/session-start-global-deny.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ fi

# --- Part 2: Fix git remote URLs to use local proxy ---
# NOTE: This block intentionally rewrites the `origin` remote on EVERY sibling
# repo under /home/user/* with a github.com remote, not just this one. Claude
# Code remote sessions clone multiple repos and all need the local git proxy.
# To opt out (e.g., when running outside that environment, or when you want
# unrelated checkouts left alone), set CYCLES_CLAUDE_SKIP_REMOTE_REWRITE=1.
# Tracked org-wide at runcycles/.github#63.
if [ -n "$CYCLES_CLAUDE_SKIP_REMOTE_REWRITE" ]; then
# repo under /home/user/* with a github.com remote. That multi-repo scope is
# only meaningful inside Claude Code's remote sessions (which clone many repos
# and need them all on the local git proxy). To keep the default safe on
# vanilla developer machines, we gate on $http_proxy being set — the Claude
# Code remote env sets that, a vanilla dev machine does not.
# Explicit override: set CYCLES_CLAUDE_SKIP_REMOTE_REWRITE=1 to skip even when
# $http_proxy is set. Tracked org-wide at runcycles/.github#63.
if [ -z "$http_proxy" ] || [ -n "$CYCLES_CLAUDE_SKIP_REMOTE_REWRITE" ]; then
exit 0
fi

Expand Down
14 changes: 10 additions & 4 deletions .claude/session-start-maven-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ else
XMLEOF
fi

# Install mvn-proxy wrapper that fixes JAVA_TOOL_OPTIONS interference
MVN_BIN=$(which mvn 2>/dev/null || echo "/opt/maven/bin/mvn")
cat > /usr/local/bin/mvn-proxy << WRAPEOF
# Install mvn-proxy wrapper that fixes JAVA_TOOL_OPTIONS interference.
# Defensively skip if a user-managed wrapper is already present — same etiquette
# as the ~/.m2/settings.xml check above. Tracked org-wide at runcycles/.github#62.
if [ -f /usr/local/bin/mvn-proxy ]; then
echo "[cycles] /usr/local/bin/mvn-proxy already exists; not overwriting." >&2
else
MVN_BIN=$(which mvn 2>/dev/null || echo "/opt/maven/bin/mvn")
cat > /usr/local/bin/mvn-proxy << WRAPEOF
#!/bin/bash
# Maven wrapper that fixes proxy auth for Claude Code remote environments.
# Use 'mvn-proxy' instead of 'mvn' to avoid DNS resolution and proxy auth issues.
Expand All @@ -74,4 +79,5 @@ export MAVEN_OPTS="-Dhttps.proxyHost=\$PROXY_HOST -Dhttps.proxyPort=\$PROXY_PORT

exec ${MVN_BIN} -Daether.connector.basic.threads=1 "\$@"
WRAPEOF
chmod +x /usr/local/bin/mvn-proxy
chmod +x /usr/local/bin/mvn-proxy
fi