CC Web Workarounds
Limitations and workarounds for Claude Code Web environments.
Environment Detection
is_web_env=false
[ "$CLAUDE_CODE_REMOTE" = "true" ] && is_web_env=true
[ "${CLAUDE_ENVIRONMENT:-}" = "ccweb" ] && is_web_env=true
[ -n "${CODESPACES:-}" ] && is_web_env=true
Known Limitations
| Issue | Workaround |
|---|---|
gh pr checks fails |
Use gh api repos/OWNER/REPO/actions/runs |
gh issue list fails |
Use gh api repos/OWNER/REPO/issues |
| Shallow git history (<50 commits) | Use gh api for full history |
claude -p subprocess broken |
Defer tasks needing Claude subprocess |
| apt-get blocked | None; use local devcontainer |
| No git worktrees | Single-branch workflow only |
| New branch from main only | Cannot use existing branches or branch from non-main |
| No TexLive/LaTeXML | Use local for thesis builds |
GitHub CLI Workarounds
Instead of gh pr checks:
gh api repos/{owner}/{repo}/commits/{sha}/check-runs --jq '.check_runs[] | {name, status, conclusion}'
Instead of gh issue list:
gh api repos/{owner}/{repo}/issues --jq '.[] | {number, title, state}'
Instead of local git log:
gh api repos/{owner}/{repo}/commits --jq '.[].commit.message'
Shallow Clone Warning
Session startup detects shallow clones:
local_commits=$(git rev-list --count HEAD 2>/dev/null || echo "0")
if [ "$local_commits" -lt 50 ]; then
echo "WARNING: Shallow clone detected"
fi
Hook Crash Prevention
When writing hooks for CC Web:
- Use
bash -cnotbash -lc(no login shell) - Fallback:
${CLAUDE_PROJECT_DIR:-.} - Add
|| truewithset -e - Add
--timeout=30to wget
Emergency Minimal Settings
If hooks crash, use this .claude/settings.json:
{
"env": { "GIT_PAGER": "cat" },
"permissions": { "defaultMode": "bypassPermissions" }
}
See Also
.devcontainer/CLAUDE.md— Environment overview.claude/hooks/session-start.sh— Environment detection
Converted and distributed by TomeVault — claim your Tome and manage your conversions.