work-isolation

work-isolation is a skill for Claude Code from lukasrepublic/agentic-foundry. It costs 101 tokens per session (2,072 once invoked), scanned A, original, MIT.

A workflow for giving coding agents isolated Git worktrees, checking their file access, and cleaning up after their changes are merged.

In plain words
What is it for?
Use it when dispatching work to agents across one or more repositories and when validating or cleaning up their work.
Why use it?
It reduces the risk of agents editing files outside their assigned work and leaves fewer unused branches and worktrees behind.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

Part of the foundry plugin — 84 skills, 8 agents, 11 hooks, 1 MCP server shipped together

Good fit Use it when dispatching work to agents across one or more repositories and when validating or cleaning up their work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lukasrepublic/agentic-foundry/work-isolation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add lukasrepublic/agentic-foundry --skill work-isolation
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 84 skills, 8 agents, 11 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for work-isolation

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/work-isolation/github.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/work-isolation)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/work-isolation"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/work-isolation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for work-isolation

Your own site · 80×15
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/work-isolation"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/work-isolation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,072 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00101 $0.02072
Opus 5.5 $0.00040 $0.00829
Sonnet 5.5 $0.00020 $0.00414
Haiku 4.5 $0.00010 $0.00207

Measured 2mo ago against content hash 1c6f77b7924f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

work-isolation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/work-isolation/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/foundry:work-isolation

The work-isolation lifecycle — a WRAP over native primitives. Native primitives do the heavy lifting; foundry adds only the deltas.

action native does foundry delta
init Agent isolation:worktree creates the worktree + sets cwd nothing to build — use native dispatch (/foundry:dispatch). MULTI-REPO redirect additionally stages the atom's spec + acceptance-contract into the worktree and preflights them before the worker proceeds — see Spec-staged-and-preflighted jail below.
validate native confines cwd to the worktree foundry-cwd-enforce.sh write-jail: blocks Edit/Write resolving into the main checkout or another worktree of the same repo (Q2 — native is cwd-isolation, not a write-jail); ~/.claude/, the temp dirs and paths outside every checkout are admitted. Worker detected via linked-worktree git check (no assignment.json needed).
complete — the worker cuts its PR (gh pr create); the merge floor decides.
cleanup auto-cleans an UNCHANGED worktree foundry-work-isolation.sh cleanup <repo> <branch> removes a MERGED worktree + local branch (post-merge, the bit native doesn't auto-do). Worker-learnings harvest runs first — see below. SUPERSEDED for the whole-repo sweep (branch-and-worktree-discipline, v1.16.0) by scripts/foundry-worktree-gc.py --apply — see context/branch-discipline.md; this script stays (not deleted) for the one still-live case: cleaning up ONE just-merged worker's worktree+branch inline, mid-session, the instant its PR merges, without waiting for a repo-wide sweep.
learnings — Primary: the worker returns learnings[]; /foundry:dispatch captures them in the parent (durable, survives teardown). Defense-in-depth: foundry-harvest-learnings.sh forwards a worker's .agent/learnings.jsonl sidecar into .foundry/session-learnings/ (the /foundry:learn-distill partition) before an explicit git worktree remove — PreToolUse(Bash) seam + the cleanup script. Fail-open; durable loss-log.
break-glass — record a deliberate main-clone edit reason to the fail-closed audit trail (the former break-glass skill, folded).

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed 1c6f77b7924f
  2. 2mo ago Changed 484db8432a06
  3. 2mo ago First seen · 82 lines · 101 tokens per session scan A 3d06d6a7b265

Subscribe to this mod's changes

work-isolation is a skill published in the GitHub repository lukasrepublic/agentic-foundry (0 stars, last pushed 23d ago), licensed MIT. It adds 101 tokens to every session and 2,072 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

work-isolation compared with skills from other repositories

work-isolation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
work-isolationlukasrepublic/agentic-foundrySkill023d agoMITA101Claude Code
atlas-changelogtonone-ai/tononeSkill842d agoMITA45Claude Code
apex-retrotonone-ai/tononeSkill842d agoMITA32Claude Code
apex-statustonone-ai/tononeSkill842d agoMITA42Claude Code
apex-guardtonone-ai/tononeSkill842d agoMITD40Claude Code
g-doc-reviewonlygian/G-ForgeSkill41mo agoGPL-3.0A102Claude Code
g-retroonlygian/G-ForgeSkill41mo agoGPL-3.0A69Claude Code