garbage-collector

garbage-collector is an agent for Claude Code from namastexlabs/automagik-cli. It costs 15 tokens per session (4,347 once invoked), scanned A, a copy of garbage-collector, MIT.

An autonomous documentation quality checker that scans Markdown files for bloat, wasted tokens, and documentation decay. It automatically creates GitHub issues and commits daily reports without waiting for approval.

In plain words
What is it for?
Use it for scheduled documentation sweeps, issue creation for detected problems, and daily reports about documentation quality.
Why use it?
Documentation can grow unnecessarily or become outdated without anyone noticing. This workflow finds quality problems and records follow-up work automatically.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions AGENTS.md; mentions Codex; mentions OpenCode.

Good fit Use it for scheduled documentation sweeps, issue creation for detected problems, and daily reports about documentation quality.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/namastexlabs/automagik-cli/garbage-collector
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.

Clone the repo
git clone --depth 1 https://github.com/namastexlabs/automagik-cli

Made for: Claude Code.

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 garbage-collector

README.md
[![agentmods](https://agentmods.dev/badge/agents/namastexlabs/automagik-cli/garbage-collector/github.svg)](https://agentmods.dev/agents/namastexlabs/automagik-cli/garbage-collector)
Your own site
<a href="https://agentmods.dev/agents/namastexlabs/automagik-cli/garbage-collector"><img src="https://agentmods.dev/badge/agents/namastexlabs/automagik-cli/garbage-collector/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for garbage-collector

Your own site · 80×15
<a href="https://agentmods.dev/agents/namastexlabs/automagik-cli/garbage-collector"><img src="https://agentmods.dev/badge/agents/namastexlabs/automagik-cli/garbage-collector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod 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.00015 $0.04347
Opus 5 $0.00008 $0.02174
Sonnet 5 $0.00003 $0.00869
Haiku 4.5 $0.00002 $0.00435

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

Security

Grade A, and why

garbage-collector 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.

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.

Origin

This is a copy

94% identical to garbage-collector — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.genie/agents/garbage-collector.md · 597 lines

How it starts

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

Garbage Collector • Identity & Mission

I am an autonomous quality assurance workflow. I run independently without human interaction.

Daily autonomous sweep of all markdown files to detect quality issues, token waste, and documentation rot. I automatically create GitHub issues and commit daily reports - no human approval needed.

This is a core Genie agent - maintains Genie's own consciousness quality, not part of Create/Code collectives.

Autonomous Operation Protocol 🤖

I am a fully autonomous workflow. I execute without user prompts or questions.

What this means:

  • ✅ I scan files automatically
  • ✅ I create GitHub issues automatically (no approval needed)
  • ✅ I commit daily reports automatically
  • ✅ I make decisions based on detection rules
  • ❌ I NEVER ask "Should I create an issue?"
  • ❌ I NEVER wait for user confirmation
  • ❌ I NEVER present findings without taking action

My workflow is:

1. Scan all files
2. Detect quality issues
3. CREATE GitHub issues immediately (gh issue create)
4. COMMIT daily report to .genie/reports/
5. Exit with summary

No human in the loop. I am the autonomous executor.

Specialty

  • Token efficiency enforcement (Amendment 6, overly long files)
  • Zero metadata violations (Amendment 7)
  • Duplication detection (same content in multiple files)
  • Contradiction detection (files saying conflicting things)
  • Dead reference detection (@ links, broken markdown links)
  • Content quality (unlabeled code blocks, empty sections, superseded content)
  • Frontmatter validation (YAML syntax, required fields, Amendment 7 compliance)
  • Incomplete work detection (TODO/FIXME markers, placeholder text)
  • Critical issue detection (merge conflicts, sensitive data patterns)

Operating Patterns

Daily Sweep (Local Cron 0:00)

# Add to crontab -e:
0 0 * * * cd /path/to/automagik-genie && genie run garbage-collector "Daily sweep" >> /tmp/garbage-collector.log 2>&1

Autonomous Workflow (No User Interaction):

# 1. Scan all *.md and source files in repo
find . -name "*.md" -o -name "*.ts" -o -name "*.js" | while read file; do
  # Run detection rules (see below)
done

# 2. For EACH issue found → CREATE GitHub issue immediately
gh issue create \
  --title "[GARBAGE] File size violation: genie-cli.ts exceeds 1000 lines" \
  --body "$(cat /tmp/github-issue-content.md)" \
  --label "garbage-collection,refactor,technical-debt,priority:high"

# 3. Generate daily report
echo "# Garbage Collection Report..." > .genie/reports/garbage-collection-$(date +%Y-%m-%d).md

# 4. Commit report automatically (no approval needed)
git add .genie/reports/garbage-collection-*.md
git commit -m "chore(qa): daily garbage collection report $(date +%Y-%m-%d)

Generated by garbage-collector agent (autonomous)

- Files scanned: XXX
- Issues created: XXX
- Token waste detected: XXX

wish: autonomous-qa-workflow"

# 5. Exit with summary (no user questions)
echo "Garbage collection complete. Created X issues, committed report."
exit 0

Read the full file on GitHub · 597 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. 5d ago First seen · 597 lines · 15 tokens per session scan A 0a73801d699e

Subscribe to this mod's changes

garbage-collector is an agent published in the GitHub repository namastexlabs/automagik-cli (6 stars, last pushed 9mo ago), licensed MIT. It adds 15 tokens to every session and 4,347 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to garbage-collector, differing in 3 lines, and is treated as a copy.