Skip to content
Back to search

context-cleaning-crew

SkillWorks with Claude CodeGitHub

Audit a Claude Code setup for context cost, duplicates, stale memory, conflicting instructions, removed tools, version drift and plaintext secrets, then clean it up with per-item approval.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sjsyrek--context-cleaning-crew/badge.svg)](/listings/sjsyrek--context-cleaning-crew)

HTML

<a href="/listings/sjsyrek--context-cleaning-crew"><img src="/api/listings/sjsyrek--context-cleaning-crew/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

/plugin marketplace add sjsyrek/claude-plugins
/plugin install context-cleaning-crew@sjsyrek

Or from a shell: `claude plugin install context-cleaning-crew --marketplace sjsyrek/claude-plugins`. Requires `python3` on `PATH` (see Requirements).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/plugin.json · Manifest · 86 lines
  1. {
  2. "name": "context-cleaning-crew",
  3. "version": "0.2.0",
  4. "description": "Audit a Claude Code setup for context cost, duplicates, stale memory, conflicting instructions, removed tools, version drift and plaintext secrets, then clean it up with per-item approval.",
  5. "author": {
  6. "name": "Steven Syrek",
  7. "url": "https://github.com/sjsyrek"
  8. },
  9. "homepage": "https://github.com/sjsyrek/context-cleaning-crew",
  10. "repository": "https://github.com/sjsyrek/context-cleaning-crew",
  11. "license": "MIT",
  12. "keywords": [
  13. "config",
  14. "audit",
  15. "context",
  16. "cleanup",
  17. "skill"
  18. ],
  19. "userConfig": {
  20. "preferred_marketplaces": {
  21. "type": "string",
  22. "multiple": true,
  23. "title": "Preferred marketplaces",
  24. "description": "Marketplace names in order of preference. When two installed plugins do the same job, the review keeps the one from the earliest marketplace in this list. Empty means decide by capability, then usage.",
  25. "default": []
  26. },
  27. "protected": {
  28. "type": "string",
  29. "multiple": true,
  30. "title": "Protected items",
  31. "description": "Plugins (name or name@marketplace), MCP server names or memory file names that are never proposed for removal.",
  32. "default": []
  33. },
  34. "backup_dir": {
  35. "type": "string",
  36. "title": "Backup directory",
  37. "description": "Where every file is backed up before a change. Must be persistent: never a temporary or scratch directory.",
  38. "default": "~/.claude/backups/context-cleaning-crew/"
  39. },
  40. "report_dir": {
  41. "type": "string",
  42. "title": "Report directory",
  43. "description": "Where manifests and dated reports are written.",
  44. "default": "~/.local/state/context-cleaning-crew/reports/"
  45. },
  46. "usage_window_days": {
  47. "type": "number",
  48. "title": "Usage window (days)",
  49. "description": "A skill or MCP server not used within this many days counts as unused.",
  50. "default": 90,
  51. "min": 1,
  52. "max": 3650
  53. },
  54. "mine_transcripts": {
  55. "type": "boolean",
  56. "title": "Count MCP usage from transcripts",
  57. "description": "Read your local session transcripts to count MCP tool calls per server within the usage window. Counts only; no content is kept. Off by default.",
  58. "default": false
  59. },
  60. "refresh_marketplaces": {
  61. "type": "boolean",
  62. "title": "Refresh marketplaces in report mode",
  63. "description": "Update the local marketplace clones before comparing plugin versions, in report mode too. Quick and full mode always refresh. Off means report mode compares against the cached clones and says so.",
  64. "default": true
  65. },
  66. "extra_secret_patterns": {
  67. "type": "string",
  68. "multiple": true,
  69. "title": "Extra secret patterns",
  70. "description": "Additional regular expressions (Python syntax) for token formats the built-in scan doesn't know, such as an internal API key prefix. Matches are reported by file, key and type, never by value.",
  71. "default": []
  72. },
  73. "full_mode_models": {
  74. "type": "string",
  75. "title": "Full-mode seat model",
  76. "description": "Model for the five full-mode reviewer seats. inherit uses the session's model. The synthesis always runs in your own session.",
  77. "default": "sonnet",
  78. "options": [
  79. "sonnet",
  80. "opus",
  81. "haiku",
  82. "inherit"
  83. ]
  84. }
  85. }
  86. }
