Thorsten Ball’s tutorial on building agents only takes an hour or two to work through. It’s an excellent read for audiences of all technical acumen.

It’s not that hard to build a fully functioning, code-editing agent.

It seems like it would be. When you look at an agent editing files, running commands, wriggling itself out of errors, retrying different strategies — it seems like there has to be a secret behind it.

There isn’t. It’s an LLM, a loop, and enough tokens.

How to Build an Agent

After you’ve dabbled a bit with vibe coding tools, there’s no better way to wrap your head around vibe coding than to build it for yourself. There’s no magic, even if you don’t know Go!

If you’re handy with Ruby, you can easily compress the ideas therein down to about a hundred lines of code.

	  class ReadFile < RubyLLM::Tool
	    description <<~DESC
	      Read the contents of a given relative file path. Use this when you want to see what's inside a file. Do not use this with directory names.
	    DESC
	    param :path,
	          type: :string,
	          required: true,
	          desc: 'The relative path of a file in the working directory.'
	
	    def execute(path:)
	      File.read(path)
	    rescue StandardError => e
	      { error: e.message }
	    end
	  end

RubyLLM is a fantastic library. Nearly all the ideas in the tutorial are concise abstractions. Recommended.