Live data from Hacker News

How to code Claude Code in 200 lines of code

mihaileric.com

81–90 of 249 posts

Re: How to code Claude Code in 200 lines of code

#81
post #77

Reminds me of this 2023 post "re-implementing LangChain in 100 lines of code": https://blog.scottlogic.com/2023/05/04/langchain-mini.html We did just that back then and it worked great, we used it in many projects after that.

How was this three years ago ;_;

Re: How to code Claude Code in 200 lines of code

#83

Earlier quoted context omitted.

[flagged]

This site has gone full Tower of Babel. I've seen at least a thousand "AI comment" callouts on this site in the last month and at this point I'm pretty sure 99% of them are wrong. In fact, can someone link me to a disputed comment that the consensus ends up being it's actually AI? I don't think I've seen one.

You know how the chicken sexers do their thing, but can't explain it? Like they can't write a list of things they check for. And when they want to train new people they have them watch (apprentice style) the current ones, and eventually they also become good at doing it themselves?

It's basically that. I can't explain it (I tried listing the tells in a comment below), but it's not just a list of things you notice. You notice the whole message, the cadence, the phrases that "add nothing". You play with enough models, you see enough generations and you start to "see it".

If you'd like to check for yourself, check that user's comment history. It will become apparent after a few messages. They all have these tells. I don't know how else to explain it, but it's there.

Re: How to code Claude Code in 200 lines of code

#84

Earlier quoted context omitted.

This site has gone full Tower of Babel. I've seen at least a thousand "AI comment" callouts on this site in the last month and at this point I'm pretty sure 99% of them are wrong. In fact, can someone link me to a disputed comment that the consensus ends up being it's actually AI? I don't think I've seen one.

“Comment I don't like is a bot” is the new “Comment I don’t like is a product of the HN hivemind conspiracy”.

The comment isn't saying anything controversial so why would I dislike it or want an excuse to throw shade on it?

It's a bot. Period.

Re: How to code Claude Code in 200 lines of code

#86
post #51

Earlier quoted context omitted.

The most imp part is editing code, to do that reliably Claude models are trained on their own str replace tool schema I think. Models find it hard to modify existing code, they also can't just rewrite whole files bcz that's expensive and doesn't scale.

Yeah, there is definitely some RLVR training going on for the Claude LLMs to get them good at some of the specific tool calls used in Claude Code, I expect. Having said that, the string replacement tool schema for file edits is not very complicated at all (you can see it in the tool call schema Claude Code sends to the LLM), so you could easily use that in your own 200-300 line agent if you wanted to make sure you're…

Yeah that's one example, but I suspect they train the model on entire sequences of tool calls, so unless you prompt the model exactly as them you won't get the same results.

There's a reason they won the agent race, their models are trained to use their own tools.

Re: How to code Claude Code in 200 lines of code

#87
post #80

It's a great point and everyone should know it: the core of a coding agent is really simple, it's a loop with tool calling. Having said that, I think if you're going to write an article like this and call it "The Emperor Has No Clothes: How to Code Claude Code in 200 Lines of Code", you should at least include a reference to Thorsten Ball's excellent article from wayyy back in April 2025 entitled "How to Build an Age…

I've been exploring the internals of Claude Code and Codex via the transcripts they generate locally (these serve as the only record of your interactions with the products)[1]. Given the stance of the article, just the transcript formats reveals what might be a surprisingly complex system once you dig in. For Claude Code, beyond the basic user/assistant loop, there's uuid/parentUuid threading for conversation chains,…

This is very interesting, especially if you could then use an llm across that search to figure out what has and maybe has not been completed, and then reinject those findings into a new Claude code session

Re: How to code Claude Code in 200 lines of code

#88

Earlier quoted context omitted.

“Comment I don't like is a bot” is the new “Comment I don’t like is a product of the HN hivemind conspiracy”.

The comment isn't saying anything controversial so why would I dislike it or want an excuse to throw shade on it? It's a bot. Period.

You might notice I wasn't responding to your specific claim about a particular comment but to a later post by a different poster commenting on a wider phenomenon. Perhaps stop trying so hard to insert the idea you want to argue against into posts where it doesn't actually exist just so you can have something to argue about. (Especially given there are many direct responses to your post actually arguing with your claim that you could instead argue with.)

Re: How to code Claude Code in 200 lines of code

#89
post #47

Earlier quoted context omitted.

I don't think so, model improvements far outweigh any harness or tooling. Look at https://github.com/SWE-agent/mini-swe-agent for proof

Yes but people aren’t choosing CC because they are necessarily performance maximalists. They choose it because it has features that make it behave much more nicely as a pair programming assistant than mini-swe-agent. There’s a reason Cursor poached Boris Cherney and Cat Wu and Anthropic hired them back!

They nailed down the UX I would say and the models themselves are a lot better even outside of CC

Re: How to code Claude Code in 200 lines of code

#90
post #89

Earlier quoted context omitted.

Yes but people aren’t choosing CC because they are necessarily performance maximalists. They choose it because it has features that make it behave much more nicely as a pair programming assistant than mini-swe-agent. There’s a reason Cursor poached Boris Cherney and Cat Wu and Anthropic hired them back!

They nailed down the UX I would say and the models themselves are a lot better even outside of CC

I don’t think I disagree with you about anything, I’m trying to split hairs at this point.
Post reply on HN