sw-adopt

sw-adopt is a skill for Claude Code from Obsidian-Owl/specwright. It costs 27 tokens per session (882 once invoked), scanned A, original, MIT.

A workflow action for taking ownership of an existing piece of work in the current checkout, the directory containing the active branch.

In plain words
What is it for?
It attaches the selected work to the current workspace when ownership and branch checks pass, or explains why adoption was blocked.
Why use it?
It prevents two workspaces from unknowingly claiming the same work and checks for stale sessions or branch mismatches.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit It attaches the selected work to the current workspace when ownership and branch checks pass, or explains why adoption was blocked.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-adopt
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 Obsidian-Owl/specwright --skill sw-adopt
Clone the repo
git clone --depth 1 https://github.com/Obsidian-Owl/specwright

Made for: Claude Code.

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 sw-adopt

README.md
[![agentmods](https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-adopt/github.svg)](https://agentmods.dev/skills/obsidian-owl/specwright/sw-adopt)
Your own site
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-adopt"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-adopt/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 sw-adopt

Your own site · 80×15
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-adopt"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-adopt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 882 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.00027 $0.00882
Opus 5.5 $0.00011 $0.00353
Sonnet 5.5 $0.00005 $0.00176
Haiku 4.5 $0.00003 $0.00088

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

Security

Grade A, and why

sw-adopt 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 3mo 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.

core/skills/sw-adopt/SKILL.md · 95 lines

How it starts

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

Specwright Adopt

Goal

Attach an existing work to the current worktree without creating split-brain ownership. This skill attaches only the current worktree session.

Inputs

  • target work ID from the argument, or the current worktree session's attachedWorkId when re-adopting the already-selected work
  • {worktreeStateRoot}/session.json for the current worktree
  • {repoStateRoot}/work/{workId}/workflow.json
  • repo-wide session.json files discovered via git worktree list --porcelain

Outputs

  • updated {worktreeStateRoot}/session.json for the current worktree only
  • updated selected work workflow.json.attachment pointing at the current worktree when adoption succeeds
  • concise outcome explaining whether the work was adopted, blocked by a live owner, or blocked by branch mismatch

Constraints

Scope (LOW freedom):

  • /sw-adopt is the explicit same-work adoption flow. It must not silently run during /sw-design, /sw-plan, /sw-build, /sw-verify, or /sw-ship.
  • /sw-adopt never rewrites another worktree's session.json.
  • Subordinate sessions must not run /sw-adopt.

Target resolution (LOW freedom):

  • Resolve the target work from the argument first, then the current worktree's session.json.attachedWorkId as a fallback.
  • Validate that the target work exists under {repoStateRoot}/work/{workId}.
  • If no target work resolves, STOP and tell the operator to pass a work ID or run /sw-design.

Ownership validation (LOW freedom):

  • Use live-versus-dead session state as the adoption authority.
  • Inspect repo-wide session.json files to determine live-versus-dead session state for the target work.
  • Treat live top-level sessions as authoritative owners.
  • Treat dead top-level sessions as stale attachments that may be superseded.
  • Treat subordinate sessions as non-owners even when they reference the same workId.
  • If another live top-level worktree owns the target work, STOP and tell the operator to continue there or make that owner stale first. /sw-adopt does not perform remote session surgery.

Read the full file on GitHub · 95 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. 3mo ago First seen · 95 lines · 27 tokens per session scan A 50c83dac0c5d

Subscribe to this mod's changes

sw-adopt is a skill published in the GitHub repository Obsidian-Owl/specwright (10 stars, last pushed 7mo ago), licensed MIT. It adds 27 tokens to every session and 882 once invoked, about $0.0001 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-08-31.

Related

sw-adopt compared with skills from other repositories

sw-adopt next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sw-adoptObsidian-Owl/specwrightSkill107mo agoMITA27Claude Code
releasehyhmrright/brooks-lintSkill1.6kyesterdayMITA135Claude Code, Codex
procoderazrtydxb/procoderSkill21221d agoApache-2.0A101Claude Code
pr-feedbackjjanczur/tyranSkill788d agoApache-2.0A57Claude Code
git-workflowlgbarn/shipyardSkill671mo agoMITA78Claude Code
shipyard-verificationlgbarn/shipyardSkill671mo agoMITA73Claude Code
reviewgreglas75/zuvoSkill7todayMITA70Claude Code