Live data from Hacker News

Claude Code: Best practices for agentic coding

anthropic.com

91–100 of 268 posts

Re: Claude Code: Best practices for agentic coding

#91

Surprised that "controlling cost" isn't a section in this post. Here's my attempt. --- If you get a hang of controlling costs, it's much cheaper. If you're exhausting the context window, I would not be surprised if you're seeing high cost. Be aware of the "cache". Tell it to read specific files (and only those!), if you don't, it'll read unnecessary files, or repeatedly read sections of files or even search through f…

GitHub copilot follows your context perfectly. I don't have to tell it anything about files. I tried this initially and it just screwed up the results.

Re: Claude Code: Best practices for agentic coding

#92

If anyone from Anthropic is reading this, your billing for Claude Code is hostile to your users. Why doesn’t Claude Code usage count against the same plan that usage of Claude.ai and Claude Desktop are billed against? I upgraded to the $200/month plan because I really like Claude Code but then was so annoyed to find that this upgrade didn’t even apply to my usage of Claude Code. So now I’m not using Claude Code so mu…

Yeah, tried it for a couple of minutes, $0.31, quickly stopped and moved away.

Re: Claude Code: Best practices for agentic coding

#93
post #73

Earlier quoted context omitted.

> Why do you think you need semantic indexing? Unfortunately I can only give an anecdotal answer here, but I get better results from Cursor than the alternatives. The semantic index is the main difference, so I assume that's what's giving it the edge.

Is it a very large codebase? Anything else distinctive about it? Are you often asking high-level/conceptual questions? Those are the questions that would help me understand why you might be seeing better results with RAG.

I'll ask something like "where does X happen?" But "X" isn't mentioned anywhere in the code because the code is a complete nightmare.

Re: Claude Code: Best practices for agentic coding

#94

Earlier quoted context omitted.

It sounds insane until you drive full agentic loops/evals. I'm currently making a self-compiling compiler; no doubt you'll hear/see about it soon. The other night, I fell asleep and woke up with interface dynamic dispatch using vtables with runtime type information and generic interface support implemented...

Do you actually understand the code Claude wrote?

Do you understand all of the code in the libraries that your applications depend on? Or your coworker for that matter?

All of the gate keeping around llm code tools are amusing. But whatever, I’m shipping 10x and making money doing it.

Re: Claude Code: Best practices for agentic coding

#95
post #41

Earlier quoted context omitted.

Consider L5 at Google: outgoings of $377,797 USD per year just on salary/stock, before fixed overheads such as insurance, leave, issues like ramp-up time and cost of their manager. In the hands of a Staff+ engineer, these tools enable replication of Staff+ engineers and don't sleep. My 2c: the funding for the new norm will come from either compressing the manager layer or engineering layer or both.

LLMs absolutely don't replicate staff+ engineers. If your staff engineers are mostly doing things AI can do, then you don't need staff. Probably don't even need senior

Oh but they absolutely do. Have you not used any of this llm tooling? It’s insanely good once you learn how to employ it. I no longer need a front end team, for example. It's that good at TypeScript and React. And the design is even better.

Re: Claude Code: Best practices for agentic coding

#96

Surprised that "controlling cost" isn't a section in this post. Here's my attempt. --- If you get a hang of controlling costs, it's much cheaper. If you're exhausting the context window, I would not be surprised if you're seeing high cost. Be aware of the "cache". Tell it to read specific files (and only those!), if you don't, it'll read unnecessary files, or repeatedly read sections of files or even search through f…

It's interesting that this is a problem for people because I have never spent more than about $0.50 on a task with Claude Code. I have pretty good code hygiene and I tell Claude what to do with clear instructions and guidelines, and Claude does it. I will usually go through a few revisions and then just change anything myself if I find it not quite working. It's exactly like having an eager intern.

Re: Claude Code: Best practices for agentic coding

#97

> Use /clear to keep context focused The only problem is that this loss is permanent! As far as I can tell, there's no way to go back to the old conversation after a `/clear`. I had one session last week where Claude Code seemed to have become amazingly capable and was implementing entire new features and fixing bugs in one-shot, and then I ran `/clear` (by accident no less) and it suddenly became very dumb.

You can ask it to store its current context to a file, review the file, ask it to emphasize or de-emphasize things based on your review, and then use `/clear`. Then, you can edit the file at your leisure if you want to. And when you want to load that context back in, ask it to read the file. Works better than `/compact`, and is a lot cheaper.

Compared to my experience with the free GitHub Copilot in VS Code it sounds like you guys are in a horse and buggy.

Re: Claude Code: Best practices for agentic coding

#98
post #89
post #29

So I have been using Cursor a lot more in a vibe code way lately and I have been coming across what a lot of people report: sometimes the model will rewrite perfectly working code that I didn't ask it to touch and break it. In most cases, it is because I am asking the model to do too much at once. Which is fine, I am learning the right level of abstraction/instruction where the model is effective consistently. But wh…

That's why I like Aider. You can protect your files in a non-AI way: by simply not giving write access to Aider. Also, apparently Aider is a bit more economic with tokens than other tools.

I haven't used Aider yet, but I see it show up on HN frequently recently (the last couple of days specifically).

I am hesitant because I am paying for Cursor now and I get a lot of model usage included within that monthly cost. I'm cheap, perhaps to a fault even when I could afford it, and I hate the idea of spending twice when spending once is usually enough. So while Aider is potentially cheaper than Claude Code, it is still more than what I am already paying.

I would appreciate any comments on people who have made the switch from Cursor to Aider. Are you paying more/less? If you are paying more, do you feel the added value is worth the additional cost? If you are paying less, do you feel you are getting less, the same or even more?

Re: Claude Code: Best practices for agentic coding

#99

Surprised that "controlling cost" isn't a section in this post. Here's my attempt. --- If you get a hang of controlling costs, it's much cheaper. If you're exhausting the context window, I would not be surprised if you're seeing high cost. Be aware of the "cache". Tell it to read specific files (and only those!), if you don't, it'll read unnecessary files, or repeatedly read sections of files or even search through f…

The productivity boost can be so massive that this amount of fiddling to control costs is counterproductive.

Developers tend to seriously underestimate the opportunity cost of their own time.

Hint - it’s many multiples of your total compensation broken down to 40 hour work weeks.

Re: Claude Code: Best practices for agentic coding

#100

Surprised that "controlling cost" isn't a section in this post. Here's my attempt. --- If you get a hang of controlling costs, it's much cheaper. If you're exhausting the context window, I would not be surprised if you're seeing high cost. Be aware of the "cache". Tell it to read specific files (and only those!), if you don't, it'll read unnecessary files, or repeatedly read sections of files or even search through f…

I don't think about controlling cost because I price my time at US$40/h and virtually all models are cheaper than that (with the exception of o1 or Gemini 2.5 pro).

If I spend $2 instead of $0.50 on a session but I had to spend 6 minutes thinking about context, I haven't gained any money.

Post reply on HN