adopt

adopt is a command for coding agents from koolamusic/claudefiles. It costs 38 tokens per session (2,733 once invoked), scanned A, original, MIT.

A command that presents selected memory fragments from an archived Studio workspace and lets the user copy them into local Claude memory. Claude memory is the local information used to retain project context between sessions.

In plain words
What is it for?
Use it to review memory snapshots by host or date, choose which fragments to adopt, and safely add them to the local memory directory.
Why use it?
Useful context from another computer can otherwise remain isolated in archived snapshots. Per-fragment confirmation and backups help prevent unwanted or irreversible overwrites.

Command

Part of the studio plugin — 4 commands shipped together

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.

agentmods
npx agentmods add commands/koolamusic/claudefiles/adopt
Clone the repo
git clone --depth 1 https://github.com/koolamusic/claudefiles

Or install studio, the plugin that ships this one along with the rest of its 4 commands.

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 adopt

README.md
[![agentmods](https://agentmods.dev/badge/commands/koolamusic/claudefiles/adopt.svg)](https://agentmods.dev/commands/koolamusic/claudefiles/adopt)
Your own site
<a href="https://agentmods.dev/commands/koolamusic/claudefiles/adopt"><img src="https://agentmods.dev/badge/commands/koolamusic/claudefiles/adopt.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,733 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00038 $0.02733
Opus 5 $0.00019 $0.01367
Sonnet 5 $0.00008 $0.00547
Haiku 4.5 $0.00004 $0.00273

Measured 4d ago against content hash fbaebcf3d7d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 4d 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.

plugins/studio/commands/adopt.md · 141 lines

How it starts

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

Overview

Bring cross-machine Claude memory into the local memory dir. The archive at <workspace>/memory/archive/<host>/<iso>/ is read-only reference; this command presents candidates, the user picks, the command copies (backing up overwrites). Never writes without per-fragment confirmation.

Arguments

  • --host <name> — restrict enumeration to a single host (default: all hosts).
  • --since <YYYY-MM-DD> — restrict to snapshots from this date forward (UTC).
  • --all — skip the latest-per-host reduction and consider every snapshot. Rarely needed.

Steps

  1. Resolve workspace and config.
    • Read .workspacerc from pwd (the project root). If the file is missing, stop with [studio] not a studio-managed project (no .workspacerc); run /studio:setup first and exit 1.
    • Parse the JSON workspace field; expand a leading ~ via ${HOME}. Call this WORKSPACE.
    • If [[ ! -d "$WORKSPACE" ]], stop with [studio] workspace dir not found: $WORKSPACE and exit 1.
    • Read ${WORKSPACE}/studio.yaml. Extract (using yq):
      archive_dir=$(yq eval '.memory.archive_dir // "memory/archive"' "${WORKSPACE}/studio.yaml")
      RAW_SOURCE=$(yq eval '.memory.source' "${WORKSPACE}/studio.yaml")
      default_filter=$(yq eval '.adoption.default_filter // "latest-per-host"' "${WORKSPACE}/studio.yaml")
      preview_chars=$(yq eval '.adoption.preview_chars // 200' "${WORKSPACE}/studio.yaml")
      backup_on_overwrite=$(yq eval '.adoption.backup_on_overwrite // true' "${WORKSPACE}/studio.yaml")
      backup_suffix=$(yq eval '.adoption.backup_suffix // ".local-backup-{iso}"' "${WORKSPACE}/studio.yaml")
      
    • If preview_chars is 0 or negative, treat it as 200 silently.
    • Derive PROJECT_HASH from pwd. ${PROJECT_HASH} is expanded by this command, not by Claude Code's plugin loader. The two-stage sed pipeline is the canonical derivation:
      PROJECT_HASH=$(pwd | sed 's|/|-|g' | sed 's|\.|-|g')
      
    • Expand memory.source with PROJECT_HASH and ~ to produce LOCAL_MEMORY:
      LOCAL_MEMORY="${RAW_SOURCE//\$\{PROJECT_HASH\}/$PROJECT_HASH}"
      LOCAL_MEMORY="${LOCAL_MEMORY/#\~/$HOME}"
      

Read the full file on GitHub · 141 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. 4d ago First seen · 141 lines · 38 tokens per session scan A fbaebcf3d7d6

Subscribe to this mod's changes

adopt is a command published in the GitHub repository koolamusic/claudefiles (132 stars, last pushed 4d ago), licensed MIT. It adds 38 tokens to every session and 2,733 once invoked, about $0.0002 per session on Opus 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-30.