direct-messages

direct-messages is a skill for Claude Code, Codex from nirholas/XActions. It costs 61 tokens per session (694 once invoked), scanned A, original, Apache-2.0.

A set of browser scripts for sending and organizing private messages on X/Twitter. It includes personalized message templates, conversation filtering, message management, and message export.

In plain words
What is it for?
Use it to send personalized messages to selected users, organize or filter conversations, manage message requests, and export direct-message data.
Why use it?
Repeated outreach and conversation review can be slow and can lead to duplicate messages. The workflow includes previews, delays, session limits, and duplicate checks.

Skill for Claude CodeCodex

Part of the xactions plugin — 50 skills, 1 command, 8 agents, 1 MCP server 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/nirholas/xactions/direct-messages
Any agent
npx skills add nirholas/XActions --skill direct-messages
Clone the repo
git clone --depth 1 https://github.com/nirholas/XActions

Made for: Claude Code, Codex.

Or install xactions, the plugin that ships this one along with the rest of its 50 skills, 1 command, 8 agents, 1 MCP server.

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 direct-messages

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirholas/xactions/direct-messages.svg)](https://agentmods.dev/skills/nirholas/xactions/direct-messages)
Your own site
<a href="https://agentmods.dev/skills/nirholas/xactions/direct-messages"><img src="https://agentmods.dev/badge/skills/nirholas/xactions/direct-messages.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 694 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.00061 $0.00694
Opus 5 $0.00030 $0.00347
Sonnet 5 $0.00012 $0.00139
Haiku 4.5 $0.00006 $0.00069

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

Security

Grade A, and why

direct-messages 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.

skills/direct-messages/SKILL.md · 92 lines

How it starts

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

Direct Messages

Browser console scripts for sending, managing, and exporting X/Twitter DMs.

Available Scripts

Script File Purpose
Send Direct Messages src/sendDirectMessage.js Send personalized DMs to a list of users
DM Manager src/dmManager.js Core DM management (read, filter, organize, export)

Send Direct Messages

File: src/sendDirectMessage.js

Send personalized DMs to multiple users with message templates and rate limiting.

Configuration

const CONFIG = {
  targetUsers: ['user1', 'user2'],
  messageTemplate: 'Hey {username}! 👋 Just wanted to connect.',
  limits: {
    messagesPerSession: 10,
    delayBetweenMessages: 30000,
  },
  skipIfAlreadyMessaged: true,
  dryRun: true,
};

How to use

  1. Navigate to x.com/messages
  2. Edit CONFIG with target users and message template
  3. Set dryRun: false when ready
  4. Open DevTools (F12) → Console
  5. Paste the script → Enter

Safety features

  • Tracks sent messages in localStorage to avoid duplicates
  • Configurable delay between messages (30s default)
  • Session limit prevents over-messaging
  • Dry-run mode previews actions without sending

Warning: Mass DMing can get your account restricted. Only message users who have open DMs or follow you.

DM Manager

File: src/dmManager.js

Core module for reading, filtering, organizing, and exporting DM conversations. Supports message requests, conversation search, and DM privacy settings.

How to use

  1. Navigate to x.com/messages
  2. Open DevTools (F12) → Console
  3. Paste the script → Enter

Key Selectors

Element Selector
New message button [data-testid="NewDM_Button"]
Search people [data-testid="searchPeople"]
Message input [data-testid="dmComposerTextInput"]
Send button [data-testid="dmComposerSendButton"]
Conversation list [data-testid="conversation"]
Message bubble [data-testid="messageEntry"]
Message requests [data-testid="messageRequests"]
Back button [data-testid="app-bar-back"]

Read the full file on GitHub · 92 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 · 92 lines · 61 tokens per session scan A 33d9505e1060

Subscribe to this mod's changes

direct-messages is a skill published in the GitHub repository nirholas/XActions (502 stars, last pushed yesterday), licensed Apache-2.0. It adds 61 tokens to every session and 694 once invoked, about $0.0003 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-30.