Live data from Hacker News

Claude Code: Best practices for agentic coding

anthropic.com

171–180 of 268 posts

Re: Claude Code: Best practices for agentic coding

#171
post #159

Earlier quoted context omitted.

Yep I learned this the hard way after racking up big bills just using Sonnet 3.7 in my IDE. Gemini is just as good (and not nearly as willing to agree with every dumb thing I say) and it’s way cheaper.

> Gemini is ... way cheaper. Yep. Here are the API pricing numbers for Gemini vs Claude. All per 1M tokens. 1. Gemini 2.5: in: $0.15; out: $0.60 non-thinking or $3.50 thinking 2. Claude 3.7: in: $3.00; out: $15 [1] https://ai.google.dev/gemini-api/docs/pricing [2] https://www.anthropic.com/pricing#api

Your gemini pricing is for flash, not pro. Also, claude uses prompt caching and gemini currently does not. The pricing isn't super straightforward because of that.

Re: Claude Code: Best practices for agentic coding

#172
post #79

Earlier quoted context omitted.

> let alone 100+ per month that claude code would require I find this argument very bizarre. $100 is pay for 1-2 hours of developer time. Doesn't it save at least that much time in a whole month?

what happened to the "$5 is just a cup o' coffee" argument? Are we heading towards the everything-for-$100 land? On a serious note, there is no clear evidence that any of the LLM-based code assistants will contribute to saving developer time. Depends on the phase of the project you are in and on a multitude of factors.

While I agree, I find the early phases to be the least productive use of my time as it’s often a lot of boilerplate and decisions that require thought but turn to matter very little. Paying $100 to bootstrap to midlife on a new idea seems absurdly cheap given my hourly.

Re: Claude Code: Best practices for agentic coding

#173
post #149

The "ultrathink" thing is pretty funny: > We recommend using the word "think" to trigger extended thinking mode, which gives Claude additional computation time to evaluate alternatives more thoroughly. These specific phrases are mapped directly to increasing levels of thinking budget in the system: "think" I had a poke around and it's not a feature of the Claude model, it's specific to Claude Code. There's a "megathi…

That's awesome, and almost certainly an Unreal Tournament reference (when you chain enough kills in short time it moves through a progression that includes "megakill" and "ultrakill").

Re: Claude Code: Best practices for agentic coding

#174
post #56

Earlier quoted context omitted.

Oh wow. Reading your comment guarantees I'll never use Claude Code. I use Aider. It's awesome. You explicitly specify the files. You don't have to do work to limit context.

Not having to specify files is a humongous feature for me. Having to remember which file code is in is half the work once you pass a certain codebase size.

That sometimes work sometimes doesn’t and takes 10x time. Same with codex. I would have both and switch between them depending on what you feel will get it right better

Re: Claude Code: Best practices for agentic coding

#175
post #127
post #56

Earlier quoted context omitted.

Oh wow. Reading your comment guarantees I'll never use Claude Code. I use Aider. It's awesome. You explicitly specify the files. You don't have to do work to limit context.

>I use Aider. It's awesome. What do you use for the model? Claude? Gemini? o3?

Gemini 2.5 pro is my choice

Re: Claude Code: Best practices for agentic coding

#176
post #168
post #149

The "ultrathink" thing is pretty funny: > We recommend using the word "think" to trigger extended thinking mode, which gives Claude additional computation time to evaluate alternatives more thoroughly. These specific phrases are mapped directly to increasing levels of thinking budget in the system: "think" I had a poke around and it's not a feature of the Claude model, it's specific to Claude Code. There's a "megathi…

Weird code to have in a modern AI system! Also 14 string scans seems a little inefficient!

14 checks through a string is entirely negligible relative to the amount of compute happening. Like a drop of water in the ocean.

Re: Claude Code: Best practices for agentic coding

#177
post #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.

The cost of the task scales with how long it takes, plus or minus.

Substitute “cost” with “time” in the above post and all of the same tips are still valuable.

I don’t do much agentic LLM coding but the speed (or lack thereof) was one of my least favorite parts. Using any tricks that narrow scope, prevent reprocessing files over and over again, or searching through the codebase are all helpful even if you don’t care about the dollar amount.

Re: Claude Code: Best practices for agentic coding

#178
post #139
post #131

Earlier quoted context omitted.

was it a wget call feeding into html2pdf?

no it's a few hundred lines of python to parse weird and inconsistent HTML into json files and CSV files, and then a sync script that can call the WP API to create all the authors as needed, update the articles, and migrate the images

Plumbing to pipe shit from one sewer to another.

Re: Claude Code: Best practices for agentic coding

#179

Earlier quoted context omitted.

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.

Up until recently I could be sure they were written by a human.

But if you are making money by using LLMs to write code then all power to you. I just despair at the idea of trillions of lines of LLM generated code.

Re: Claude Code: Best practices for agentic coding

#180
post #149

The "ultrathink" thing is pretty funny: > We recommend using the word "think" to trigger extended thinking mode, which gives Claude additional computation time to evaluate alternatives more thoroughly. These specific phrases are mapped directly to increasing levels of thinking budget in the system: "think" I had a poke around and it's not a feature of the Claude model, it's specific to Claude Code. There's a "megathi…

What I don’t like about Claude Code is why can’t they give command line flags for this stuff? It’s better documented and people don’t have to discover this the hard way.

Similarly, I do miss an —add command line flag to manual specify the context (files) during the session. Right now I pretty much end up copy pasting the relative paths from VSCode and supply to Claude. Aider has much better semantics for such stuff.

Post reply on HN