agentleFS
amntoppoamntoppo/MasterDeck-Terminal/skills/babysit-worktree/SKILL.md

babysit-worktree

Skill4 starsChanged 25 days agoMITView on GitHub

Create an isolated git worktree and switch this session into it so all further changes happen there, keeping the main checkout clean. Use when the user says "/babysit-worktree", "work in a worktree", or wants this session's changes isolated from the main working copy. Pair with kill-worktree to fold the work back.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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. Distinctive:

    Check current state first: Run git status in the current repo:

    line 14
  2. Very specific:

    Enter: Use the EnterWorktree tool with a task-descriptive name (e.g.

    line 22
  3. Distinctive:

    Do not edit files in the main checkout while the worktree session is active — the whole point is isolation.

    line 40
  4. Distinctive:

    If your workspace has several repos: worktrees are per-repo.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

babysit-worktree — isolate this session's changes in a worktree

Goal: everything this session edits from now on lands in a dedicated worktree under .claude/worktrees/, not in the main checkout. The main working copy stays untouched for other sessions, editors, or running services.

Steps

  1. Check current state first. Run git status in the current repo:
    • Uncommitted changes the user wants in the worktree will NOT follow automatically — the worktree branches fresh. Either commit them first, or carry them over with git stash push -u now and git stash pop inside the worktree after entering (stashes are shared repo-wide, visible from every worktree).
    • Already inside a worktree session? Say so and stop — one at a time; run kill-worktree (or ExitWorktree) first.
  2. Enter. Use the EnterWorktree tool with a task-descriptive name (e.g. fix-coupon-rounding). Do not use raw git worktree add — the tool also switches the session's working directory and registers exit-time cleanup.
    • Note the base ref: with default settings (worktree.baseRef: fresh) the new branch starts from origin/<default-branch> — NOT from the local HEAD. If the task must build on unpushed local commits, tell the user and either push them first or ask them to set worktree.baseRef: "head" in settings.
  3. Confirm. Report the worktree path and branch (git worktree list, git branch --show-current). All subsequent edits, commits, test runs, and PR creation in this session happen here.
  4. Work as normal. The babysit-pr hooks and skill still apply — gh pr create from inside the worktree triggers the self-review gate and the comment monitor exactly as in the main checkout (same repo, same .git).

Rules

  • Do not edit files in the main checkout while the worktree session is active — the whole point is isolation. If the user asks for a change to the main checkout, flag the conflict and let them decide.
  • The worktree shares the repo's object database: commits, branches, and stashes made here are visible from the main checkout immediately. Only the working files are isolated.
  • If your workspace has several repos: worktrees are per-repo. A cross-repo task needs a worktree in each affected sub-repo — say so before starting, and only isolate the repo(s) actually being changed.
  • To leave: use kill-worktree (fold branch + stash back to the main repo and drop the worktree) or ExitWorktree keep (park it to resume later).

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.