Earlier quoted context omitted.
Yeah the current best approach to aggressively compact and recreate context by starting fresh. It’s awkward and I wish I didn’t have to.
I'm surprised this hasn't been been automated yet but I'm pretty naive to the space - the problem of "when?"/"how often?" seems like a fun one to chew on
Ask HN: How can I get better at using AI for programming?
381–390 of 491 posts
Re: Ask HN: How can I get better at using AI for programming?
#382AI programming, for me, is just a few simple rules: 1. True vibe coding (one-shot, non-trivial, push to master) does not work. Do not try it. 2. Break your task into verifiable chunks. Work with Claude to this end. 3. Put the entire plan into a Markdown file; it should be as concise as possible. You need a summary of the task; individual problems to solve; references to files and symbols in the source code; a work li…
> it should be as concise as possible What’s more concise than code? From my experience, by the time I’ve gotten an English with code description accurate enough for an agent I could have done it myself. Typing isn’t a hard part. LLMs/agents have many other uses, but if you’re not offloading your thinking you’re not really going any faster wrt letting them write code via a prompt.
The word "Tetris" is significantly more concise than the source code for Tetris.
"Create a Tetris clone" is a valid four-word prompt. It's not going to produce a perfect one shot, but it'll get you 90% of the way there.
> I could have done it myself. Typing isn’t a hard part.
No, but it is slow. Claude can put together Tetris in 5 minutes. I most definitely cannot.
Re: Ask HN: How can I get better at using AI for programming?
#383Re: Ask HN: How can I get better at using AI for programming?
#384Earlier quoted context omitted.
I don't buy your past paragraph at all I am afraid. Coding langues, even high level ones, are built upon foundations of determism and they are concise and precise. A short way to describe very precisely, a bunch of rules and state. Prompting is none of those things. It is a ball of math we can throw words into, and it approximates meaning and returns an output with randomness built in. That is incredible, truly, but…
Eh, how modern technology works is not really the part I'm selling: that's just how it works. Coding languages haven't been describing even a fraction of the rules and state they encapsulate since what? Punch cards? It wasn't long until we started to rely on exponential number of layered abstractions to do anything useful with computers, and very quickly we traded precision and determinism for benefits like being con…
Re: Ask HN: How can I get better at using AI for programming?
#385Re: Ask HN: How can I get better at using AI for programming?
#386Earlier quoted context omitted.
"This is just meaningless knee-jerking," Your point is valid. "AI leads to loss of personal coding skills" Unfortunately, I can no longer do long division. No one will pay me to do long division and I have a calculator now. I could stay sharp at long division for a hobby though. Keep those for loops sharp if you want, but I don't see people paying you to hand code. Eventually, it will just be a liability. (like not u…
> Keep those for loops sharp if you want, but I don't see people paying you to hand code. Well, personally speaking, I'm paid to hand code; LLMs have not reached the quality of my code output yet and I'm seeing no pressure at all to use LLMs. Relatedly, I work on an open source project where the constraining resource is review (as it is in most open source projects.) The current state is that LLM generated code is in…
Re: Ask HN: How can I get better at using AI for programming?
#387Earlier quoted context omitted.
Why don’t you reset context when working on something else?
It’s additional features that are related. For example making a computer use agent… Made the plan, implementation was good, now I want to add a new tool for the agent, but I want to discuss best way to implement this tool first. Clearing context means Claude forgets everything about what was just built. Asking to discuss this new tool in plan mode makes Claude rewrite entire spec for some reason. As workaround, I tel…
Re: Ask HN: How can I get better at using AI for programming?
#388Earlier quoted context omitted.
Try to keep it under 1k tokens or so. We will show you a warning if it might be too big. Ours is maybe half that size. We remove from it with every model release since smarter models need less hand-holding. You can also break up your CLAUDE.md into smaller files, link CLAUDE.mds, or lazy load them only when Claude works in nested dirs. https://code.claude.com/docs/en/memory
1k tokens, google says thats about 750 words. That's actually pretty short, any chance you could post a few samples of instructions or even link to a publicly available file CLAUDE.md you recommend?
This is the meat of it:
## Code Style (See JULIA_STYLE.md for details)
- Always use explicit `return` statements
- Use Float32 for all numeric computations
- Annotate function return types with `::`
- All `using` statements go in Main.jl only
- Use `error()` not empty returns on failure
- Functions >20 lines need docstrings
## Do's and Don'ts
- Check for existing implementations first
- Prefer editing existing files
- Don't add comments unless requested
- Don't add imports outside Main.jl
- Don't create documentation unless requested
Since Opus 4.0 this has been enough to get it to write code that generally follows our style, even in Julia, which is a fairly niche language.Re: Ask HN: How can I get better at using AI for programming?
#389Using voice transcription is nice for fully expressing what you want, so the model doesn't need to make guesses. I'm often voicing 500-word prompts. If you talk in a winding way that looks awkward when in text, that's fine. The model will almost certainly be able to tell what you mean. Using voice-to-text is my biggest suggestion for people who want to use AI for programming (I'm not a particularly slow typer. I can…
My regular workflow is to talk (I use VoiceInk for transcription) and then say “tell me what you understood” — this puts your words into a well structured format, and you can also make sure the cli-agent got it, and expressing it explicitly likely also helps it stay on track.
Re: Ask HN: How can I get better at using AI for programming?
#390Earlier quoted context omitted.
> it should be as concise as possible What’s more concise than code? From my experience, by the time I’ve gotten an English with code description accurate enough for an agent I could have done it myself. Typing isn’t a hard part. LLMs/agents have many other uses, but if you’re not offloading your thinking you’re not really going any faster wrt letting them write code via a prompt.
> What’s more concise than code? The word "Tetris" is significantly more concise than the source code for Tetris. "Create a Tetris clone" is a valid four-word prompt. It's not going to produce a perfect one shot, but it'll get you 90% of the way there. > I could have done it myself. Typing isn’t a hard part. No, but it is slow. Claude can put together Tetris in 5 minutes. I most definitely cannot.