manual-worktree-session
Create a Git worktree manually and attach an in-place Copilot child session when large repositories such as the dotnet VMR exceed native session/worktree…
Skill by mthalman
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mthalman-manual-worktree-session
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/manual-worktree-session
What's inside
- Skill name
manual-worktree-session- Description
- Create a Git worktree manually and attach an in-place Copilot child session when large repositories such as the dotnet VMR exceed native session/worktree initialization timeouts, or when the user explicitly requests this parent-managed workflow. Use for manual worktree session creation and guarded recovery of this workflow's interrupted initialization, not ordinary isolation or worktree cleanup.
- License
- MIT
- Compatibility
- Requires PowerShell 7+, Git, long-running shell execution, and app create_project/create_session tools.
- Instructions
- 151 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (2)
- SKILL.md
- Initialize-ManualWorktree.ps1 · scripts/
SKILL.md (first lines)
# Manual Worktree Session
Create and verify the checkout before asking the app to create a session.
Native initialization can time out after 300 seconds on large repositories,
leaving a registered but incomplete worktree. A project or session ID does not
prove that Git finished checking out files.
This is an intentional exception to `using-git-worktrees`' native-first policy.
Do not retry native worktree creation for a repository already known to hit
that timeout. Do not create another worktree when the user asks to work in the
existing checkout.
## Prepare the parent
1. Capture the user's actual task verbatim, intended base commit, and child
mode. Preserve explicit choices; otherwise use the source checkout's HEAD
and `plan` mode. Do not infer permission to commit, push, or open a PR.
2. Select a new branch and nonexistent absolute worktree path **outside all
existing checkouts**. Use an existing parent directory, preferably a sibling
of the source checkout. Keep the state JSON in the parent's session artifact
directory, outside checkouts. The helper refuses overlaps, reparse-point
ancestors, existing targets, and submodule trees.
3. Resolve `scripts\Initialize-ManualWorktree.ps1` from this skill's installed
root, not the user's repository. The helper requires PowerShell 7 and
resolves Git's executable explicitly; it does not use cmd.exe or depend on
cmd.exe's PATH lookup.
## Create and verify the worktree
Run through a long-running shell tool, with a generous initial wait:
```powershell
pwsh -NoProfile -File <absolute-helper-path> -Action Create `
-RepoPath C:\repos\dotnet -WorktreePath C:\repos\dotnet-task `
-Branch manual-task -StartPoint HEAD `
-StatePath <absolute-session-artifacts-path>\manual-task.json
```
The helper pins the commit before creation and records recovery state before
running Git. It uses per-command long-path, filesystem-monitoring, sparse
checkout, submodule recursion, and hook overrides, never shared/global config
changes. It does not fetch, copy dirty source files, switch the source branch,
reset, force checkout, remove worktrees, or delete a failed checkout.
The empty `<StatePath>.lock` guard stays beside the state file; its existence
does not mean an operation is active. An exclusive file handle guards each run.
If the shell returns a running handle, retain it and wait for that same
operation. Read its output after completion. A tool wait expiring is not a Git
failure, and the helper has no 300-second cutoff. Do not launch another Create
or recovery while the original operation is still running.
Require exit success and JSON with `status: "ready"`. Then run:
```powershell
pwsh -NoProfile -File <absolute-helper-path> -Action Verify `
-StatePath <absolute-session-artifacts-path>\manual-task.json
```
Require `ready` again. Verification checks repository/worktree registration,
branch and pinned HEAD, initialization locks, complete index tree, missing
tracked files, unexpected changes, and flags that could conceal edits.
Errors emit `status: "error"` with a message and terminate unsuccessfully.
Never treat partial output or a registered path alone as success.
## Register the existing checkout and delegate
Use app tools in this order; there is no established script API for them:
1. Call `create_project(path: <verified worktree_path>)`, not a clone URL.
Registering this existing checkout is part of the user's requested workflow.
2. Call `create_session(project_id: <returned project ID>,
workspace_type: "branch", kickoff: {prompt: <task>, mode: <selected mode>})`.
**Omit `base_branch`.** Supplying it can trigger prepared-branch behavior.
Do not use `workspace_type: "worktree"`; that repeats native initialization.
3. Inspect the child with `get_session`. Confirm its workspace is the exact
worktree path and its branch matches the verified branch. If registration
reused a project with a different checkout, or the child points elsewhere,
stop delegation and report the mismatch rather than claim success. Direct
the child not to edit while a mismatched session is being investigated.
4. Require child evidence that its cwd, branch, and HEAD match the verified
checkout before it modifies files. Pass the expected path, branch, and
commit in the kickoff prompt together with this instruction.
Keep the user's task as a separate verbatim quote in the kickoff. Add only
execution context, expected checkout identity, coordination instructions, and
the user's restrictions. Do not expand the requested scope.
If registration/session creation fails, keep the verified checkout and state.
Retry only the failed app step; do not recreate the worktree. Record project
and session IDs in parent session artifacts so subsequent attempts can inspect
and reuse them rather than duplicate sessions.
## Recover interrupted initialization conservatively
Recovery supports only an initialization recorded by this helper, in
`initializing` or `failed` phase. It deliberately does not adopt arbitrary
existing worktrees or previously ready worktrees. Native app failures without
such a record need a separate investigation, not a manufactured state file.
Before recovery, establish all three facts:
- This exact checkout is a failed initialization with no user/child work.
- Its session is stopped (or no session was created).
- No Git writer remains active. Wait on the retained shell handle or stop
only the owned process tree with its tool handle; inspect uncertain process
ownership rather than killing Git processes by name.
The switches below attest these facts; the helper cannot inspect app sessions
or prove that unrelated processes will not write. It takes an exclusive state
guard and refuses ambiguous checkout contents. Do not assert these switches
merely because an app timeout occurred.
```powershell
pwsh -NoProfile -File <absolute-helper-path> -Action Recover `
-StatePath <absolute-session-artifacts-path>\manual-task.json `
-FailedInitializationConfirmed -SessionStopped -NoActiveWriter
```
The helper checks surviving tracked files against a temporary HEAD index,From mthalman/agents, MIT.
More from mthalman/agents
- 0.592score
dispatching-parallel-agents
mthalman
Use when facing 2+ substantial tasks that can run without shared state or sequential dependencies, or when a high-value uncertain task justifies an explicitly…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
claude-extension-type-identifier
mthalman
Use when determining what type of Claude Code extension (command, skill, or agent) a prompt or description should be classified as.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
logo-design
mthalman
Use when designing logos, creating brand marks, or helping with visual identity work - provides expert logo design process including discovery, strategic…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
azure-pipeline-monitor
mthalman
Monitor an Azure DevOps (ADO) pipeline run to completion — the whole run or a single stage/job — using a blocking poller that estimates expected duration from…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
markdown-toolkit
mthalman
Use when generating or validating GitHub Flavored Markdown structure and mechanics, including headings, links, tables, lists, code fences, anchors, templates…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
code-refactorer
mthalman
Expert code refactoring that strictly preserves existing behavior.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
code-reviewer
mthalman
Review code changes for correctness, performance, safety, and quality when the user explicitly asks for a code review.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
copilot-pr-review
mthalman
Full GitHub Copilot PR review feedback loop — add Copilot as reviewer, poll for review, respond to comments, resolve threads, re-request review, and repeat…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
defend-the-diff
mthalman
Interrogate an existing code change through focused questions, evidence-backed answers, and independent judgment so the change is explainable, correct…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
designing-ui-color
mthalman
Use when selecting colors for interfaces, evaluating color combinations, creating palettes, resolving stakeholder color conflicts, or when colors "feel wrong"…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
designing-ui-typography
mthalman
Use when designing typography for web/app interfaces, selecting fonts, setting up type scales, addressing performance/accessibility concerns, or handling…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
blast-radius
mthalman
Analyze what a proposed or completed code change could break outside the visible diff, identify the small set of safety assumptions the change depends on, and…
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 26
- Last commit (this folder)
- Oct 7, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mthalman/agents
- Website
- mthalman.github.io/agents/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mthalman
- 0.592score
claude-extension-type-identifier
mthalman
Use when determining what type of Claude Code extension (command, skill, or agent) a prompt or description should be classified as.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
logo-design
mthalman
Use when designing logos, creating brand marks, or helping with visual identity work - provides expert logo design process including discovery, strategic…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
azure-pipeline-monitor
mthalman
Monitor an Azure DevOps (ADO) pipeline run to completion — the whole run or a single stage/job — using a blocking poller that estimates expected duration from…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
code-refactorer
mthalman
Expert code refactoring that strictly preserves existing behavior.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
code-reviewer
mthalman
Review code changes for correctness, performance, safety, and quality when the user explicitly asks for a code review.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
copilot-pr-review
mthalman
Full GitHub Copilot PR review feedback loop — add Copilot as reviewer, poll for review, respond to comments, resolve threads, re-request review, and repeat…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
manual-worktree-session skill. Agent Mart. https://agentmart.dev/skills/mthalman-manual-worktree-session (last updated 2026-10-24)