News for hackers. Stuff that matters.
Re:Prime Agent: A self-improving RLM agent by embedding-shape on Wednesday August 05, 2026 @06:53PM (#49190153)
LLM-generated code that seemingly went without much review or design is always such an interesting dive into just how bloated you can make code. Multiple files are close to 10K LOC, one file contains a switch statement that has so many case statements it spans more than 1000 lines.

I guess it depends on the model you're trying to use, but seems most of them prefer smaller codebases, they work a lot better with less code, which kind of makes sense. With that in mind, I'd probably aim for something way smaller to bootstrap a self-improving agent. Then I'd use this "Prime Agent" as an example to my self-improving agent for what it should not evolve to.

Re:Prime Agent: A self-improving RLM agent by andai on Wednesday August 05, 2026 @08:19PM (#49190820)
Bash is all you need.

https://minimal-agent.com/

Re:Prime Agent: A self-improving RLM agent by whattheheckheck on Wednesday August 05, 2026 @11:42PM (#49192169)
Literally says who. Swe are the least credible "engineers". "It depends" "No you cant track us" "No we have no credentials system other than big company shill certs"
Re:Prime Agent: A self-improving RLM agent by c-hendricks on Wednesday August 05, 2026 @09:07PM (#49191157)
> one file contains a switch statement that has so many case statements it spans more than 1000 lines

Probably best to leave YandereDev's code out of the training data.

Re:Prime Agent: A self-improving RLM agent by trenchgun on Thursday August 06, 2026 @02:24AM (#49193175)
Interesting, so they shipped slop? Succumbed to their own AI psychosis?
Re:Prime Agent: A self-improving RLM agent by tosh on Thursday August 06, 2026 @02:39AM (#49193296)
here is a take on a smol agent ("smol")

  - 21 lines of Go
  - no 3rd party dependencies
https://github.com/smol-env/smol

easier to add and customize stuff when you start from a small base

think of it as your starter dough

Re:Prime Agent: A self-improving RLM agent by vivzkestrel on Thursday August 06, 2026 @07:14AM (#49195180)
got one in typescript? or node.js with javascript?
Re:Prime Agent: A self-improving RLM agent by tosh on Thursday August 06, 2026 @09:46AM (#49196641)
I'm adding python in a few minutes and then looking into other languages including javascript and typescript

all with the same zero 3rd party dependencies approach

also want to do clojure, unfortunately it looks like java does not come with json support out of the box

Re:Prime Agent: A self-improving RLM agent by embedding-shape on Thursday August 06, 2026 @11:04AM (#49197714)
> also want to do clojure, unfortunately it looks like java does not come with json support out of the box

Clojure has clojure.data.json (https://clojure.github.io/data.json/), should be easy to use albeit not blazing fast exactly, doesn't really matter here though. Otherwise, you could use Babashka, comes with Cheshire (and others) out of the box.

Re:Prime Agent: A self-improving RLM agent by tosh on Thursday August 06, 2026 @11:18AM (#49197903)
ty for the pointers

I like the babashka angle!

Re:Prime Agent: A self-improving RLM agent by evanjrowley on Thursday August 06, 2026 @01:30PM (#49199740)
The stuff 99% of agents are coded in? Please tell me this was sarcasm.
Re:Prime Agent: A self-improving RLM agent by tosh on Friday August 07, 2026 @03:45AM (#49207143)
i'm also not a fan of javascript and typescript (let alone the ecosystem they come with)

but the runtimes are everywhere

and a smol agent /w no 3rd party dependencies is probably a good option to have in a pinch

Re:Prime Agent: A self-improving RLM agent by efskap on Thursday August 06, 2026 @06:58PM (#49203781)
I dig the spirit, but if I'm meant to understand it in an afternoon, why is it codegolfed to such an extent? It's like reading the output of a minifier, not idiomatic Go.
Re:Prime Agent: A self-improving RLM agent by nullbio on Thursday August 06, 2026 @03:23AM (#49193584)
How on Earth do we solve this bloat and death-by-a-thousand-cuts issue with frontier LLMs? Are there any actual solutions or attempts at solutions to this problem that I can try? Any tools or frameworks? I've tried re-architecture skills, dedicated cleanup sessions, and a bunch of other stuff, but nothing really works well.
Re:Prime Agent: A self-improving RLM agent by impulser_ on Thursday August 06, 2026 @04:36AM (#49194085)
Don't have it write the whole thing in one session.
Re:Prime Agent: A self-improving RLM agent by embedding-shape on Thursday August 06, 2026 @05:08AM (#49194314)
Don't try to "run as fast as possible" and just add code willy-nilly, think about the design, refactor as you add new features/fixes and intentionally be a bit slower and more considerate.

It's not a technical problem, if you steer the LLMs enough and actually review what they do, you can build proper and clean software with them.

Re:Prime Agent: A self-improving RLM agent by nullbio on Thursday August 06, 2026 @01:13PM (#49199499)
Yeah, but that's boring. :)
Re:Prime Agent: A self-improving RLM agent by kooi on Thursday August 06, 2026 @11:32PM (#49205634)
Add Sentrux to the LLM loop. https://github.com/sentrux/sentrux

It's an offline coding grader. It works well: You ask for a new module, LLM starts spitting out bloated crap, the code score goes down. LLM keep looping until code score is back up.

Not a substitute for human code review, but keeps things within tight guard rails.

Re:Prime Agent: A self-improving RLM agent by KingMob on Friday August 07, 2026 @01:18AM (#49206132)
Are you the author? The font size and contrast is kind of poor.
Re:Prime Agent: A self-improving RLM agent by nullbio on Friday August 07, 2026 @03:50AM (#49207191)
Have you done any benchmarks on this approach?

I wonder if it just ends up in reward-hacking, or if it actually substantially changes the quality of the code.

Are these static analysis metrics enough on their own to cause a substantial improvement?

I tried setting some constraints as part of my system instruction prompt to prevent God file creation, and it did end up breaking files up, but it would often just create a new type of mess and do it needlessly.

Without the model doing additional reasoning and search for alternative approaches that were better fitted on top as it was doing this file splitting, it didn't actually seem to improve quality at all.

So I'm curious to know if this would just result in more of that, or if it would actually result in different choices. Because there's more to code maintenance than just splitting things up into modules, etc. Like the main part of it that I suspect will not be captured is the part of thinking about the big picture, brainstorming multiple architectural approaches, and reasoning through the best one.

Re:Prime Agent: A self-improving RLM agent by kooi on Friday August 07, 2026 @01:59PM (#49214070)
Only anecdotal benchmarks for what ever that is worth.

I notice the LLM reasoning things like: "The maintainability score went down, let me look.... I see I've duplicated existing code which already exists in this module...I see this logic could be consolidated".

I have noticed file splitting is a strategy to improve the "score".

In my experience, I've been doing more the architectural guidance. There is also a rules engine which I have not used, but looks pretty interesting:

``` [constraints] max_cycles = 0 max_coupling = "B" max_cc = 25 no_god_files = true

[[layers]] name = "core" paths = ["src/core/"] order = 0

[[layers]] name = "app" paths = ["src/app/"] order = 2

[[boundaries]] from = "src/app/" to = "src/core/internal/" reason = "App must not depend on core internals" ```

Re:Prime Agent: A self-improving RLM agent by ben_w on Thursday August 06, 2026 @05:23AM (#49194418)
> In this repository, multiple files are close to 10K LOC, one file contains a switch statement that has so many case statements it spans more than 1000 lines, and lots of other fun stuff.

Pft. Over multiple cases?

I've seen 1000 lines inside a single if-block. The clause was always true. I was not able to break that thing up in my time at that company.

Human wrote that nonsense.

Thing is, the app was pretty successful despite all the stuff wrong with the code. And this success is why I've been bullish on GenAI code itself, even though I'm also bearish on AI companies being able to profit from that.

Re:Prime Agent: A self-improving RLM agent by dd8601fn on Thursday August 06, 2026 @10:20AM (#49197059)
At all feels a bit like being bullish on the adjustable wrench, to me.

It has lots of utility. Very broad… but not the best for a lot of things. It will be a ubiquitous tool. Outcomes will depend heavily on the quality of the mechanic unless you’re tightening a bolt on your fence gate.