debug
Skill17 starsChanged 36 days agoMITView on GitHub
Diagnose a Phosphor session that errors, hangs, or returns an empty reply — read the main-process debug log, pi's session JSONL, and the provider's own transcript. Use when a session "isn't working", a turn fails with a confusing message, pi crashes, or a provider (Claude CLI, Bedrock) misbehaves.
190 other projects use a version of this.
Adopted by
Most recently taken up by
- sentimony/skillstheir own version, first seen Nov 29, 2026
- ByronFinn/dev-skillstheir own version, first seen Nov 29, 2026
- Rune-kit/runetheir own version, first seen Nov 29, 2026
- Bazza1982/HASHItheir own version, first seen Nov 29, 2026
- alexcollins/skillstheir own version, first seen Nov 29, 2026
- Sagargupta16/craftsmanshiptheir own version, first seen Nov 29, 2026
Used with
Projects with it also use update-nanoclaw, add-atomic-chat-tool and 10 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.
MicrosoftSkillupdate-nanoclaw
Efficiently bring upstream NanoClaw updates into a customized install, with preview, selective cherry-pick, and low token usage.
Also in 9 projects that use this
MicrosoftSkilladd-atomic-chat-tool
Add Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.
Also in 8 projects that use this
- +10 more from microsoft
Other versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- anthropics/knowledge-work-plugins★ 37ksame name
- nanocoai/nanoclaw★ 31ksame name
- gavrielc/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 11ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.7ksame name
- NVIDIA/Model-Optimizer★ 5.7ksame name
180 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.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 176 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Always on, no flag to set — a log you must enable first is never on when the bug happens.
- Very specific: line 74
The highest-value file, and the one people forget: When the provider is pi-claude-cli, the CLI keeps its own transcript:
- Very specific: line 115
When a provider shells out (pi-claude-cli spawns claude) and you need the arguments it actually passed, shim the binary:
- Very specific: line 128
Use the absolute path to the real binary in the exec line, and remove the shim afterwards.
“Common” is measured: kept by at least 6 in 10 of the 176 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
Debugging a failing Phosphor session
Work outside-in. The layer that prints the error is usually not the layer that caused it: a turn that fails inside the Claude CLI surfaces in Phosphor as a generic red message, and the real reason is one or two layers down.
The stack, and what each layer keeps:
Phosphor renderer → chat bubble; keeps nothing after unmount
Phosphor main → ~/Library/Logs/Phosphor/phosphor.log (spawn argv, pi stderr, crashes)
pi subprocess → ~/.pi/agent/sessions/<mangled-cwd>/<ts>_<id>.jsonl
provider → ~/.claude/projects/<mangled-cwd>/<session-id>.jsonl (Claude CLI only)1. The debug log
tail -100 ~/Library/Logs/Phosphor/phosphor.logAlways on, no flag to set — a log you must enable first is never on when the
bug happens. Rotates at 5MB keeping one .1. macOS path shown; Linux is
~/.config/Phosphor/logs/. From a shipped build the path is also available over
IPC (app:debugLogPath, app:revealDebugLog).
What it answers:
[pi] spawn— the exact argv and cwd. Check--provider,--model,--thinkinghere before believing what the UI claims.[pi] stderr— the provider prints failure reasons here.[pi] exited unexpectedly— the code/signal behind a "pi crashed" banner.[app] session start— versions and PATH. A GUI app inherits launchd's PATH, not your login shell's, sopiorclaudecan resolve to a different binary (or none) than the same command in a terminal.
2. The pi session file
The session id and file path are in the UI, or find the newest:
ls -t ~/.pi/agent/sessions/*/*.jsonl | head -5python3 -c "
import json,sys
for l in open(sys.argv[1]):
d=json.loads(l); t=d.get('type'); m=d.get('message') or {}
if t=='message':
c=m.get('content') or []
u=(m.get('usage') or {}).get('totalTokens')
if not c: print(f'[{m.get(\"role\")}] EMPTY tokens={u} stop={m.get(\"stopReason\")}')
for b in c: print(f'[{m.get(\"role\")}/{b.get(\"type\")}]', (b.get('text') or '')[:200])
else: print(f'[{t}]', json.dumps({k:v for k,v in d.items() if k not in(\"type\",\"id\",\"parentId\")})[:150])
" <session.jsonl>An assistant message with empty content, totalTokens: 0, and a sub-second
timestamp gap means the model never ran. The provider failed before the API
call. Do not read that as a model problem — go to step 3.
To tell a provider fault from a Phosphor fault, compare across sessions: if every session on one provider is empty while another provider's sessions have real token counts, the fault is that provider.
3. The provider's own transcript (Claude CLI)
The highest-value file, and the one people forget. When the provider is
pi-claude-cli, the CLI keeps its own transcript:
~/.claude/projects/<cwd-with-slashes-as-dashes>/<pi-session-id>.jsonlIt records the plain-English API error that Phosphor renders as something
unhelpful. Read the result field of the type: "result" line:
python3 -c "
import json,sys
for l in open(sys.argv[1]):
d=json.loads(l)
if d.get('type')=='result' or d.get('is_error'):
for k in ('subtype','is_error','api_error_status','terminal_reason','result'):
if k in d: print(f'{k} = {repr(d[k])[:400]}')
" <claude-transcript.jsonl>Known trap: the provider's error template prints subtype while the check
that fired is is_error, producing the self-contradictory
Error: Claude CLI returned success. The real cause is in result, which
the provider never surfaces. Any confusing provider error — always read
result.
4. Reproduce outside Phosphor
This decides "is it Phosphor or is it pi/the provider" in one command:
cd /tmp && echo "reply with exactly: pong" | pi -pFails here too ⇒ not a Phosphor bug. Fix pi, the provider, or its config.
Works here but fails in Phosphor ⇒ compare the [pi] spawn argv from the debug
log against what you just ran; the difference is the bug.
5. Capture the real argv of a nested CLI
When a provider shells out (pi-claude-cli spawns claude) and you need the
arguments it actually passed, shim the binary:
mkdir -p /tmp/shim && cat > /tmp/shim/claude <<'EOF'
#!/bin/sh
for a in "$@"; do echo " [$a]"; done > /tmp/claude-argv.txt
exec /full/path/to/real/claude "$@"
EOF
chmod +x /tmp/shim/claude
PATH=/tmp/shim:$PATH pi -p <<< "hi"; cat /tmp/claude-argv.txtUse the absolute path to the real binary in the exec line, and remove the
shim afterwards. Several claude binaries at different versions on one PATH
is common (homebrew, fnm, ~/.local/bin) — which -a claude before assuming
which one ran.
Checks worth running early
which -a pi claude # multiple versions on PATH?
pi --version # >= 0.78.0
cat ~/.pi/agent/settings.json # defaultProvider, defaultModel, thinking level
cat ~/.claude/settings.json # provider-side settings can veto pi's flagsA setting on either side can break the other. A real case:
"alwaysThinkingEnabled": false in ~/.claude/settings.json made the CLI
reject pi's --effort max, and every turn failed. Neither file is wrong on its
own — they were incompatible.
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.

