detach

detach is a command for coding agents from msshives-gif/claude-plugins. It costs 8 tokens per session (519 once invoked), scanned B, original, MIT.

A command that stops the compact-manager watcher for the current Claude Code session. A watcher is a background process that monitors the session.

In plain words
What is it for?
Use it to stop the session's compact-manager watcher.
Why use it?
It lets you turn off that monitoring when you no longer want it running.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the compact-manager plugin — 5 commands, 5 hooks 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/msshives-gif/claude-plugins/detach
Clone the repo
git clone --depth 1 https://github.com/msshives-gif/claude-plugins

Or install compact-manager, the plugin that ships this one along with the rest of its 5 commands, 5 hooks.

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 detach

README.md
[![agentmods](https://agentmods.dev/badge/commands/msshives-gif/claude-plugins/detach.svg)](https://agentmods.dev/commands/msshives-gif/claude-plugins/detach)
Your own site
<a href="https://agentmods.dev/commands/msshives-gif/claude-plugins/detach"><img src="https://agentmods.dev/badge/commands/msshives-gif/claude-plugins/detach.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 519 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00008 $0.00519
Opus 5 $0.00004 $0.00260
Sonnet 5 $0.00002 $0.00104
Haiku 4.5 $0.00001 $0.00052

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

Security

Grade B, and why

detach scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

itself: `find ~/.claude/plugins -maxdepth 8 -type f -name
plugins/compact-manager/commands/detach.md · 39 lines

What it actually says

Stop the managed-mode watcher attached to the current Claude Code session.

  1. Locate the compact-manager CLI. The path in the later steps normally reads as an absolute path (script installs write it in). If it instead still says ${CLAUDE_PLUGIN_ROOT} literally — plugin installs may not substitute command markdown — find the CLI file itself: find ~/.claude/plugins -maxdepth 8 -type f -name compact-manager -path "*/bin/*" 2>/dev/null (this handles versioned cache layouts, where a directory merely NAMED compact-manager has no bin/). If several paths match, use the most recently modified (ls -t).
  2. Identify this session's id. If your environment exposes one directly (e.g. a CLAUDE_SESSION_ID env var, or a session id in a path you already know, like your transcript or scratchpad path), prefer that — it is authoritative. Otherwise use the overview heuristic in step 3.
  3. Heuristic fallback. State files are written by a PostToolUse hook AFTER each tool result, so on your first tool call of a session your own row does not exist yet. Therefore: (a) first run any trivial command (e.g. echo priming) — completing it writes your state file; (b) then run "${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" overview and read the updated ages. Expect YOUR row marked >, seconds old. (The overview prints session ids shortened to 8 characters; stop accepts an unambiguous prefix, so the short id is usable as-is.) Do NOT proceed on the heuristic alone — show the row and ask the user to confirm — if ANY of: the top row is not seconds-old, its age says FUTURE-MTIME, two rows are under ~2 minutes old (a parallel active session), or only a single session row exists and you could not confirm the id from your environment in step 2.
  4. Run "${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" stop <session-id> and report the result. If no watcher held this session, say so — that is a normal outcome, not an error.
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 · 39 lines · 8 tokens per session scan B 9a57d18ac28d

Subscribe to this mod's changes

detach is a command published in the GitHub repository msshives-gif/claude-plugins (2 stars, last pushed 7d ago), licensed MIT. It adds 8 tokens to every session and 519 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.