sbusso/claudeclaw/debug
Claude Code and agent skill by sbusso/claudeclaw
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Debug container agent issues. Use when things aren't working, container fails, authentication problems, or to understand how the container system works. Covers logs, environment variables, mounts, and common issues.
Install
npx vskill@latest install sbusso/claudeclaw/debugSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
ClaudeClaw Container & Sandbox Debugging
This guide covers debugging the agent execution system (container and sandbox runtimes).
Architecture Overview
Important: The container runs as user node with HOME=/home/node. Session files must be mounted to /home/node/.claude/ (not /root/.claude/) for session resumption to work.
Log Locations
| Log | Location | Content | |
|---|---|---|---|
| Main app logs | logs/claudeclaw.log | Host-side WhatsApp, routing, container spawning | |
| Main app errors | logs/claudeclaw.error.log | Host-side errors | |
| Container run logs | groups/{folder}/logs/container-*.log | Per-run: input, mounts, stderr, stdout | |
| Claude sessions | ~/.claude/projects/ | Claude Code session history |
Enabling Debug Logging
Set LOG_LEVEL=debug for verbose output:
Debug level shows:
- Full mount configurations
- Container command arguments
- Real-time container stderr
Common Issues
1. "Claude Code process exited with code 1"
Check the container log file in groups/{folder}/logs/container-*.log
Common causes:
Missing Authentication
Fix: Ensure .env file exists with either OAuth token or API key:
Root User Restriction
Fix: Container must run as non-root user. Check Dockerfile has USER node.
2. Environment Variables Not Passing
Runtime note: Environment variables passed via -e may be lost when using -i (interactive/piped stdin).
Workaround: The system extracts only authentication variables (CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY) from .env and mounts them for sourcing inside the container. Other env vars are not exposed.
To verify env vars are reaching the container:
3. Mount Issues
Container mount notes:
- Docker supports both
-vand--mountsyntax - Use
:rosuffix for readonly mounts:
```bash # Readonly -v /path:/container/path:ro
# Read-write -v /path:/container/path ```
To check what's mounted inside a container:
Expected structure:
4. Permission Issues
The container runs as user node (uid 1000). Check ownership:
All of /workspace/ and /app/ should be owned by node.
5. Session Not Resuming / "Claude Code process exited with code 1"
If sessions aren't being resumed (new session ID every time), or Claude Code exits with code 1 when resuming:
Root cause: The SDK looks for sessions at $HOME/.claude/projects/. Inside the container, HOME=/home/node, so it looks at /home/node/.claude/projects/.
Check the mount path:
Verify sessions are accessible:
Fix: Ensure container-runner.ts mounts to /home/node/.claude/:
6. MCP Server Failures
If an MCP server fails to start, the agent may exit. Check the container logs for MCP initialization errors.
Manual Container Testing
Test the full agent flow:
Test Claude Code directly:
Interactive shell in container:
SDK Options Reference
The agent-runner uses these Claude Agent SDK options:
Important: allowDangerouslySkipPermissions: true is required when using permissionMode: 'bypassPermissions'. Without it, Claude Code exits with code 1.
Rebuilding After Changes
Checking Container Image
Session Persistence
Claude sessions are stored per-group in data/sessions/{group}/.claude/ for security isolation. Each group has its own session directory, preventing cross-group access to conversation history.
Critical: The mount path must match the container user's HOME directory:
- Container user:
node - Container HOME:
/home/node - Mount target:
/home/node/.claude/(NOT/root/.claude/)
To clear sessions:
To verify session resumption is working, check the logs for the same session ID across messages:
IPC Debugging
The container communicates back to the host via files in /workspace/ipc/:
IPC file types:
messages/*.json- Agent writes: outgoing WhatsApp messagestasks/*.json- Agent writes: task operations (schedule, pause, resume, cancel, refresh_groups)current_tasks.json- Host writes: read-only snapshot of scheduled tasksavailable_groups.json- Host writes: read-only list of WhatsApp groups (main only)
Sandbox Runtime Debugging
If RUNTIME=sandbox is set, agents run via @anthropic-ai/sandbox-runtime instead of containers.
Sandbox Architecture
Sandbox-Specific Issues
EPERM on all operations: The srt settings JSON file requires ALL fields including empty arrays (allowRead: []). Omit any field and the entire settings file silently fails validation — zero error messages.
Agent runner won't start (tsx/EPERM): Sandbox blocks Unix sockets needed by tsx. Fix: pre-compile with cd agent/runner && npx tsc, run with plain node.
Agent can't find paths: Check that CLAUDECLAW_*_DIR env vars are set in sandbox-runner.ts. The agent runner falls back to /workspace/* if env vars are missing.
Stale sessions after runtime switch: Switching a group between container and sandbox leaves stale session IDs. Fix: sqlite3 store/messages.db "DELETE FROM sessions"
Network blocked: Verify allowedDomains in the generated settings file includes api.anthropic.com. Check data/sandbox-settings/ for the last generated settings file.
Credential issues: Sandbox passes real credentials via env vars (not through the credential proxy). Ensure ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN is in .env.
Quick Diagnostic Script
Run this to check common issues:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/debug/SKILL.md
Popularity
- Repository stars
- 173
- Repository forks
- 56
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sbusso/claudeclaw/debug)