Index of every page on this site: llms.txt
All skills
bydradev avatar

/worktrees-and-scratch

@20b39bd
Run it yourself

Use before creating a git worktree, verification copy, or temporary file, running checks in an isolated tree, or finishing a task that created any of these. Covers verifying in place, where worktrees live, reusing one worktree per purpose, shared build caches, scratch directories, and cleanup.

  • 1 file
  • 2.6 KB
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/bydradev/gh-repo-bootstrapper/worktrees-and-scratch

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈79 tokens for metadata: the name and description. ≈587 when used: this file.

Description uses 4.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈318 characters, or 4.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Worktrees, verification copies, and scratch output

Disk is shared by every agent session on the machine, and nothing cleans up after a session ends. Anything a task creates outside the tracked tree belongs to that task, and removing it is part of the task.

  • Verify in place first. Run checks in the working tree when it reflects the change under test. When an isolated tree is genuinely needed (a clean-tree qualification, a mutation run, a comparison between commits), use git worktree add --detach. Never copy a checkout with cp -R, rsync, or similar: that duplicates installed dependencies and build output, and a worktree starts from tracked files only.
  • Keep worktrees outside the checkout, in one place per repository, such as ../.worktrees/<repo>/<purpose> next to the clone. A worktree nested inside the checkout is picked up by test discovery, type-checking, file watchers, and search. When a harness manages its own worktree location, use that.
  • Reuse one worktree per purpose across runs: check out the next commit in it rather than adding a worktree per run, per commit, or per reviewer. When a run needs a pristine tree, clean a worktree this task created rather than creating another. In a worktree you did not create, remove only output you can identify as this task's, and report anything else instead of cleaning it.
  • Keep build caches shared, not multiplied. Where this repository's Tooling guidance (the AGENTS.md Tooling section or a local-validation-<type> skill) says where a worktree's dependencies and build output live, follow it; otherwise keep them inside that worktree so they are removed with it.
  • Put temporary files in the session's scratch directory when the harness provides one, otherwise in a mktemp -d directory, never at fixed paths in /tmp, in the checkout's parent directory, or in sibling folders next to it. Evidence that must outlive the session belongs where this repository documents it; otherwise summarize it in the report rather than leaving files behind.
  • Clean up before finishing. Remove the worktrees you added with git worktree remove, then git worktree prune, and delete the scratch output you created. Remove only what this task created; report anything else you find rather than deleting it.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 20b39bd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month

README badge

README badge for bydradev/gh-repo-bootstrapper/worktrees-and-scratch