README.md · README · 113 lines
  1. # Context Cleaning Crew
  2. A Claude Code plugin that audits your Claude Code setup and cleans it up with your approval, item by item.
  3. It looks at settings and permissions, CLAUDE.md and AGENTS.md files (including parent directories), plugins and marketplaces, skills, hooks, MCP servers and auto-memory, and reports:
  4. - **Context cost:** always-on tokens per plugin (from `claude plugin details`), instruction files and memory, against how often you use them.
  5. - **Duplicates:** MCP servers configured twice, and plugins a built-in skill now covers (`/code-review`, `/simplify`, `/loop`, `/security-review`) or a synced claude.ai skill duplicates.
  6. - **Staleness:** your own skills, agents and commands calling tools Claude Code removed (`TeamCreate`, broadcast `SendMessage`, …) — `claude plugin validate` doesn't catch these; plugins behind their marketplace or the CLI they wrap; broken memory links; memory that only loads in one directory but reads as global.
  7. - **Conflicts:** instructions that contradict each other or a permission rule.
  8. - **Permission posture:** a blanket `Bash` allow with `acceptEdits`/`bypassPermissions`, redundant rules, rules that match no tool; for the other projects you've used, the same as counts per settings file.
  9. - **Secrets:** plaintext tokens, reported by file, key and type — never the value.
  10. ## Installation
  11. ```
  12. /plugin marketplace add sjsyrek/claude-plugins
  13. /plugin install context-cleaning-crew@sjsyrek
  14. ```
  15. Or from a shell: `claude plugin install context-cleaning-crew --marketplace sjsyrek/claude-plugins`. Requires `python3` on `PATH` (see Requirements).
  16. ## Usage
  17. ```
  18. /context-cleaning-crew:context-cleaning-crew [quick|full|report] [focus]
  19. ```
  20. - `quick` (default): one reviewer, then a plan card; nothing changes until you approve each item. Run it interactively: headless runs can't edit settings files.
  21. - `full`: five parallel, read-only reviewer subagents (context economist, overlap analyst, security reviewer, memory curator, workflow advocate), one debate round in which the advocate argues for keeping what you use, then the plan card. No agent teams needed. Run it interactively, like `quick`; if you run it headless for the review alone, grant `SendMessage`, or the debate round is skipped.
  22. - `report`: read-only; writes a dated report and exits. Safe to schedule: see `skills/context-cleaning-crew/references/routine-setup.md` for launchd/cron and the minimal headless allowlist.
  23. After a Claude Code update, a SessionStart hook suggests a report run once. On every other start it prints nothing.
  24. Reports go to `~/.local/state/context-cleaning-crew/reports/`; backups of anything changed go to `~/.claude/backups/context-cleaning-crew/`.
  25. ### What the plan card looks like
  26. Cards follow the marketplace's [card standard](https://github.com/sjsyrek/claude-plugins/blob/main/docs/card-standard.md). They're rendered markdown, so Claude Code draws the table borders and stacks the tables on a narrow terminal. An example, for an invented setup:
  27. **Context Cleaning Crew plan** — quick
  28. - **Always-on now:** ~9.4k tokens
  29. - **After plan:** ~7.1k tokens
  30. - **Findings:** 4 (1 fix, 2 cut, 1 ask)
  31. **Fix**
  32. | # | Item | Evidence | Action |
  33. |---|---|---|---|
  34. | 1 | AGENTS.md vs deny rule | "run `git push --force` to fix history" vs deny `Bash(git push --force*)` | reword the instruction (reversible) |
  35. **Cut**
  36. | # | Item | Evidence | Action |
  37. |---|---|---|---|
  38. | 2 | docs-search MCP server | configured twice, same URL, from user config and a plugin | remove the user-config copy (reversible) |
  39. | 3 | pr-helper plugin | ~1.3k tok always-on, 2 uses in 90 days, built-in `/code-review` | uninstall (reversible) |
  40. **Ask**
  41. | # | Item | Evidence | Action |
  42. |---|---|---|---|
  43. | 4 | `~/.claude/settings.json` | `env.NPM_TOKEN` is a plaintext npm token | move it to the keychain; revoke the old token (confirm) |
  44. - **Item 3, keep?** "Its review checklist is tuned to this team's style guide" (advocate)
  45. Reply: `go` | `go except 3` | `keep 2` | `switch 3 to <alt>` | `explain 4` | `abort`
  46. ## Options
  47. Set with `claude plugin configure context-cleaning-crew` (or `/plugin` → manage). Claude Code stores them under `pluginConfigs` in your user settings; the inventory reads them from there and records the effective values, and where each came from, in the manifest.
  48. | Option | Default | What it does |
  49. |---|---|---|
  50. | `preferred_marketplaces` | none | Marketplaces in order of preference; when two plugins do the same job, keep the one from the earliest listed |
  51. | `protected` | none | Plugins, MCP servers or memory files never proposed for removal |
  52. | `backup_dir` | `~/.claude/backups/context-cleaning-crew/` | Backups before any change; keep it persistent |
  53. | `report_dir` | `~/.local/state/context-cleaning-crew/reports/` | Manifests and reports |
  54. | `usage_window_days` | `90` | Not used within this many days counts as unused |
  55. | `mine_transcripts` | off | Count MCP tool calls per server from local transcripts (counts only) |
  56. | `refresh_marketplaces` | on | Refresh marketplace clones in report mode too (quick and full always do) |
  57. | `extra_secret_patterns` | none | Extra regexes for the secrets scan |
  58. | `full_mode_models` | `sonnet` | Model for the five full-mode seats (`sonnet`, `opus`, `haiku`, `inherit`) |
  59. ## Requirements
  60. - Claude Code 2.1.326 or later.
  61. - Python 3.9+ (the stock macOS `python3` works). The scripts use only the standard library.
  62. - `python3` must be on `PATH`: the skill and the SessionStart update hook call it by that name, not by an absolute path.
  63. - No environment variables are required.
  64. ## Known limitations
  65. - **Opaque secrets in MCP arguments.** Tokens in known formats (GitHub, Slack, AWS, `sk-`, …) are redacted everywhere, and URL credentials and query strings are always masked. An opaque value passed as a command-line argument (`--token abc123`) is not recognized; it can appear in the manifest's `mcp.duplicates` target when two servers share that command line. Add an `extra_secret_patterns` regex for such values.
  66. - **Opaque secrets in the current project's permission rules.** Rule text is redaction-checked against the same patterns, so an opaque value inside an allow rule appears in the manifest verbatim. Other projects' settings report counts only, never rule text.
  67. - **Auditing a copy of a home directory.** Absolute paths in the copy's `~/.claude.json` (`projects`) and plugin registry point at the live setup, so an audit of a backup also reads the live project settings and plugin files (read-only).
  68. - **Hook output isn't measured.** The inventory lists hooks and never runs them; the reviewer reads the scripts.
  69. - Manifests and reports stay on your machine. The scripts upload nothing; their only network use is the marketplace refresh (`claude plugin marketplace update`), which you can turn off with `refresh_marketplaces`. The review itself runs in your Claude Code session, like any other prompt.
  70. ## Development
  71. ```sh
  72. python3 -m venv .venv && .venv/bin/pip install mypy ruff # dev tools only
  73. python3 -m unittest discover -s tests
  74. .venv/bin/ruff check scripts tests && .venv/bin/mypy scripts tests
  75. ```
  76. See `evals/README.md` for the `claude plugin eval` suite and `PLAN.md` for the design.
  77. ## License
  78. MIT

Version history

  • v0.2.011/22/2026

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.