Skip to content
Agent Orchestration
Skill

/workspace-isolation

Use when starting feature work that should not touch the current checkout, before executing an implementation plan, or when several agents or sessions will edit the same repository at the same time.

From plugin
godmode
12333 skills1 agent2 hooks

Claude Code

$ npx -y skills add NoobyGains/godmode --skill workspace-isolation --agent claude-code

SKILL.md

workspace-isolation.SKILL.md
name: workspace-isolation
description: "Use when starting feature work that should not touch the current checkout, before executing an implementation plan, or when several agents or sessions will edit the same repository at the same time."

Workspace Isolation

A git worktree is a second working directory on its own branch that shares the repository's history. Work in one cannot disturb the files in another, so a plan can run without risking the user's checkout, and parallel agents cannot overwrite each other.

**Core principle: detect existing isolation first, prefer the harness's own worktree mechanism, fall back to plain git, and never start work on a baseline you have not tested.** A worktree created behind the harness's back is state it cannot see or clean up; a worktree started on a red baseline makes every later failure ambiguous.

<!-- Claude Code worktree facts: https://code.claude.com/docs/en/worktrees and https://code.claude.com/docs/en/sub-agents (fetched 2026-10-25). Per-harness actions: skills/using-godmode/references/<harness>-tools.md. -->

The Prime Directive

NO IMPLEMENTATION WITHOUT AN ISOLATED WORKSPACE AND A KNOWN BASELINE

No exceptions. No workarounds. No shortcuts.

When to Use

**Required:**

  • Before `godmode:delegated-execution` or `godmode:inline-execution` starts Task 1.
  • Before parallel agents that write files (`godmode:parallel-execution`).
  • When the user's checkout has uncommitted work you must not disturb.

**Skip:**

  • Read-only investigation or review.
  • The user has said to work in place; record that in the ledger and still run the baseline tests.
  • Not a git repository: say so, and ask the user whether to `git init` or work in place.

The Protocol

1. Detect existing isolation

git_dir=$(cd "$(git rev-parse --git-dir)" && pwd -P)
git_common=$(cd "$(git rev-parse --git-common-dir)" && pwd -P)
super=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
branch=$(git branch --show-current)
  • `git_dir` differs from `git_common` and `super` is empty: you are already in a linked worktree. Do not create another. Go to step 4.
  • `super` is not empty: you are in a submodule, not a worktree. Treat it as a normal checkout.
  • Detached HEAD in a linked worktree: the host manages it. Note that a branch must be created at finish time.

2. Get consent and a name

If the user's instructions already state a worktree preference, follow it. Otherwise say in one line that you will create a worktree to protect their checkout, and proceed unless they have said to work in place. Choose a short branch name from the work (`feature/csv-export`, `fix/login-race`).

3. Create the worktree

**3a. The harness's own mechanism first.** If the harness can create a worktree itself (a built-in action, a command-line flag, or a per-subagent isolation option), use it: it owns placement, branch creation, cleanup and its own isolation checks. The harness reference names the action. Facts to know on Claude Code:

  • Session worktrees go under `.claude/worktrees/<name>/` on a branch `worktree-<name>`; add `.claude/worktrees/` to `.gitignore`.
  • New worktrees branch from the repository's default branch, not from your current `HEAD`, unless the project's worktree base setting says otherwise. If the work must build on unpushed commits or a feature branch, check the base before relying on it.
  • Gitignored files such as `.env` are not copied unless the project has a `.worktreeinclude` file listing them.
  • A subagent run with worktree isolation gets a temporary worktree that is removed automatically if it made no changes.

**3b. Plain git otherwise.** Pick the directory in this order; an explicit preference always beats what you find on disk: 1. A worktree directory the user's instructions declare. 2. An existing `.worktrees/` at the repository root. 3. An existing `worktrees/` at the repository root (if both exist, `.worktrees/` wins). 4. Default: create `.worktrees/`.

Verify a project-local directory is ignored before creating anything inside it:

git check-ignore -q .worktrees || echo "NOT IGNORED"

If it is not ignored, add the directory to `.gitignore`, commit that one-line change on the current branch, and say so. An unignored worktree directory gets committed into the repository wholesale.

base=$(git rev-parse HEAD)           # or the branch the plan says to start from
git worktree add ".worktrees/$name" -b "$branch" "$base"
cd ".worktrees/$name"

If creation fails with a permission or sandbox error, tell the user, and work in the current checkout on a new branch instead.

4. Set up the project

Detect and run the project's own setup, preferring what its README or contributing guide says over guesses:

| Marker | Setup | |---|---| | `package-lock.json` / `pnpm-lock.yaml` / `yarn.lock` | `npm ci` / `pnpm install --frozen-lockfile` / `yarn install --frozen-lockfile` | | `pyproject.toml` / `requirements.txt` | the project's tool (`uv sync`, `poetry install`, `pip install -r requirements.txt`) in a virtual environment | | `Cargo.toml` | `cargo build` | | `go.mod` | `go mod download` |

Copy any local configuration the tests need (for example `.env.example` to `.env`) only when the project documents it. Never copy secrets into a tracked file. `godmode:environment-awareness` covers shell and package-manager differences.

5. Run the baseline tests

Run the project's full test command and read the output.

  • **Green:** record the count.
  • **Red:** report the failures and ask the user whether to proceed or investigate first. If they say proceed, ledger `Baseline: <n> failing before any change: <names>` so later failures can be told apart.

6. Report

Worktree: <absolute path>  (branch <name>, from <base sha>, created by <harness | git>)
Setup: <command> ok
Baseline: <command> -> <n> passed, <m> failed

This block goes in the plan ledger as well as the message.

Cleanup

Cleanup belongs to `godmod

Read more
@noobygains
Ships withgodmode

Engineering discipline for AI coding agents: question the request, verify against current docs, plan, build test-first on the cheapest capable model, review with a second model family, prove it before saying done. One repo for Claude Code, Codex, Antigravity, Cursor, Gemini CLI and OpenCode.

12333 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
123
Star history of NoobyGains/godmode on GitHub, a chart by star-history.com

Other skills on godmode.

agent-briefing

agent-briefing

Use when writing a prompt for a subagent or teammate, deciding how much context another agent needs, writing or reading a handoff…

@noobygains@noobygainsInstall Skill
code-review

code-review

Use when a task, feature or bug fix is implemented and before it is committed, merged or handed back to the user, and when the…

@noobygains@noobygainsInstall Skill
codebase-conventions

codebase-conventions

Use when about to add or change code in an existing codebase: a new file, module, route, component, service, test, migration,…

@noobygains@noobygainsInstall Skill
completion-gate

completion-gate

Use when about to say that work is done, fixed, passing, working, deployed or ready, before committing, opening or merging a pull…

@noobygains@noobygainsInstall Skill
cross-model-review

cross-model-review

Use when a reviewed change is about to land on a shared branch, be released or be deployed, and when the user asks for a second…

@noobygains@noobygainsInstall Skill
delegated-execution

delegated-execution

Use when a written implementation plan is ready to execute in the current session and its tasks are mostly independent, so each…

@noobygains@noobygainsInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about workspace-isolation.

Which coding agents can use workspace-isolation?
workspace-isolation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.