bd-detox

bd-detox is a skill for Claude Code from keefar/ticket-flow. It costs 121 tokens per session (1,894 once invoked), scanned A, original, MIT.

A cleanup command for projects that already initialized Beads with guidance that conflicts with Claude Code’s memory files. It removes that guidance from the relevant project instructions and can install a replacement policy.

In plain words
What is it for?
Use it to clean up an existing Beads setup, preview the proposed changes, preserve or remove AGENTS.md, or skip the runtime Beads guidance override.
Why use it?
It resolves conflicting instructions between Beads and the project’s memory system without requiring the project to be initialized again.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Part of the ticket-flow plugin — 13 skills, 2 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 skills/keefar/ticket-flow/bd-detox
Any agent
npx skills add keefar/ticket-flow --skill bd-detox
Clone the repo
git clone --depth 1 https://github.com/keefar/ticket-flow

Made for: Claude Code.

Or install ticket-flow, the plugin that ships this one along with the rest of its 13 skills, 2 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 bd-detox

README.md
[![agentmods](https://agentmods.dev/badge/skills/keefar/ticket-flow/bd-detox.svg)](https://agentmods.dev/skills/keefar/ticket-flow/bd-detox)
Your own site
<a href="https://agentmods.dev/skills/keefar/ticket-flow/bd-detox"><img src="https://agentmods.dev/badge/skills/keefar/ticket-flow/bd-detox.svg" alt="Measured on agentmods" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,894 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.1 $0.00121 $0.01894
Opus 5 $0.00060 $0.00947
Sonnet 5 $0.00024 $0.00379
Haiku 4.5 $0.00012 $0.00189

Measured 5d ago against content hash d76a739210c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

bd-detox 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 5d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (bd-detox.sh, install-prime.sh, tests/test_bd-detox.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/bd-detox/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.

/ticket-flow:bd-detox — Memory-clause cleanup for existing beads projects

Args:

  • (none) — coexistence mode: remove the anti-MEMORY line from CLAUDE.md and AGENTS.md, append the Memory Coexistence Policy to CLAUDE.md (and to AGENTS.md when it exists), install the .beads/PRIME.md override. Equivalent end-state to a fresh /ticket-flow:init --mode=beads (default mode).
  • --skip-agentspurge mode: delete AGENTS.md entirely, strip the BEADS INTEGRATION block from CLAUDE.md. Equivalent end-state to a fresh /ticket-flow:init --mode=beads --skip-agents. Recommended for tf users on the Auto-Memory + CLAUDE.md stack.
  • --no-prime — leave bd prime alone; skip the .beads/PRIME.md override.
  • --dry-run — show the planned changes without writing.

What it does

/ticket-flow:init --mode=beads only handles fresh beads projects (it scaffolds with tf's custom agents-template). Projects that already ran vanilla bd init have the anti-MEMORY clause baked into AGENTS.md plus a BEADS INTEGRATION block in CLAUDE.md, and bd re-emits the same guidance at runtime through bd prime. This skill is the after-the-fact cleanup.

Which file actually reaches Claude Code

Claude Code does not read AGENTS.md. Its memory files are CLAUDE.md and .claude/rules/ (memory docs). That reorders the whole cleanup:

Surface Reaches Claude Code Handled by
CLAUDE.mdBEADS INTEGRATION block yes — this is the effective contamination clause stripped + Coexistence Policy appended (coexistence) / whole block removed (purge)
bd prime output (SessionStart and PreCompact hooks) yes — injected at runtime .beads/PRIME.md override
AGENTS.md no cleaned anyway, for other agents (Codex, Cursor, Amp, …)

The earlier version of this skill appended the Memory Coexistence Policy only to AGENTS.md — i.e. the countermeasure landed in the file this harness never reads, while the contaminating block stayed in the one it does. Coexistence mode now appends the policy to CLAUDE.md.

Read the full file on GitHub · 82 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 82 lines · 0 tokens per session scan A d76a739210c7

Subscribe to this mod's changes

bd-detox is a skill published in the GitHub repository keefar/ticket-flow (4 stars, last pushed 10d ago), licensed MIT. It adds 121 tokens to every session and 1,894 once invoked, about $0.0006 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 skills, from other repositories

flow-next-audit

Audit .flow/memory/ entries against current code and keep, update, consolidate, replace, delete, or harden each. Use when asked to audit memory or graduate a recurring lesson into a gate.

gmickel/flow-next · 46 tokens

flow-next-audit

Audit .flow/memory/ entries against the current codebase and decide Keep / Update / Consolidate / Replace / Delete per entry. Triggers on /flow-next:audit, "audit memory", "review memory", "refresh learnings", "sweep stale memory", "consolidate overlapping memory entries". Optional mode:autofix token in arguments runs…

gmickel/flow-next · 112 tokens

flow-next-memory-migrate

Migrate legacy flat .flow/memory files to the categorized YAML schema. One-time ceremony. Use when asked to migrate flow memory.

gmickel/flow-next · 33 tokens

cadence-resume

继续之前某次 session 的讨论上下文(v0.4:Step 6 archive cleanup B1 修复 + contenthashes 判据 + 派 retriever 替代 auditor)。用户说 '继续上次'/'resume' 或跑 /cadence-resume 时触发。.

hxt9805/cadence · 65 tokens

Self-Improving + Proactive Agent

Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when (1) a command, tool, API, or operation fails; (2) the user corrects you or rejects your work; (3) you realize your knowledge is outdated or incorrect; (4) you…

UnicomAI/wanwu · 105 tokens

ontology

Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what…

UnicomAI/wanwu · 86 tokens