agentleFS
daymadedaymade/claude-code-skills/ghostty-use/SKILL.md

ghostty-use

Skill1.4k starsChanged 8 months agoMITView on GitHub

Snapshots, restores and reconciles Claude Code / Codex sessions inside Ghostty tabs across reboots. Use when quitting the Mac for an update (保存终端会话 / 重启前备份终端), after restart to reopen tabs with their original session IDs (恢复之前的窗口 / restore my ghostty tabs), or to audit which sessions survived. Not for resuming one conversation via its own --resume, terminal screenshots, or tmux state.

Trending

Less talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 3 mentionsSep 2026: 1 mentionOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the daymade/claude-code-skills repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about daymade/claude-code-skills

The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 14

Talked about on GitHub (14 times).

On GitHub · 14

9 more on GitHub

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    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
  1. Very specific:

    If your Claude profiles inject config via environment (e.g.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ghostty-use

Seamlessly carry Claude Code and Codex terminal sessions across a reboot: capture every live session with a liveness grade before shutdown, reopen all worthwhile tabs with their original session IDs after restart, and prove nothing was silently dropped.

Ghostty on macOS has no session-restoration CLI or AppleScript tab dictionary (verified on Ghostty 1.3.1, 2026-10-04), so this skill walks a practical loop around that limit: ps-derived session inventory → liveness-graded snapshot → keystroke-paste restore → automatic reconciliation that makes every paste failure visible.

Entry decision tree

You just said / wantRun
Quitting for an update / reboot ("重启前保存会话")snapshot
Rebooted, want tabs back ("恢复之前的窗口")restore (then read its auto-check)
"Was anything lost?" / suspicion after restorecheck
One specific session to bring backrestore --only <id-prefix>

Quick start

# Before quitting (from any directory):
python3 <skill-dir>/scripts/ghostty_session.py snapshot

# After restart (from any directory; needs Accessibility permission for keystrokes):
python3 <skill-dir>/scripts/ghostty_session.py restore        # active sessions only
python3 <skill-dir>/scripts/ghostty_session.py restore --all  # include stale ones

The snapshot lands in ~/.ghostty-session/snapshots/ (home-relative, survives reboot). restore finishes with an auto-check that prints N/M present plus a manual reopen command for anything missing — read it before declaring success.

What snapshot records per session

  • Anchor: the session UUID from the process command line (never match on process names — argv[0] flips between bare claude and /usr/local/bin/claude, and name matching produced two false "all sessions gone" reports on 2026-10-04).
  • Liveness: last real interaction time read from the content of the session file — not the file mtime (idle TUIs keep touching files; on 2026-10-04 an "active this afternoon" read was contradicted by in-file timestamps showing death at 03:21).
  • Channel health: dead-channel when a Claude transcript's tail carries a structured isApiErrorMessage with "Login expired" — restoring such a tab reopens history but the session stops at /login; the snapshot marks it so you can skip it. Prose inside a conversation that merely discusses an error never counts (a healthy session that once talked about "Login expired" was misclassified before this rule).
  • Profile: parsed from --settings .../settings/<name>.json when present, else direct.

Restore mechanics and limits

  • Reopen = activate Ghostty → Cmd+T → clipboard-paste the reopen command → Return, one tab per session, followed by mandatory auto-reconciliation. Keystroke paste is timing-sensitive: an interruption between Cmd+T and the paste leaves an empty tab whose command was silently lost (measured 2026-10-04). The auto-check exists to make that visible; never skip it, and never declare success from paste return codes alone.
  • Requires Accessibility permission for osascript keystrokes (System Events).
  • Window grouping is not restorable — Ghostty's macOS accessibility surface exposes no tab→window mapping. All tabs reopen into one window; reorder manually if needed.
  • Rollout files that codex itself cannot find anymore print no-artifact; restoring them replays the same codex resume <id> and stays a best effort.

Profile environment mapping (optional)

If your Claude profiles inject config via environment (e.g. CLAUDE_CONFIG_DIR), record prefixes in ~/.ghostty-session/profile-env.json so restored tabs boot the same profile context:

{"research": "CLAUDE_CONFIG_DIR=~/.claude-profiles/research", "family": "HTTP_PROXY=http://127.0.0.1:7890"}

Without it, restores replay the captured --settings flag only. The mapping is user-local data outside the skill bundle; no default mapping ships.

Troubleshooting

SymptomCause / fix
restore reports STILL MISSINGpaste raced an interruption; run the printed reopen command by hand in a new tab
no-artifact on a codex sessionits rollout file is gone from ~/.codex/sessions; codex resume <id> is best-effort
dead-channel sessions restored anywayexpected: history reopens, session stops at /login; re-auth or switch provider
check says present but tab looks emptyanother live process already claimed that session id (e.g. resumed in another tab)
osascript refuses keystrokesgrant Accessibility (System Events) permission; verify with osascript -e 'tell application "System Events" to get UI elements enabled'
session list empty right after opening tabsTUIs take a few seconds to write their argv UUID; re-run after a pause

Deeper details

  • references/session_liveness.md — storage layouts (Claude projects / Codex sessions), transcript structures, resume-fork naming, liveness rules and the misclassification cases behind them. Read when a liveness result looks wrong or layouts changed after an app update.
  • references/restore_mechanics.md — why Ghostty offers no CLI/AX restore path, the keystroke-paste protocol, reconciliation design, and the window-grouping boundary. Read before modifying the restore path.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.