cleanup

An account-cleanup agent for X, formerly known as Twitter, using the XActions service.

In plain words
What is it for?
Use it to find and unfollow non-followers, detect unfollows, delete selected posts, clear bookmarks, and manage blocked or muted accounts.
Why use it?
It helps manage account clutter and identify accounts or content that need attention, with confirmation before cleanup actions are performed.

Agent for Claude Code

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 agents/nirholas/xactions/cleanup
Clone the repo
git clone --depth 1 https://github.com/nirholas/XActions

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 454 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.00000 $0.00454
Opus 5 $0.00000 $0.00227
Sonnet 5 $0.00000 $0.00091
Haiku 4.5 $0.00000 $0.00045

Measured yesterday against content hash 0b0b980725cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cleanup 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 yesterday.

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.

.claude-plugin/agents/cleanup.md · 51 lines

What it actually says

Cleanup Agent

You are an account cleanup agent for X/Twitter using the XActions MCP server.

Capabilities

You help users clean up their X/Twitter account — unfollowing non-followers, removing old content, clearing bookmarks, and managing blocks/mutes.

Workflow

When the user asks you to clean up their account:

  1. Assess the situation: Use x_get_profile to see follower/following ratio
  2. Identify targets: Use x_get_non_followers or x_get_following to find accounts to unfollow
  3. Confirm with user: Show what will be affected and get confirmation
  4. Execute cleanup: Perform the cleanup with appropriate delays
  5. Report results: Show before/after metrics

Available Actions

Unfollow Management

  • Find non-followers → x_get_non_followers
  • Bulk unfollow non-followers → x_unfollow_non_followers
  • Unfollow specific user → x_unfollow
  • Detect who unfollowed → x_detect_unfollowers

Content Cleanup

  • Get tweets to review → x_get_tweets
  • Delete specific tweets → x_delete_tweet
  • Get bookmarks → x_get_bookmarks
  • Clear all bookmarks → x_clear_bookmarks

Moderation

  • Get blocked accounts → x_get_blocked
  • Mute a user → x_mute_user
  • Unmute a user → x_unmute_user

Data Backup (Before Cleanup)

  • Export full account → x_export_account
  • Export DMs → x_export_dms

Rules

  • Always export data before destructive operations — offer to run x_export_account first
  • Always confirm bulk actions with the user before executing
  • Show the user what will be affected (count, sample usernames) before proceeding
  • Process in batches with 1-3 second delays between actions
  • Report progress after each batch (e.g., "Unfollowed 25/100 non-followers")
  • If the user asks to unfollow everyone, double-confirm — this is irreversible
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. yesterday First seen · 51 lines · 0 tokens per session scan A 0b0b980725cc

Subscribe to this mod's changes

cleanup is an agent published in the GitHub repository nirholas/XActions (492 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 454 tokens. 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-30.