Skip to content

Repository files navigation

 _  _ ___ _  _ ___ _    _   _ ___ _  _  ___ ___ ___
 \ \/ |_ _| \| | __| |  | | | | __| \| |/ __| __| _ \
  )  ( | || .` | _|| |__| |_| | _|| .` | (__| _||   /
 /_/\_|___|_|\_|_| |____|\___/|___|_|\_|\___|___|_|_\

xinfluencer — re-train your For-You feed

An AI agent that re-programs the X/Twitter recommendation algorithm — so your feed stops feeding you garbage and starts feeding you what you actually care about.

License: MIT Python 3.10+ Playwright Powered by Claude PRs Welcome Status: Alpha

xinfluencer demo

"vex online. let's see what trash we're cleaning today."Vex, your feed's new personal trainer


Why?

You watched one street-fight video. Now your feed is street fights. You clicked one rage-bait political post. Now it's all rage bait.

The For-You algorithm is a one-way ratchet: it's very fast to pollute, very slow to recover. xinfluencer is the recovery tool. It spins up Claude as a long-lived agent (named Vex) inside a real Chromium browser logged into your account, and surgically tells the algorithm:

  • ❤️ Like the posts that match your real interests
  • 🚫 Not interested on posts that match the topics you're trying to suppress
  • 🔍 Search smart keywords to feed the algorithm fresh signal
  • 👤 Suggest accounts worth following (it never follows for you — that's your call)

Leave it running on your laptop for a day or two. Come back to a feed that looks like the inside of your own head again.


What it looks like

Type / and the slash menu appears

slash autocomplete menu

Arrow keys / page-up / page-down to navigate. Tab or Enter to insert.

Streaming reasoning, typewriter replies

streaming chat with Vex

Thinking streams dim-italic before the reply. The reply types itself out so you can read it as it forms — adjust speed with XINFLUENCER_TYPING_MS=N, or =0 to disable the animation entirely.

Autopilot runs in the background. Chat keeps going.

parallel autopilot + chat

Vex runs as an asyncio task in the same process as the chat — they share the browser through a lock. You can type to Vex while autopilot is acting on your feed, ask for status, or kill it with /stop. No "wait two hours for the process to finish" lock-in.


Install

git clone https://github.com/lordx64/xinfluencer.git
cd xinfluencer
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
playwright install chromium

Full walkthrough — prerequisites, every install method, troubleshooting, where files live, how to update/uninstall — is in INSTALL.md.

Quick start

xinfluencer

That's it. You get the splash, then you're in a session with Vex. First run, Vex walks you through /init (API key), /interests (what you want more / less of), and /login (open Chromium, you log into X manually). After that, just talk.

Meet Vex

Vex is dry, opinionated, slightly weary, and ride-or-die loyal to you. It narrates every batch with one quotable line. A few real examples from sessions:

"eight tweets, six were ads. cleaned the worst three. one ml paper — liked. boss, your feed is in rough shape."

"i found a banger thread on rust async. liked it twice in spirit. saving the author."

"the fight content is back. murdering it on sight."

Screenshot them. Share them. Vex doesn't care.

Slash commands

command what it does
/init configure your Claude API key
/models list available Claude models and pick one
/login navigate this tab to X's login page; Vex waits until you reach /home
/logout wipe the saved X session
/interests edit what you want more of / less of
/feed shortcut: "look at the feed and tell me what you see"
/home jump to the For-You home feed
/start [dur] start autonomous re-training in the background (/start 4h, /start infinite)
/stop stop the running autopilot
/status show config + saved follow suggestions + autopilot state
/clear wipe chat history (memory files are preserved)
/help show this list
/quit leave

Power users: xinfluencer --autorun 4h skips chat and jumps straight into autonomous mode (legacy single-mode dashboard).

Env knobs

env var default what it does
ANTHROPIC_API_KEY overrides the saved key for this run
XINFLUENCER_MODEL claude-sonnet-4-6 overrides the saved model
XINFLUENCER_TYPING_MS 8 per-character delay on streamed text (0 disables)
XINFLUENCER_THINKING_TOKENS 1500 extended-thinking budget (0 disables)
XINFLUENCER_HOME ~/.xinfluencer where config, memory, and browser data live

How it works

┌──────────────────────────────────────────────────────────────────────┐
│  you            CLI                Claude                Playwright  │
│   │              │                    │                       │      │
│   ├──── chat ───►│                    │                       │      │
│   │              ├──── messages ─────►│                       │      │
│   │              │◄── thinking ──────┤                       │      │
│   │              │◄── text  ─────────┤                       │      │
│   │              │◄── tool_use ──────┤                       │      │
│   │              │                    │                       │      │
│   │              ├──── like, scroll, search, read_feed ──────►│      │
│   │              │                    │                       │      │
│   │              ├──── memory_* (read/write ~/.xinfluencer/memory/)  │
│   │              │                                                   │
│   └─── /start ──►│ spawns autonomous as background task ─────────────┤
│                  │ shares the browser via asyncio.Lock               │
│                  │ status streamed back as [auto] lines              │
└──────────────────────────────────────────────────────────────────────┘
  1. The CLI opens Chromium with your saved X session.
  2. Every few seconds, the agent reads the visible tweets from the DOM.
  3. Tweet text + author + your stated interests + memory of past sessions go to Claude.
  4. Claude streams thinking → tool_use → text; the runner executes each tool against the browser with human-like delays.
  5. /start makes the whole loop run in the background while you keep chatting.

Vex's memory

Persistent file-based memory at ~/.xinfluencer/memory/:

memory/
├── MEMORY.md           # vex's own index of what it knows
├── boss_profile.md     # what vex has learned about you beyond interests.json
├── accounts_seen.md    # append-only log of high-signal authors
├── topic_log.md        # running tally of which dislikes keep reappearing
└── playbook.md         # vex's notes on what worked: which queries hit gold

These are just markdown files. You can read them, edit them, or delete them. At the start of every session, the contents of MEMORY.md are inlined into Vex's system prompt — so each session boots up knowing what past-Vex learned.

Safety / honesty

  • This tool automates your real account. X's ToS is ambiguous about personal automation — read it. You're responsible for your account.
  • Long randomized delays (3–12s between scrolls, plus per-tweet think time) stay below most anti-automation heuristics, but nothing is guaranteed.
  • The agent never posts, follows, unfollows, retweets, replies, DMs, bookmarks, or quotes. Only consumes content and emits private preference signals. This is intentional and not configurable.
  • Your Claude API key and your X session cookie live exclusively on your machine, under ~/.xinfluencer/.
  • A weekly OSV scanner runs in CI and opens an issue if any new advisory affects our deps.
  • Claude's /security-review runs on every PR via GitHub Actions.

Recording your own demos

The animated GIFs in this README are generated from declarative VHS tape scripts in demo/. To regenerate them:

brew install vhs
cd demo && make publish    # renders + copies to docs/img/

PRs to improve the demos are welcome.

Contributing

PRs welcome — see CONTRIBUTING.md. Good first issues:

  • Better selectors for X's mobile DOM
  • Per-session markdown report of everything Vex did
  • A "shadow mode" that records actions without applying them
  • More VHS demos for the README

License

MIT — see LICENSE.


Not affiliated with X Corp, Twitter, or Anthropic. Use at your own risk.

About

An AI agent that re-trains your X/Twitter For-You feed. Claude + Playwright. Vex is its name.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages