How to code Claude Code in 200 lines of code
221–230 of 249 posts
Re: How to code Claude Code in 200 lines of code
#222Feels like we're headed toward a world where everyone can build these loops easily. Curious what you think separates good uses of these agents from mediocre ones.
Re: How to code Claude Code in 200 lines of code
#223Earlier quoted context omitted.
Models just naturally arrive at a conclusion that they are done. TODO hints can help, but is not infallible: Claude will stop and happily report there's more work to be done and "you just say the word Mister and I'll continue" --- this is a RL problem where you have to balance the chance of an infinite loop (it keeps thinking there's a little bit more to do when there is not) versus the opposite where it stops short…
> this is a RL problem where you have to balance the chance of an infinite loop (it keeps thinking there's a little bit more to do when there is not) versus the opposite where it stops short of actual completion. Any idea on why the other end of the spectrum is this way -- thinking that it always has something to do? I can think of a pet theory on it stopping early -- that positive tool responses and such bias it tow…
Who said anything about "thinking"? Smaller models were notorious for getting stuck repeating a single word over and over, or just "eeeeeee" forever. Larger models only change probabilities, not the fundamental nature of the machine.
Re: How to code Claude Code in 200 lines of code
#224This misses that agentic LLMs are trained via RL to use specific tools. Adding custom tools is subpar to those the model has been trained with. That's why Claude Code has an advantage, over say, Cursor, by being vertically integrated.
Re: How to code Claude Code in 200 lines of code
#225This misses that agentic LLMs are trained via RL to use specific tools. Adding custom tools is subpar to those the model has been trained with. That's why Claude Code has an advantage, over say, Cursor, by being vertically integrated.
But if one were to write tools that were "abi-compatible" with Claude Code's, could you see similar performance with a custom agent? And if so - is Cursor not doing just that?
Re: How to code Claude Code in 200 lines of code
#226Re: How to code Claude Code in 200 lines of code
#227Woah now, did you get Anthropic's permission to use Claude outside of Claude Code?
you can get yourself an api key at console.anthropic.com and build whatever you want
(i use local models where possible but must admit opus45 is good)
Re: How to code Claude Code in 200 lines of code
#228Something I would add is planning. A big "aha" for effective use of these tools is realizing they run on dynamic TODO lists. Ex: Plan mode is basically bootstrapping how that TODO list gets seeded and how todos ground themselves when they get reached, and user interactions are how you realign the todo lists. The todolist is subtle but was a big shift in coding tools, and many seem to be surprised when we discuss it -…
Re: How to code Claude Code in 200 lines of code
#229Earlier quoted context omitted.
> there's a threshold past which Claude loses the forest for the trees and makes the same mistakes over and over. Try using something like Beads with Claude Code. Also don't forget to have a .claude/instructions.md file, you can literally ask Claude to make it for you, this is the file Claude reads every time you make a new prompt. If Claude starts acting "off" you tell it to reread it again. With Beads though, I bas…
Ohh, looks interesting, thanks for the tip! Git as db is clever, and the sqlite cache is nice. I'd been sketching sqlite based memory features myself. So much of the current ecosystem is suboptimal just because it's new. The models are trained around immutable conversation ledgers with user/tool/assistant blocks, but there are compelling reasons to manipulate both sides at runtime and add synthetic exchanges. Priming…
Re: How to code Claude Code in 200 lines of code
#230Oh, yes it's easy. That's just so cute.