I Built a Working X Bot with Claude Code—and Barely Knew What I Was Doing

This morning, I noticed something I am sure every X user has noticed too: there are a ton of bots on X.

My first question to ChatGPT was simple: what is the point?

I assumed bots were probably against X's terms of service. ChatGPT explained that automation itself is not necessarily the problem. For example, an account automatically posting weather updates is very different from a bot pretending to be a real person and deceptively replying to users.

That got me thinking.

Okay, this sounds like a fun project, and I am lucky enough to live in the age of Claude Code.

Let's make an X bot.

ChatGPT went through a few ideas with me, and I landed on something I called the Weekly $100 Report.

The idea was simple: if you had invested $100 one year ago today, what would it be worth now?

I wanted to compare a few different options:

  • S&P 500
  • Nasdaq-100
  • Gold
  • Bitcoin
  • Cash, adjusted for inflation

I asked ChatGPT to help me write a prompt for Claude Code. I have found that LLMs are usually better at writing prompts for other LLMs than I am, especially when I am trying to get Claude Code to build something.

I should also be clear: I do not have much traditional coding experience.

I could probably make a "Hello, World!" program myself, but that is about where my confidence ends.

I created a new folder inside the Projects folder on my Mac, opened it in VS Code, launched Claude Code, and pasted in my prompt.

Claude started doing its thing.

It asked me several times whether it had permission to run certain commands. I mostly said yes because, honestly, I did not fully understand what it was doing anyway.

A few minutes later, I had this sitting in my terminal:

S&P 500: $118.43
Nasdaq-100: $123.88
Gold: $120.14
Bitcoin: $53.57
Cash (after inflation): $96.65

Success!

Now I had another question:

How do I get this onto X?

This ended up being the harder part for me because Claude could not create the X account, log into my developer account, or set everything up on X for me.

I had to create the new X account, set up the developer access, add some API credits, and plug the necessary credentials into my project.

Once I got through that, Claude helped with the rest.

And voilà: I had an X bot posting the report.

Then came the next question.

How do I automate it?

Claude handled that too.

It set up something using launchd on my Mac rather than cron. The basic idea, as I understand it, is that the task can run automatically on a schedule, and if my Mac happens to be asleep or off, it can run again once the computer is available.

So now I have a working X bot that posts a mostly useless financial metric once per week for something like a penny or two per post.

Is it changing the world?

Absolutely not.

But that is not really the interesting part.

At the beginning of the day, I knew almost nothing about how X bots worked. By the end of the day, I had created an account, connected to financial data, used an API, connected to X's API, automated the process, and had a live bot posting on the internet.

A few years ago, there is no chance I could have done that in a couple of hours.

The biggest downside is also obvious: I still do not really understand most of the code.

I am not sure I learned much Python while building this. Claude did most of the actual coding, while I mostly acted as the person directing the project and getting the necessary accounts and credentials set up.

But I did learn something about the process of building software.

I had an idea.

I broke it into a problem I could describe.

I used AI to help me build it.

I dealt with the parts that AI could not do for me.

And most importantly, I actually finished it.

That alone feels valuable.

My next step is probably to work through something like Automate the Boring Stuff with Python so I can start understanding what is happening underneath the hood.

Because right now, I am in an interesting place.

I can build software that I do not fully understand.

That is incredibly powerful.

It is also a little uncomfortable.

And I think learning how to close that gap might be my next project.