Live data from Hacker News

Claude Code: Best practices for agentic coding

anthropic.com

151–160 of 268 posts

Re: Claude Code: Best practices for agentic coding

#151
post #128
post #99

Earlier quoted context omitted.

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.

Hard agree. Whether it's 50 cents or 10 dollars per session, I'm using it to get work done for the sake of quickly completing work that aims to unblock many orders of magnitude more value. But in so far as cheaper correct sessions correlate with sessions where the problem solving was more efficient anyhow, they're fairly solid tips.

I agree but optimisation often reveals implementation details helping to understand limits of current tech more. It might not be worth the time but part of engineering is optimisation and another part is deep understanding of tech. It is sometimes worth optimising anyway if you want to take the engineering discipline to the next level within yourself.

I myself didn’t think about not running linters however it makes obvious sense now and gives me the insight about how Claude Code works allowing me to use this insight in related engineering work.

Re: Claude Code: Best practices for agentic coding

#152
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…

Not gonna lie: the "ultrathink" keyword that Sonnet 3.7 with thinking tokens watches for gives me "doubleplusgood" vibes in a hilarious but horrifying way.

Re: Claude Code: Best practices for agentic coding

#153
post #100

Earlier quoted context omitted.

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.

Important to remind people this is only true if you have a profitable product, otherwise you’re spending money you haven’t earned.

If what I'm doing doesn't have a positive expected value, the correct move isn't to use inferior dev tooling to save money, it's to stop working on it entirely.

Re: Claude Code: Best practices for agentic coding

#154
post #56

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…

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.

Re: Claude Code: Best practices for agentic coding

#155

So I feel like a grandpa reading this. I gave Claude code a solid shot. Had some wins but costs started blowing up. I switched to Gemini AI where I only upload files I want it to work on and make sure to refactor often so modularity remains fairly high. It's an amazing experience. If this is any measure - I've been averaging about 5-6 "small features" per 10k tokens. And I totally suck at fe coding!! The other intere…

by fe the poster means FE (front-end)

Re: Claude Code: Best practices for agentic coding

#156

I mostly work in neovim, but I'll open cursor to write boilerplate code. I'd love to use something cli based like Claude Code or Codex, but neither of them implement semantic indexing (vector embeddings) the way Cursor does. It should be possible to implement an MCP server which does this, but I haven't found a good one.

Good point. I largely work in Zed -- looks like it had semantic search for a while but is working on a redesign https://github.com/zed-industries/zed/issues/9564

Re: Claude Code: Best practices for agentic coding

#158

Earlier quoted context omitted.

> but somehow Anthropic is expecting people to pay $200 in API costs per functional PR costs to vibe code. Ok. Reading the thread, somehow people are paying. It is mindblowing how in place of getting cheaper, development just got more expensive for businesses.

$200 per PR is significantly cheaper development than businesses are paying.

In terms of short-term outlay, perhaps. But don't forget to factor in the long-term benefits of having a human team involved.

Re: Claude Code: Best practices for agentic coding

#159
post #10

well, the best practice is to use gemini 2.5 pro instead :)

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

Re: Claude Code: Best practices for agentic coding

#160
post #132

Earlier quoted context omitted.

Think about what you would do in an unfamiliar project with no context and the ticket "please fix the authorization bug in /api/users/:id". You'd start by grepping the code base and trying to understand it. Compare that to, "fix the permission in src/controllers/users.ts in the function `getById`. We need to check the user in the JWT is the same user that is being requested"

So, AIs are overeager junior developers at best, and not the magical programmer replacements they are advertised as.

Let's split the difference and call them "magical overeager junior developer replacements".
Post reply on HN