I've built a coding assistant over the last two days. The first 100 lines or so were handwritten. The rest has been written by the assistant itself.

It's written its system prompt. It's written its tools. Its written the code to reload the improved tools into itself.

And it knows it is working on itself - it frequently tries to use the enhanced functionality, and then expresses what in a human would be frustration at not having immediate access.

Once by trying to use ps to find its own pid in an apparent attempt to find a way to reload itself (that's the reason it gå before trying to run ps, anyway)

All its commits are now authored by the tool, including the commit messages. It needs to be good, and convincing, and having run the linter and the test suite for me to let it commit, but I agree a substantial majority of the time. It's only caused regressions once or twice.

A bit more scaffolding to trigger an automatic rollback in the case of failure and giving it access to a model I won't be charged by the token for, and I'd be tempted to let it out of the box, so to speak.

Today it wrote its own plan for what to add next. I then only told it to execute it.

A minor separate goal oriented layer guiding the planning, and it could run in a loop.

Odds are it'd run off the rails pretty quickly, but I kinda want to see how far it gets.

Is there some pre-trained model involved in this? Or it all started with just those 100 lines?

It's talking to a model over an API. Currently using Claude. Certainly would not be reasonable to do from scratch. The basic starting point to make a coding assistant is basically reading text from the user, feeding it to the model over the API, and giving it a couple of basic tools. Really the models can handle starting with just the ability to execute shell commands (with confirmation, unless you're braver than me), and from that you can bootstrap by asking it to suggest and write additional tools for itself.

That's cool. I saw a cloud once that looked like a bunny rabbit.