Files
lauren d7cde2b84e pstack: replace semicolons, em dashes, and connector colons in skill prose with periods or commas (#331)
Punctuation and single-word swaps only. No sentence added or deleted, no
restructuring, no new text.

- 65 markdown files under pstack/skills. 220 changed lines, every changed
  line pairs with one base line.
- 272 rewrites. 239 semicolons (224 became a period plus a capital, 15 became
  a comma). 29 connector colons (28 became a period, 1 became a comma).
  1 em dash before a list became a colon. 3 word swaps (`public surface` and
  `smaller surface area` to `API`, `echo the scaffolding` to `echo the
  structure`).
- Label colons, colons before a list or an example, template strings such as
  `file:line`, and the literal `TL;DR` stay.
- Heading, numbered-step, fenced-block, and line counts are unchanged in
  every file. No frontmatter, code span, or fenced block changes.
- o200k tokens of the pstack/skills markdown tree 87,747 before, 87,766
  after (+19), because a period plus a capital tokenizes one token longer
  than a semicolon in a few places.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-07 17:00:12 -07:00

2.9 KiB

Worktree and simulator cleanup

You own the disk and the safety gate. Prune merged or abandoned git worktrees and stale iOS simulators to reclaim space. Deletion is irreversible, so every step guards against deleting something in use or holding uncommitted work.

  1. Snapshot and audit. Record df -h /, then run scripts/worktree-audit.sh (principle-build-the-lever). It reads paths from git worktree list, never hand-typed, since a hand-typed myrepo-worktrees/x misses one that lives at .cursor/worktrees/myrepo/x (principle-encode-lessons-in-structure). It classifies each worktree by size, age, merge state, uncommitted work, PR state, and the newest chat that touched it, then suggests a bucket. The transcript scan is slow, so background it.
  2. The bucket is advice, not permission. The pinned and active chats are the real artifact (principle-prove-it-works). Get that set from the user or sidebar and cross-check every candidate. The lever has marked safe a worktree the user had pinned, so the pinned set wins.
  3. Verify usage before deleting. For every verify-recent-chat row, or anything you doubt, fan subagents out to read the transcripts and report whether the chat is pinned or ongoing and which worktrees it touches (principle-guard-the-context-window, transcripts are bulk). A pinned chat spawns arena and repro trees into sibling worktrees via background subagents, and those are in use even when their names never hit the sidebar.
  4. Pause on irreversible loss. wip:N is N tracked uncommitted edits. Show the diff and get a decision first, since removing a clean worktree is recoverable from its branch but uncommitted work is gone. scratch:N is untracked throwaway, safe to drop, but name the files. Per Autonomy, clean and merged and not-in-use proceeds. wip and in-use pause.
  5. Prune the confirmed set. Per path, git worktree remove --force <path>. If the dir survives on ignored build artifacts, rm -rf it, then git worktree prune. Branch refs survive, so no commits are lost. Confirm with df -h / and re-list.
  6. Simulators and other reclaimers. Simulators are usually the next-biggest win. xcrun simctl --set testing delete all (XCTestDevices clones), xcrun simctl delete unavailable, and xcrun simctl runtime list then runtime delete <id> for old runtimes. More when needed: Xcode DerivedData and iOS DeviceSupport, ~/Library/Application Support/Cursor (state.vscdb.backup, and snapshots/roots/<root> where a <root> named for a folder you opened as a workspace balloons), package caches (pnpm, uv, brew, yarn). Clear only caches the user has not said to keep.

This is the one playbook that deletes user state with no code review to catch a slip, so the gates above are the review.

Reply: df -h / before and after with space reclaimed, the worktrees pruned, and a one-line reason for each held back (in-use by which chat, or uncommitted work).