abtop didn't see my Claude Code sessions. I had it fixed, here is what was changed. Maybe it's useful:
abtop (v0.4.8) showed no sessions despite Claude Code running.
Root cause
abtop discovers sessions by reading ~/.claude/sessions/<pid>.json — a per-process
JSON file containing pid, sessionId, cwd, and startedAt. Older Claude Code
versions wrote these files automatically. Claude Code 2.x (standalone ELF binary,
~/.local/share/claude/versions/2.1.42) never does — it only writes to
~/.claude/projects/<project>/<uuid>.jsonl.
Two compounding issues:
~/.claude/sessions/ didn't exist, so is_claude_config_root() returned false
(abtop requires both sessions/ and projects/ to treat a directory as a
valid Claude config root — see graykode/abtop#126).
- Even after creating the directory, it was empty — so
find_session_file_for_pid()
found nothing and returned no sessions.
Fix
1. Create the missing directory (~/.claude/sessions/)
Required for abtop's config-root detection to pass.
2. Add ~/.config/abtop/config.toml
claude_config_dirs = ["~/.claude"]
Belt-and-suspenders explicit config in case auto-discovery changes again.
3. SessionStart hook: ~/.pilot/hooks/abtop_session_register.py
Writes the expected session file on every Claude Code startup. Walks up the
/proc tree from the hook subprocess to find the claude ancestor PID, then
writes ~/.claude/sessions/<pid>.json with the correct structure. Also cleans
up stale files for processes that no longer exist.
Registered in ~/.claude/settings.json under SessionStart / startup, async.
abtop didn't see my Claude Code sessions. I had it fixed, here is what was changed. Maybe it's useful:
abtop(v0.4.8) showed no sessions despite Claude Code running.Root cause
abtop discovers sessions by reading
~/.claude/sessions/<pid>.json— a per-processJSON file containing
pid,sessionId,cwd, andstartedAt. Older Claude Codeversions wrote these files automatically. Claude Code 2.x (standalone ELF binary,
~/.local/share/claude/versions/2.1.42) never does — it only writes to~/.claude/projects/<project>/<uuid>.jsonl.Two compounding issues:
~/.claude/sessions/didn't exist, sois_claude_config_root()returned false(abtop requires both
sessions/andprojects/to treat a directory as avalid Claude config root — see graykode/abtop#126).
find_session_file_for_pid()found nothing and returned no sessions.
Fix
1. Create the missing directory (
~/.claude/sessions/)Required for abtop's config-root detection to pass.
2. Add
~/.config/abtop/config.tomlBelt-and-suspenders explicit config in case auto-discovery changes again.
3.
SessionStarthook:~/.pilot/hooks/abtop_session_register.pyWrites the expected session file on every Claude Code startup. Walks up the
/proctree from the hook subprocess to find theclaudeancestor PID, thenwrites
~/.claude/sessions/<pid>.jsonwith the correct structure. Also cleansup stale files for processes that no longer exist.
Registered in
~/.claude/settings.jsonunderSessionStart / startup, async.