debug
Skill91 starsChanged 7 months agoMITView on GitHub
Debug agent issues. Use when things aren't working, agent fails, authentication problems, or to understand how the system works. Covers logs, environment variables, sessions, and common issues.
- Reads credentials
- Deletes or force-pushes
144 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
- prathish-ks/isthmustheir own version, first seen Oct 6, 2026
- muon-m2/magento2-toolstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- nanocoai/nanoclawtheir own version, first seen Oct 4, 2026
- agentic-community/mcp-gateway-registrytheir own version, first seen Oct 4, 2026
Used with
Projects with it also use add-ollama-tool, add-whatsapp and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkilladd-ollama-tool
Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.
Also in 6 projects that use this
MicrosoftSkilladd-whatsapp
Add WhatsApp channel via native Baileys adapter. Direct connection — no Chat SDK bridge. Uses QR code or pairing code for authentication.
Also in 6 projects that use this
- +3 more from microsoft
Other versions144 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- Runchuan-BU/BioClaw★ 41030% same
- sbusso/claudeclaw★ 19427% same
- DingyangLyu/MatClaw★ 9432% same
- microsoft/amplifier-app-nanoclaw★ 426% same
- sskarz/nanoclawbster★ 232% same
Wrote their own version · 139
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- nanocoai/nanoclaw★ 31ksame name
- openai/symphony★ 28ksame name
- anthropics/knowledge-work-plugins★ 26ksame name
- NVIDIA/Model-Optimizer★ 5.2ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- jsmastery-pro/skills★ 1.4ksame name
- agentic-community/mcp-gateway-registry★ 956same name
- suboss87/FDEOps★ 950same name
- kdlbs/kandev★ 899same name
129 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository55 other files it gives its agents.
- ab-test-setupSkill
- ad-creativeSkill
- add-discordSkill
- add-gmail-agentSkill
- add-heartbeatSkill
- add-morning-briefingSkill
- add-slackSkill
- add-telegramSkill
- add-telegram-swarmSkill
- add-update-checkSkill
- add-voice-replySkill
- add-voice-transcriptionSkill
- ai-seoSkill
- analytics-trackingSkill
- churn-preventionSkill
- cold-emailSkill
- competitor-alternativesSkill
- content-strategySkill
- copy-editingSkill
- copywritingSkill
- customizeSkill
- designSkill
- domain-checkSkill
- email-sequenceSkill
- form-croSkill
- free-tool-strategySkill
- get-qodo-rulesSkill
- launch-strategySkill
- marketing-ideasSkill
- marketing-psychologySkill
- migrate-memorySkill
- onboarding-croSkill
- page-croSkill
- paid-adsSkill
- paywall-upgrade-croSkill
- popup-croSkill
- pr-babysitterSkill
- pricing-strategySkill
- product-marketing-contextSkill
- programmatic-seoSkill
- qodo-pr-resolverSkill
- referral-programSkill
- revopsSkill
- run-ralphSkill
- sales-enablementSkill
- schema-markupSkill
- seo-auditSkill
- setup-ghostclawSkill
- setup-shared-folderSkill
- setupSkill
- signup-flow-croSkill
- site-architectureSkill
- social-contentSkill
- update-ghostclawSkill
- update-nanoclawSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 127 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
Fix: Ensure .env file exists with either OAuth token or API key:
- Distinctive: line 93
If sessions aren't being resumed (new session ID every time):
- Distinctive: line 110
If an MCP server fails to start, the agent may exit.
- Distinctive: line 116
Default timeout is 300 seconds.
- Distinctive: line 117
Check logs for what it's doing (long tool calls, large file reads)
- Distinctive: line 197
Run this to check common issues:
“Common” is measured: kept by at least 6 in 10 of the 127 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GhostClaw Agent Debugging
This guide covers debugging the agent execution system.
Architecture Overview
Host (macOS/Linux)
───────────────────────────────────────────────
src/index.ts agent-runner/
│ │
│ spawns child process │ runs Claude Agent SDK
│ with env vars │ with MCP servers
│ │
├── GHOSTCLAW_GROUP_DIR ──> groups/{folder}/
├── GHOSTCLAW_IPC_DIR ───> data/ipc/{folder}/
├── GHOSTCLAW_GLOBAL_DIR > groups/global/
├── CLAUDE_CONFIG_DIR ───> data/sessions/{folder}/.claude/
└── HOME ────────────────> (inherited, real home)Important: Agents run as direct Node.js child processes, not containers. CLAUDE_CONFIG_DIR provides per-group session isolation while HOME stays untouched so tools like gh, Gmail OAuth, etc. find their credentials naturally.
Log Locations
| Log | Location | Content |
| Main app logs | logs/ghostclaw.log | Routing, agent spawning, scheduling |
| Main app errors | logs/ghostclaw.error.log | Host-side errors |
| Agent run logs | groups/{folder}/logs/agent-*.log | Per-run: input, stderr, stdout |
| Claude sessions | data/sessions/{folder}/.claude/projects/ | Claude Code session history |
Enabling Debug Logging
Set LOG_LEVEL=debug for verbose output:
# For development
LOG_LEVEL=debug npm run dev
# For launchd service (macOS), add to plist EnvironmentVariables:
<key>LOG_LEVEL</key>
<string>debug</string>
# For systemd service (Linux), add to unit [Service] section:
# Environment=LOG_LEVEL=debugDebug level shows:
- Full environment configuration
- Agent process arguments
- Real-time agent stderr
Common Issues
1. "Claude Code process exited with code 1"
Check the agent log file in groups/{folder}/logs/agent-*.log
Common causes:
Missing Authentication
Invalid API key · Please run /loginFix: Ensure .env file exists with either OAuth token or API key:
cat .env # Should show one of:
# CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... (subscription)
# ANTHROPIC_API_KEY=sk-ant-api03-... (pay-per-use)2. Environment Variables
Secrets are passed to the agent via stdin (never written to disk). The agent receives:
CLAUDE_CODE_OAUTH_TOKENorANTHROPIC_API_KEYELEVENLABS_API_KEY,ELEVENLABS_VOICE_ID
Environment variables set via GHOSTCLAW_* paths:
GHOSTCLAW_GROUP_DIR— group's working directoryGHOSTCLAW_IPC_DIR— IPC communication directoryGHOSTCLAW_GLOBAL_DIR— global shared directoryCLAUDE_CONFIG_DIR— per-group Claude session isolation
To verify env vars are correct, check the agent log (first few lines show the input JSON).
3. Session Not Resuming
If sessions aren't being resumed (new session ID every time):
Root cause: The SDK looks for sessions at $CLAUDE_CONFIG_DIR/projects/. Each group's sessions live in data/sessions/{folder}/.claude/.
Verify sessions exist:
ls -la data/sessions/*/Check session continuity in logs:
grep "Session initialized" logs/ghostclaw.log | tail -5
# Should show the SAME session ID for consecutive messages in the same group4. MCP Server Failures
If an MCP server fails to start, the agent may exit. Check agent logs for MCP initialization errors.
MCP servers are configured in data/sessions/{folder}/.claude/settings.json. Global servers are synced automatically from agent-spawner.ts:buildGlobalMcpServers().
5. Agent Timeout
Default timeout is 300 seconds. If the agent takes longer:
- Check logs for what it's doing (long tool calls, large file reads)
- Increase timeout via
containerConfig.timeouton the registered group
SDK Options Reference
The agent-runner uses these Claude Agent SDK options:
query({
prompt: input.prompt,
options: {
cwd: groupDir,
allowedTools: ['Bash', 'Read', 'Write', ...],
permissionMode: 'bypassPermissions',
allowDangerouslySkipPermissions: true,
settingSources: ['project'],
mcpServers: { ... }
}
})Important: allowDangerouslySkipPermissions: true is required when using permissionMode: 'bypassPermissions'. Without it, Claude Code exits with code 1.
Rebuilding After Changes
# Rebuild main app
npm run build
# Rebuild agent runner
cd agent-runner && npm run build && cd ../..
# Restart service
launchctl kickstart -k gui/$(id -u)/com.ghostclaw # macOS
# systemctl --user restart ghostclaw # LinuxSession 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.
To clear sessions:
# Clear all sessions for all groups
rm -rf data/sessions/
# Clear sessions for a specific group
rm -rf data/sessions/{groupFolder}/.claude/IPC Debugging
Agents communicate back to the host via files in data/ipc/{folder}/:
# Check pending messages
ls -la data/ipc/*/messages/
# Check pending task operations
ls -la data/ipc/*/tasks/
# Read a specific IPC file
cat data/ipc/*/messages/*.json
# Check available groups (main channel only)
cat data/ipc/main/available_groups.json
# Check current tasks snapshot
cat data/ipc/{groupFolder}/current_tasks.jsonIPC file types:
messages/*.json- Agent writes: outgoing 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 groups (main only)
Quick Diagnostic Script
Run this to check common issues:
echo "=== Checking GhostClaw Setup ==="
echo -e "\n1. Authentication configured?"
[ -f .env ] && (grep -q "CLAUDE_CODE_OAUTH_TOKEN=sk-" .env || grep -q "ANTHROPIC_API_KEY=sk-" .env) && echo "OK" || echo "MISSING - add CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY to .env"
echo -e "\n2. Node.js available?"
node --version 2>/dev/null && echo "OK" || echo "NOT FOUND - install Node.js 20+"
echo -e "\n3. Built?"
[ -d dist ] && echo "OK" || echo "MISSING - run npm run build"
echo -e "\n4. Agent runner built?"
[ -d agent-runner/dist ] && echo "OK" || echo "MISSING - run cd agent-runner && npm run build"
echo -e "\n5. Groups directory?"
ls -la groups/ 2>/dev/null || echo "MISSING - run /setup-ghostclaw"
echo -e "\n6. Service running?"
launchctl list 2>/dev/null | grep ghostclaw && echo "OK" || echo "NOT RUNNING"
echo -e "\n7. Recent agent logs?"
ls -t groups/*/logs/agent-*.log 2>/dev/null | head -3 || echo "No agent logs yet"
echo -e "\n8. Session continuity working?"
SESSIONS=$(grep "Session initialized" logs/ghostclaw.log 2>/dev/null | tail -5 | awk '{print $NF}' | sort -u | wc -l)
[ "$SESSIONS" -le 2 ] && echo "OK (recent sessions reusing IDs)" || echo "CHECK - multiple different session IDs, may indicate resumption issues"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

