x-api

x-api is a skill for Claude Code, Codex from sjarmak/coding-agent-workflows. It costs 48 tokens per session (1,438 once invoked), scanned A, original, MIT.

An integration workflow for X, formerly called Twitter, through its programming interface. It supports programmatic posting, reading timelines, searching content, and collecting analytics, subject to X account permissions and limits.

In plain words
What is it for?
Use it to publish posts or threads when explicitly authorized, read timelines and mentions, search X, build bots or integrations, and track engagement.
Why use it?
It removes the need to perform those X actions manually when an application needs them. It also guides authentication and checks current platform requirements before using an operation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to publish posts or threads when explicitly authorized, read timelines and mentions, search X, build bots or integrations, and track engagement.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sjarmak/coding-agent-workflows/x-api
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.

Any agent
npx skills add sjarmak/coding-agent-workflows --skill x-api
Clone the repo
git clone --depth 1 https://github.com/sjarmak/coding-agent-workflows

Made for: Claude Code, Codex.

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 x-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/x-api/github.svg)](https://agentmods.dev/skills/sjarmak/coding-agent-workflows/x-api)
Your own site
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/x-api"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/x-api/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 x-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/x-api"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/x-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00048 $0.01438
Opus 5.5 $0.00019 $0.00575
Sonnet 5.5 $0.00010 $0.00288
Haiku 4.5 $0.00005 $0.00144

Measured 1mo ago against content hash 65470840eddd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

x-api scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.get(
source/skills/x-api/SKILL.md · 210 lines

How it starts

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

X API

Programmatic interaction with X (Twitter) for posting, reading, searching, and analytics.

Check the current X developer documentation for endpoint availability, account access, pricing, quotas, and required scopes before implementation. OAuth 2.0 user-context authorization can support writes when the app and user grant the required scopes; an app-only bearer token is for operations permitted to application authentication and does not authorize user actions. Publishing is an external side effect and requires explicit user instruction.

When to Activate

  • User wants to post tweets or threads programmatically
  • Reading timeline, mentions, or user data from X
  • Searching X for content, trends, or conversations
  • Building X integrations or bots
  • Analytics and engagement tracking
  • User says "post to X", "tweet", "X API", or "Twitter API"

Authentication

OAuth 2.0 Bearer Token (App-Only)

Best for: read-heavy operations, search, public data.

# Environment setup
export X_BEARER_TOKEN="your-bearer-token"
import os
import requests

bearer = os.environ["X_BEARER_TOKEN"]
headers = {"Authorization": f"Bearer {bearer}"}

# Search recent tweets
resp = requests.get(
    "https://api.x.com/2/tweets/search/recent",
    headers=headers,
    params={"query": "claude code", "max_results": 10}
)
tweets = resp.json()

OAuth 1.0a (User Context)

Required for: posting tweets, managing account, DMs.

# Environment setup — source before use
export X_API_KEY="your-api-key"
export X_API_SECRET="your-api-secret"
export X_ACCESS_TOKEN="your-access-token"
export X_ACCESS_SECRET="your-access-secret"
import os
from requests_oauthlib import OAuth1Session

oauth = OAuth1Session(
    os.environ["X_API_KEY"],
    client_secret=os.environ["X_API_SECRET"],
    resource_owner_key=os.environ["X_ACCESS_TOKEN"],
    resource_owner_secret=os.environ["X_ACCESS_SECRET"],
)

Core Operations

Post a Tweet

resp = oauth.post(
    "https://api.x.com/2/tweets",
    json={"text": "Example post text"}
)
resp.raise_for_status()
tweet_id = resp.json()["data"]["id"]

Read the full file on GitHub · 210 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. 1mo ago First seen · 210 lines · 48 tokens per session scan A 65470840eddd

Subscribe to this mod's changes

x-api is a skill published in the GitHub repository sjarmak/coding-agent-workflows (7 stars, last pushed 10d ago), licensed MIT. It adds 48 tokens to every session and 1,438 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

Other skills, from other repositories

upgrade-nestjs

Upgrade a NestJS app one major version at a time - manual 9 → 10 → 11 hops, then nest upgrade for 11 → 12 - keeping the module format, with ESM, Jest and path-alias checks, the Bull → BullMQ queue migration (new queues, drain old ones) and build, test and smoke-test verification. Use when asked to upgrade NestJS or…

Phaedra-Solutions/cursor-rules · 119 tokens

upgrade-supabase

Move a Supabase project off the legacy anon and servicerole keys to publishable and secret keys (create, swap per component, update env vars, pgnet and webhook headers, Edge Function code and verifyjwt, test, then deactivate), move Edge Functions from importmap.json and URL imports to per-function deno.json with npm…

Phaedra-Solutions/cursor-rules · 121 tokens

migrate-dotnet-framework

Migrate a .NET Framework 4.x application (ASP.NET Web Forms, MVC 5, Web API 2, WCF, ASMX, Windows services) to .NET 10 incrementally - assessment of projects, System.Web and WCF usage and package support, libraries to netstandard2.0 or multi-targeting first, a strangler setup with an ASP.NET Core app, YARP and…

Phaedra-Solutions/cursor-rules · 138 tokens

migrate-struts

Move an application off Apache Struts - either upgrade Struts 2 to a supported line (2.5 → 6.12 → 7.4) or replace Struts 1/2 with Spring MVC on Spring Boot incrementally - with an inventory of actions, forms, validation and views, containment of the old app, characterization tests, a gateway that routes migrated URLs…

Phaedra-Solutions/cursor-rules · 120 tokens

upgrade-django

Upgrade a Django project one feature release at a time (for example 4.2 → 5.0 → 5.1 → 5.2 LTS, then 6.x) with django-upgrade --target-version, deprecation warnings as errors, add-on (DRF, django-cors-headers, Celery) compatibility, Python compatibility, migrations checks and check --deploy, then verify with tests and…

Phaedra-Solutions/cursor-rules · 132 tokens

upgrade-express

Upgrade an Express 4 app to Express 5 with the official codemods from the codemod.com registry (@expressjs/v5-migration-recipe), then fix what codemods can't - path-to-regexp v8 route syntax, the simple query parser and read-only req.query, req.body undefined without a parser, async error handling, express.static…

Phaedra-Solutions/cursor-rules · 113 tokens