debug

A troubleshooting guide for ChessClaw, a container-based coding-agent runtime, checks authentication, file mounts, resumed sessions, runtime errors, and service health.

In plain words
What is it for?
Use it to investigate startup failures, missing files, authentication problems, broken sessions, and unhealthy ChessClaw services.
Why use it?
It narrows down whether a failure comes from the host system, the Linux container, saved session data, or the agent process.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fmbenhassine/chessclaw/debug
Any agent
npx skills add fmbenhassine/chessclaw --skill debug
Clone the repo
git clone --depth 1 https://github.com/fmbenhassine/chessclaw

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.01039
Opus 5 $0.00013 $0.00519
Sonnet 5 $0.00005 $0.00208
Haiku 4.5 $0.00003 $0.00104

Measured 2d ago against content hash 2bb1bf6376c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codex/skills/debug/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ChessClaw Debug (Codex Runtime)

Architecture Snapshot

Host (macOS)                           Container (Linux VM)
───────────────────────────────────────────────────────────
src/container-runner.ts                container/agent-runner/
    │                                      │
    │ spawns Apple Container runtime       │ runs Codex SDK
    │                                      │
    ├── assistant/  ─────────────────> /workspace/assistant
    ├── data/ipc/  ──────────────────> /workspace/ipc
    ├── data/session/.codex/  ───────> /home/node/.codex/
    └── data/env/env  ───────────────> /workspace/env-dir/env

Key Logs

  • Host logs: logs/chessclaw.log
  • Host error logs: logs/chessclaw.error.log
  • Per-run container logs: assistant/logs/container-*.log
  • Persistent Codex session/auth state: data/session/.codex/

Fast Health Check

launchctl list | grep chessclaw
container ls --format '{{.Names}} {{.Status}}' 2>/dev/null | grep chessclaw
grep -E 'ERROR|WARN|timeout|failed' logs/chessclaw.log | tail -30

Common Failures

1) "Codex process exited with code 1"

Check latest container log first:

ls -lt assistant/logs/container-*.log | head -5
cat assistant/logs/container-<timestamp>.log

Likely causes:

  • Missing auth (codex login not done, no API key in .env)
  • Runtime missing (container unavailable)
  • Session mount mismatch

2) Auth Not Available in Container

Supported auth paths:

  • Host Codex login copied into data/session/.codex/auth.json
  • API keys from .env allowlist (OPENAI_API_KEY, CODEX_API_KEY, plus optional OpenAI overrides)

Checks:

ls -la data/session/.codex/
grep -E '^(OPENAI_API_KEY|CODEX_API_KEY|OPENAI_BASE_URL|OPENAI_ORG_ID|OPENAI_PROJECT_ID)=' .env

Validate mounted env inside container:

echo '{}' | container run -i \
  --mount type=bind,source=$(pwd)/data/env,target=/workspace/env-dir,readonly \
  --entrypoint /bin/bash chessclaw-agent:latest \
  -c 'export $(cat /workspace/env-dir/env | xargs); env | grep -E "^(OPENAI_API_KEY|CODEX_API_KEY|OPENAI_BASE_URL|OPENAI_ORG_ID|OPENAI_PROJECT_ID)="'

Read the full file on GitHub · 125 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 125 lines · 26 tokens per session scan A 2bb1bf6376c8

Subscribe to this mod's changes

debug is a skill published in the GitHub repository fmbenhassine/chessclaw (5 stars, last pushed 4mo ago), licensed MIT. It adds 26 tokens to every session and 1,039 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.