← Back to context

Comment by kentonv

6 days ago

I'm the author of this library! Or uhhh... the AI prompter, I guess...

I'm also the lead engineer and initial creator of the Cloudflare Workers platform.

--------------

Plug: This library is used as part of the Workers MCP framework. MCP is a protocol that allows you to make APIs available directly to AI agents, so that you can ask the AI to do stuff and it'll call the APIs. If you want to build a remote MCP server, Workers is a great way to do it! See:

https://blog.cloudflare.com/remote-model-context-protocol-se...

https://developers.cloudflare.com/agents/guides/remote-mcp-s...

--------------

OK, personal commentary.

As mentioned in the readme, I was a huge AI skeptic until this project. This changed my mind.

I had also long been rather afraid of the coming future where I mostly review AI-written code. As the lead engineer on Cloudflare Workers since its inception, I do a LOT of code reviews of regular old human-generated code, and it's a slog. Writing code has always been the fun part of the job for me, and so delegating that to AI did not sound like what I wanted.

But after actually trying it, I find it's quite different from reviewing human code. The biggest difference is the feedback loop is much shorter. I prompt the AI and it produces a result within seconds.

My experience is that this actually makes it feels more like I am authoring the code. It feels similarly fun to writing code by hand, except that the AI is exceptionally good at boilerplate and test-writing, which are exactly the parts I find boring. So... I actually like it.

With that said, there's definitely limits on what it can do. This OAuth library was a pretty perfect use case because it's a well-known standard implemented in a well-known language on a well-known platform, so I could pretty much just give it an API spec and it could do what a generative AI does: generate. On the other hand, I've so far found that AI is not very good at refactoring complex code. And a lot of my work on the Workers Runtime ends up being refactoring: any new feature requires a bunch of upfront refactoring to prepare the right abstractions. So I am still writing a lot of code by hand.

I do have to say though: The LLM understands code. I can't deny it. It is not a "stochastic parrot", it is not just repeating things it has seen elsewhere. It looks at the code, understands what it means, explains it to me mostly correctly, and then applies my directions to change it.

Thanks for so meticulously documenting the prompts you used and whether or not a commit was done manually or via the AI.

Fancy! Why are the first twenty commits or so created in the same minute though? Surely you can’t be that fast if you need to prompt for each commit

  • That's weird! It must be due to a history rewrite I did later on to clean up the repo, removing some files that weren't really part of the project. I didn't realize when I first started the experiment that we'd actually end up releasing the code so I had to go back and clean it up later. I am surprised though that this messed up the timestamps -- usually rebases retain timestamps. I think I used `git filter-branch`, though. Maybe that doesn't retain timestamps.

    • I know that `git rebase` changes the committer date while keeping the author date the same, so I'm assuming something similar happened here. For example, many of the early commits have this committer date with varying author dates:

          $ git show --format=fuller 3dafc8f5de6ffe46fb223a75a46a6bd848b6daf8
          commit 3dafc8f5de6ffe46fb223a75a46a6bd848b6daf8
          Author:     Kenton Varda <kenton@cloudflare.com>
          AuthorDate: Thu Feb 27 17:15:37 2025 -0600
          Commit:     Kenton Varda <kenton@cloudflare.com>
          CommitDate: Tue Mar 4 14:48:59 2025 -0600
          
              Add storage schema by Claude.
      

      GitHub uses the committer date for its history, which is annoying if you rebase frequently; I like to run a non-interactive `git rebase` with `--commmiter-date-is-author-date` in such cases.