ops-resume
GitHub用于在macOS Ghostty终端中恢复最近关闭的Claude Code会话。通过扫描项目目录,为每个有效会话在新标签页中重新打开并继续执行,支持预览和确认操作。
Trigger Scenarios
Install
npx skills add Lifecycle-Innovations-Limited/claude-ops --skill ops-resume -g -y
SKILL.md
Frontmatter
{
"name": "ops-resume",
"description": "Reopen recently-closed Claude Code sessions, one per Ghostty tab. Finds recent session transcripts in ~\/.claude\/projects and resumes each in its own new tab via `claude --resume`, from the directory it was running in. macOS + Ghostty only.",
"allowed-tools": [
"Bash"
],
"argument-hint": "[-m minutes | -H hours | -n max | --here | --dry-run]"
}
ops-resume
Reopen recently-closed Claude Code sessions — one session per Ghostty tab.
For every recent session transcript under ~/.claude/projects, the helper opens a
new Ghostty tab (cmd+t) and types cd <cwd> && claude --resume <sessionId>, so each
session resumes in its own tab from whatever directory or repo it was running in.
Default: every session touched in the last 60 minutes, from any directory.
Platform: macOS + Ghostty only. Tabs are driven via AppleScript System Events, so Accessibility permission must be granted to the terminal running this.
How it works
- Scans
~/.claude/projects/**/*.jsonland keeps files whose mtime is inside the lookback window (default 60 min) but older thanOPS_RESUME_MIN_AGE_SEC(default 45s — so the session you are currently in is not reopened). - Keeps only real interactive sessions (UUID filenames); skips subagent transcripts
(
agent-*), workflow journals, and empty/junk sessions. - Reads each session's original
cwdfrom the transcript. - For each, opens a fresh Ghostty tab and resumes the session there.
Usage
Run the bundled helper. Pass through any flags the user gave ($ARGUMENTS).
Always preview first with --dry-run, show the user the list, and — unless they
clearly asked to "just open them" — confirm before opening real tabs (opening many
tabs is hard to undo).
# Preview what would be resumed
${CLAUDE_PLUGIN_ROOT}/bin/ops-resume --dry-run $ARGUMENTS
# Actually open the tabs
${CLAUDE_PLUGIN_ROOT}/bin/ops-resume $ARGUMENTS
Flags
| Flag | Meaning |
|---|---|
-m, --minutes N |
Lookback window in minutes (default 60) |
-H, --hours N |
Lookback window in hours |
-n, --max N |
Cap number of tabs (default 20, newest first) |
--here |
Only sessions whose cwd == current directory |
--dry-run |
List matches, open nothing |
Env overrides
OPS_RESUME_MINUTES(60) — lookback windowOPS_RESUME_MAX(20) — safety cap on tabsOPS_RESUME_MIN_AGE_SEC(45) — skip sessions touched more recently than this
Reporting
After running, report concisely: how many sessions matched, how many tabs were
opened, and any that were capped/skipped. If --dry-run, just show the list and ask
whether to open them for real.
Version History
- 64bad13 Current 2026-08-12 09:01


