{"id":46631419,"url":"https://github.com/mockdeep/claude-session-tracker","last_synced_at":"2026-03-08T00:05:27.237Z","repository":{"id":338375842,"uuid":"1157656240","full_name":"mockdeep/claude-session-tracker","owner":"mockdeep","description":"Cinnamon panel applet + Claude Code hooks for tracking multiple Claude sessions across terminal windows","archived":false,"fork":false,"pushed_at":"2026-02-24T04:16:46.000Z","size":59,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-24T10:30:49.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mockdeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T05:04:30.000Z","updated_at":"2026-02-24T04:25:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mockdeep/claude-session-tracker","commit_stats":null,"previous_names":["mockdeep/claude-session-tracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mockdeep/claude-session-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockdeep%2Fclaude-session-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockdeep%2Fclaude-session-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockdeep%2Fclaude-session-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockdeep%2Fclaude-session-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mockdeep","download_url":"https://codeload.github.com/mockdeep/claude-session-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockdeep%2Fclaude-session-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30238175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T23:52:25.683Z","status":"ssl_error","status_checked_at":"2026-03-07T23:52:25.373Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-08T00:05:26.704Z","updated_at":"2026-03-08T00:05:27.232Z","avatar_url":"https://github.com/mockdeep.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Session Tracker\n\nA Cinnamon desktop extension + Claude Code hook script for tracking multiple Claude Code sessions. Shows a floating widget with colored session dots in the bottom-right corner of your screen.\n\n## How It Works\n\nTwo components communicate via JSON state files in `~/.local/state/claude-sessions/`:\n\n- **Hook script** (`bin/claude-session-tracker`) — called by Claude Code hooks on session lifecycle events (`session-start`, `notification-idle`, `notification-permission`, `prompt-submit`, `tool-active`, `session-end`), writes per-session JSON state files.\n- **Cinnamon extension** (`extension/claude-sessions@fletch/extension.js`) — polls the state directory every second, renders a floating widget with colored dots arranged in a 2-column grid.\n\n### Widget\n\nThe widget floats above all windows (via `Main.layoutManager.addChrome`) and auto-hides when no sessions exist. Each session is a colored dot. Hover shows a tooltip with status icon and project name. Click a dot to focus its terminal window (and tab, for Gnome Terminal).\n\n### Visual States\n\n- **Active** (busy) — dot pulses opacity to convey work in progress\n- **Idle** — steady dot, full opacity\n- **Permission** — steady dot with white border (needs user input)\n- **Focused** — white inner circle on the dot whose terminal window/tab is currently focused\n\n### Theme Colors\n\nOn `session-start`, the hook walks up from the working directory looking for a `.terminal-theme` file, resolves the theme from `~/Dropbox/dotfiles/bash/terminal-themes/` (configurable via `$DOT_PATH`), and extracts the `prompt_fill` color. Each session dot uses this color (fallback: `#cc241d`).\n\n### Window \u0026 Tab Focusing\n\nOn `session-start`, the hook captures the terminal's X window ID (via `$WINDOWID` or `xdotool getactivewindow`). Clicking a dot uses `wmctrl -i -a` for cross-workspace window activation.\n\nFor Gnome Terminal tabs, the hook also captures the D-Bus window object path (from `xprop`) and the active tab index. On focus, `gdbus` activates the stored tab. The extension subscribes to `org.gtk.Actions.Changed` D-Bus signals for instant tab-level focus detection.\n\n### Stale Session Cleanup\n\nThe hook walks the process tree to find the actual `claude` PID and stores it in the session JSON. The extension reaps sessions whose PID no longer exists.\n\n## Prerequisites\n\n- Cinnamon desktop environment\n- `xdotool` — `sudo apt install xdotool`\n- `jq` — `sudo apt install jq`\n- `wmctrl` — `sudo apt install wmctrl`\n- `xprop` — typically pre-installed (part of `x11-utils`)\n- `gdbus` — typically pre-installed (part of `libglib2.0-bin`)\n\n## Install\n\n```bash\ngit clone https://github.com/fletch/claude-session-tracker.git\ncd claude-session-tracker\n./install.sh\n```\n\nThe install script:\n- Symlinks the hook script to `~/.local/bin/`\n- Symlinks the extension to `~/.local/share/cinnamon/extensions/`\n- Creates the state directory `~/.local/state/claude-sessions/`\n- Merges Claude Code hooks into `~/.claude/settings.json` (backs up first)\n\nThen reload Cinnamon (`Alt+F2 → r`) and enable in System Settings → Extensions → \"Claude Sessions\".\n\n## Testing\n\n```bash\n# Simulate an idle session\necho '{\"session_id\":\"test\",\"cwd\":\"/tmp\"}' | ~/.local/bin/claude-session-tracker notification-idle\n\n# Check state file was created\ncat ~/.local/state/claude-sessions/test.json\n\n# Clean up\necho '{\"session_id\":\"test\",\"cwd\":\"/tmp\"}' | ~/.local/bin/claude-session-tracker session-end\n```\n\nNote: manual test sessions created from a shell will be reaped by the extension's PID check (the hook's `$PPID` exits immediately). To test without reaping, write a JSON file directly with a long-lived PID (e.g. `\"pid\": 1`).\n\n## Known Limitations\n\n- If Claude crashes, `SessionEnd` never fires and the state file persists (stale PIDs are auto-reaped, but there may be a brief delay)\n- Window ID is captured at session start; if the terminal window is closed and recreated, the stored ID is stale\n- Tab focusing relies on Gnome Terminal's D-Bus interface; other terminal emulators will get window-level focus only\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmockdeep%2Fclaude-session-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmockdeep%2Fclaude-session-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmockdeep%2Fclaude-session-tracker/lists"}