import

A command that registers an existing Git checkout with a metarepo workspace system. A Git checkout is a local copy of a repository containing its history and branches.

In plain words
What is it for?
Use it to import a repository after checking its remote, branches, uncommitted changes, unpushed commits, and saved work-in-progress changes.
Why use it?
It avoids manually gathering repository details and helps detect conditions that could make the import unsafe or incomplete.

Command

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/mdsakalu/agent-plugins/import
Clone the repo
git clone --depth 1 https://github.com/mdsakalu/agent-plugins
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 993 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.00012 $0.00993
Opus 5 $0.00006 $0.00496
Sonnet 5 $0.00002 $0.00199
Haiku 4.5 $0.00001 $0.00099

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

Security

Grade A, and why

import 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 2d 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.

workspace/commands/import.md · 63 lines

How it starts

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

Import an existing git checkout into the metarepo workspace system.

Resolve the metarepo path by reading ~/.claude/workspace-config.json and expanding ~ to $HOME.

The user's request: $ARGUMENTS

Steps

  1. Read ~/.claude/workspace-config.json to get the metarepo path. Expand ~ to $HOME.
  2. Validate the source path:
    • Expand ~ to $HOME in the provided path
    • Verify .git exists in the source directory
    • If .git is a file (not a directory), warn the user that the source is a git worktree — import may have unexpected results
    • Refuse if the source path is already inside <metarepo>/repos/
  3. Preflight the source — run git commands to collect information:
    • Remote URL: git -C <path> remote get-url origin (fallback to first available remote)
    • Current branch: git -C <path> branch --show-current
    • All local branches: git -C <path> branch --format='%(refname:short)'
    • Dirty state: git -C <path> status --porcelain
    • Unpushed commits per branch: git -C <path> log origin/<branch>..<branch> --oneline for each branch
    • Stash list: git -C <path> stash list — if non-empty, warn that stashes will NOT be imported
  4. Resolve repo mapping — parse the origin URL to determine org/repo, then check if repos/<name>/.repo.json exists:
    • If onboarded: verify the URL matches. If it doesn't match (fork scenario), warn the user.
    • If not onboarded: run bash ${CLAUDE_PLUGIN_ROOT}/scripts/workspaces/add-repo.sh <origin-url> to onboard it first.
  5. Ask the user via AskUserQuestion about import scope:
    • Current branch only
    • Select from branches (list them)
    • All local branches
    • Always skip the default branch (it maps to the existing trunk workspace).
  6. For each branch to import, propose a workspace name:
    • Branch prefix mapping: feature/*epic-*, bugfix/*/hotfix/*spike-*, pr-* passthrough
    • Otherwise: kebab-case the branch name, type = import
    • Ask the user via AskUserQuestion to confirm or override each workspace name
    • Check for collisions against existing repos/<repo>/ and notes/<repo>/ directories
  7. For each branch, run the import script:
    bash ${CLAUDE_PLUGIN_ROOT}/scripts/workspaces/import-workspace.sh \
      <repo> <name> --branch <branch> --source <path> \
      --type <type> [--purpose "<purpose>"] [--dirty] [--local-commits]
    
    Pass --dirty only for the current branch workspace when the source has dirty state (staged + unstaged changes). Pass --local-commits when the branch has unpushed commits (i.e., git log origin/<branch>..<branch> is non-empty).
  8. Run validation:
    bash ${CLAUDE_PLUGIN_ROOT}/scripts/workspaces/validate.sh --repo <repo>
    
  9. Report a summary of what was imported and suggest next steps:
    • /workspace:cd <repo>/<workspace> to switch to an imported workspace
    • /workspace:list to see all workspaces

Read the full file on GitHub · 63 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. 2d ago First seen · 63 lines · 12 tokens per session scan A d19ee7a56417

Subscribe to this mod's changes

import is a command published in the GitHub repository mdsakalu/agent-plugins (4 stars, last pushed 2mo ago), licensed MIT. It adds 12 tokens to every session and 993 once invoked, about $0.0001 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-31.

Related

Other commands, from other repositories