AgentX
AGENTS.md47 starsChanged 5 months agoMITView on GitHub
This file tells an autonomous agent how to drive X/Twitter through agentx. - Drive everything through the agentx binary (or import pkg/agent in Go). - Every command prints one JSON object to stdout and nothing else: - success: {"ok":true,"schema_version":"1","data":...,"pagination":{"nextCursor":"..."}} - failure: {"ok":false,"schema_version":"1","error":{"code":"...","message":"..."}} - process exit code is 0 on success, 1 on a handled error. - Parse the envelope; never scrape human text. data shape depends on the command (a tweet array for timelines, a user object for user, etc.).
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- agentxSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Every command prints one JSON object to stdout and nothing else:
- Very specific: line 38
Prefer supplying the full browser cookie string via --cookie: it keeps the session looking like a real browser, which makes the cookies …
- Very specific: line 64
Keep one stable User-Agent per account (set --user-agent at add time) — do not rotate it between requests.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
agentx — agent integration guide
This file tells an autonomous agent how to drive X/Twitter through agentx.
Contract
- Drive everything through the
agentxbinary (or importpkg/agentin Go). - Every command prints one JSON object to stdout and nothing else:
- success:
{"ok":true,"schema_version":"1","data":...,"pagination":{"nextCursor":"..."}} - failure:
{"ok":false,"schema_version":"1","error":{"code":"...","message":"..."}} - process exit code is
0on success,1on a handled error.
- success:
- Parse the envelope; never scrape human text.
datashape depends on the command (a tweet array for timelines, a user object foruser, etc.).
Decision guide
| Goal | Command |
| Read my home feed | agentx feed -n N (add --latest for chronological) |
| Search | agentx search --type Top|Latest "<query>" -n N |
| Look up a profile | agentx user <handle> |
| Read someone's tweets | agentx posts <handle> -n N |
| Read one tweet (no login needed) | agentx tweet <id|url> |
| Read a tweet + replies | agentx thread <id|url> |
| Publish | agentx post "<text>" |
| Reply / quote | agentx reply <id> "<text>" / agentx quote <id> "<text>" |
| Engage | agentx like|unlike|retweet|unretweet|bookmark|delete <id> |
<id|url> accepts a numeric id or any https://x.com/<user>/status/<id> URL.
Multi-account
- Register once:
agentx account add --name <n> --auth-token <t> --ct0 <c> [--cookie "<full cookie>"]. - Choose per call with
-a <name>or setAGENTX_ACCOUNT. - The first account becomes the default; change it with
agentx account default <name>. - Inspect with
agentx account list(returns names + which is default).
Prefer supplying the full browser cookie string via --cookie: it keeps the
session looking like a real browser, which makes the cookies last much longer.
Pagination
Timeline-style results include pagination.nextCursor. To page, re-issue the
same command with --cursor <nextCursor>. Stop when nextCursor is empty or
stops changing.
Handling errors
Switch on error.code:
not_authenticated→ cookies missing/expired; ask the user to re-add the account, then retry.rate_limited→ back off (seconds→minutes) and retry; the client already retries transient 429s a few times.query_id_error/ repeatednot_foundon a known-good id → x.com rotated a GraphQL query id; report it so the operator can refresh ids.invalid_input→ fix arguments; do not retry blindly.network_error→ transient; retry with backoff.
Notes for safe automation
- Writes (
post,like, ...) change real account state. Confirm intent before bulk actions. - Keep one stable User-Agent per account (set
--user-agentat add time) — do not rotate it between requests.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

