close-window

Closes the Terminal window of a finished dev-team Claude Code session on macOS.

1|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/apireno/agent-workflow-template --skill close-window-apireno
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: close-window
Source: https://github.com/apireno/agent-workflow-template/tree/main/.claude/skills/close-window
Command: npx skills add https://github.com/apireno/agent-workflow-template --skill close-window-apireno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After a sprint finishes, Terminal windows from Phase 2 dev-team sessions pile up, and closing them manually triggers macOS "terminate running processes?" prompts that block automation. This Skill closes the correct window hands-free while protecting live sessions. ## Core Features & Use Cases - Safe window teardown: Resolves the repo's Terminal window via an append-only window registry, pre-kills the window's processes by tty, and closes it without blocking on confirmation sheets. - Sprint-completion guard: Refuses to close unless dev-report.md exists under the repo's docs/sprints directory, with a --force override for aborting a sprint. - Ambiguity protection: Refuses to click a Terminate sheet when multiple windows show one, so a live dev session is never killed by mistake. - Use Case: At sprint wind-down, after /sprint-accept has run, invoke it with the repo name to clean up tab accumulation from multi-sprint sessions while the JSONL transcript stays preserved on disk for /peek or /resume-dev-team. ## Quick Start Ask the agent to close the dev-team window for a given repo, for example: close the window for acme-service-a now that the sprint report is in.

Frequently Asked Questions about close-window

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I close a Claude Code dev-team Terminal window automatically?

Run the skill with the repo name, for example /close-window acme-service-a. It resolves the window id from the registry, terminates the window's processes by tty, and closes the window via AppleScript without manual confirmation.

Why does the skill refuse to close my Terminal window?

It refuses when no dev-report.md exists under the repo's docs/sprints directory, which indicates the sprint is still in progress. Re-run with the --force flag if you intentionally want to abort the sprint and close anyway.

Does closing the window delete the Claude session transcript?

No. The JSONL transcript at ~/.claude/projects/... is flushed continuously and remains on disk after the window closes, so you can still use /peek or /resume-dev-team against that session later.

What happens if multiple Terminal windows show a Terminate sheet?

The skill clicks none of them, because System Events cannot distinguish sheets by window id and one may belong to a live dev session. It reports the ambiguity and asks you to click the correct sheet manually.

What permissions does macOS Terminal window automation require?

It requires Accessibility permission for Terminal, granted in System Settings under Privacy & Security, the same requirement as the /send skill. It also relies on osascript and the window registry script in scripts/cto.