Live data from Hacker News

Claude Code: Best practices for agentic coding

anthropic.com

101–110 of 268 posts

Re: Claude Code: Best practices for agentic coding

#101

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…

If I have to spend this much time thinking about any of this, congratulations, you’ve designed a product with a terrible UI.

Mh. Like, I'm deeply impressed what these AI assistants can do by now. But, the list in the parent comment there is very similar to my mental check-list of pair-programming / pair-admin'ing with less experienced people.

I guess "context length" in AIs is what I intuitively tracked with people already. It can be a struggle to connect the Zabbix alert, the ticket and the situation on the system already, even if you don't track down all the zabbix code and scripts. And then we throw in Ansible configuring the thing, and then the business requriements by more, or less controlled dev-teams. And then you realize dev is controlled by impossible sales-terms.

These are scope -- or I guess context -- expansions that cause people to struggle.

Re: Claude Code: Best practices for agentic coding

#102

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…

My attempt is - Do not use Claude Code at all, it is terrible tool. It is bad at almost everything starting with making simple edits to files.

And most of all Claude Code is overeager to start messing with your code and run unnecessary $$ instead of making sensible plan.

This isn't problem with Claude Sonnet - it is fundamnetal problem with Claude Code.

Re: Claude Code: Best practices for agentic coding

#104

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…

If I have to spend this much time thinking about any of this, congratulations, you’ve designed a product with a terrible UI.

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"

Re: Claude Code: Best practices for agentic coding

#105

Earlier quoted context omitted.

Do you have a link to some of this output? A repo on Github of something you’ve done for fun? I get a lot of value out of LLMs but when I see people make claims like this I know they aren’t “in the trenches” of software development, or care so little about quality that I can’t relate to their experience. Usually they’re investors in some bullshit agentic coding tool though.

I will shortly; am building a serious self-compiling compiler rn out of an brand-new esoteric language. Meaning the LLM is able to program itself without training data about the programming language...

> a serious self-compiling compiler

Well, virtually every production-grade compiler is self-compiling. Since you bring it up explicitly, I'm wondering what implications of begin self-compiling you have in mind?

> Meaning the LLM is able to program itself without training data about the programming language...

Could you clarify this sentence a bit? Does it mean the LLM will code in this new language without training in it before hand? Or is it going to enable the LLM to programm itself to gain some new capabilities?

Frankly, with the advent of coding agents, building a new compiler sounds about as relevant as introducing a new flavor of assembly language and then a new assembly may at least be justified by a new CPU architecture...

Re: Claude Code: Best practices for agentic coding

#106
post #3

The most interesting part of this article for me was: > Have multiple checkouts of your repo I don’t know why this never occurred to me probably because it feels wrong to have multiple checkouts, but it makes sense so that you can keep each AI instance running at full speed. While LLM‘s are fast, this is one of the annoying parts of just waiting for an instance of Aider or Claude Code to finish something. Also, I had…

I've never used Claude Code or other CLI-based agents. I use Cursor a lot to pair program, letting the AI do the majority of the work but actively guiding. How do you keep tabs on multiple agents doing multiple things in a codebase? Is the end deliverable there a bunch of MRs to review later? Or is it a more YOLO approach of trusting the agents to write the code and deploy with no human in the loop?

Multiple terminal sessions. Well written prompts and CLAUDE.md files.

I like to start by describing the problem and having it do research into what it should do, writing to a markdown file, then get it to implement the changes. You can keep tabs on a few different tasks at a time and you don't need to approve Yolo mode for writes, to keep the cost down and the model going wild.

Re: Claude Code: Best practices for agentic coding

#108
post #102

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…

My attempt is - Do not use Claude Code at all, it is terrible tool. It is bad at almost everything starting with making simple edits to files. And most of all Claude Code is overeager to start messing with your code and run unnecessary $$ instead of making sensible plan. This isn't problem with Claude Sonnet - it is fundamnetal problem with Claude Code.

I pretty much one shot a scraper from an old Joomla site with 200+ articles to a new WP site, including all users and assets, and converting all the PDFs to articles. It cost me like $3 in tokens.

Re: Claude Code: Best practices for agentic coding

#109
post #68

Earlier quoted context omitted.

$100/day seems reasonable as an upper-percentile spend per programmer. $500/day sounds insane. A 2.5 hour session with Claude Code costs me somewhere between $15 and $20. Taking $20/2.5 hours as the estimate, $100 would buy me 12.5 hours of programming.

Asking very specific questions to Sonnet 3.7 costs a couple of tenths of a cent every time, and even if you're doing that all day it will never amount to more than maybe a dollar at the end of the day. On average, one line of, say, JavaScript represents around 7 tokens, which means there are around 140k lines of JS per million tokens. On Openrouter, Sonnet 3.7 costs are currently: - $3 / one million input tokens => $…

I can't edit the above comment, but there's obviously an error in the math! ;-) Doesn't change the point I was trying to make, but putting this here for the record.

33.3 million input tokens / 7 tokens per loc = 4.8 million locs

3.6 million output tokens / 7 tokens per loc = 515k locs

Re: Claude Code: Best practices for agentic coding

#110

Earlier quoted context omitted.

That's my point. - L3 SWE II - $193,712 USD (before overheads) - L4 SWE III - $297,124 USD (before overheads) - L5 Senior SWE - $377,797 USD (before overheads) These tools and foundational models get better every day, and right now, they enable Staff+ engineers and businesses to have less need for juniors. I suspect there will be [short-to-medium-term] compression. See extended thoughts at https://ghuntley.com/screwe…

I wonder what will happen first - will companies move to LLMs, or to programmers from abroad (because ultimately, it will be cheaper than using LLMs - you've said ~$500 per day, in Poland ~$1500 will be a good monthly wage - and that still will make us expensive! How about moving to India, then? Nigeria? LATAM countries?)

> in Poland ~$1500 will be a good monthly wage

The minimum wage in Poland is around USD 1240/month. The median wage in Poland is approximately USD 1648/month. Tech salaries are considerably higher than the median.

Idk, maybe for an intern software developer it's a good salary...

Post reply on HN