6 ms·
Field Notes from Shipping Real Code with Claude
- indigodaddy 1y agoCan anyone recommend a specific YouTube video that really shows how to use Claude Code effectively in your workflow?
- kasey_junk 1y agoOne of the exciting things to me about the ai agents is how they push and allow you to build processes that we’ve always known were important but were frequently not prioritized in the face of shipping the system. You can use how uncomfortable you are with the ai doing something as a signal that you need to invest in systematic verification of that something. As a for instance in the link, the team could build a system for verifying and validating their data migrations. That would move a whole class of changes into the ai relm. This is usually much easier to quantify and explain externally than nebulous talk about tech debt in that system.
- diwank 1y agoFor sure. Another interesting trick I found to be surprisingly effective is to ask Claude Code to “Look around the codebase, and if something is confusing, or weird/counterintuitive — drop a AIDEV-QUESTION: … comment so I can document that bit of code and/or improve it”. We found some really gnarly things that had been forgotten in the codebase.
- tinodb 1y agoBut why stick with the AIDEV- style? I mean, this is what comments are for: explaining the why that can’t be read from code. You could just make it a regular comment, right?
- diwank 1y agoyup but: 1. AIDEV-* is easier to visually distinguish, and 2. it is grep-able by the models, so they can "look around" the codebase in one glance
- theptip 1y agoAgreed, my hunch is that you might use higher abstraction-level validation tools like acceptance and property tests, or even formal verification, as the relative cost of boilerplate decreases.
- bitwize 1y ago[flagged]
- sdorf 1y agoThe whole point seems to be how to get the most out of today's tooling without "glue getting in your pizza". It's a little flag-wavy (probably because of the author's company) but overall seemed like a pretty candid peek into how it's being used. Did you have a specific critique?
- diwank 1y agoFeedback appreciated! Will tone it down; did not intend it to be too much about our company, just that it is the codebase I mostly hack on. :)
- diwank 1y agoAuthor here: To be honest, I know there are like a bajillion Claude code posts out there these days. But, there are a few nuggets we figured are worth sharing, like Anchor Comments [1], which have really made a difference: —— # CLAUDE.md ### Anchor comments Add specially formatted comments throughout the codebase, where appropriate, for yourself as inline knowledge that can be easily `grep`ped for. - Use `AIDEV-NOTE:`, `AIDEV-TODO:`, or `AIDEV-QUESTION:` as prefix as appropriate. - *Important:* Before scanning files, always first try to grep for existing `AIDEV-…`. - Update relevant anchors, after finishing any task. - Make sure to add relevant anchor comments, whenever a file or piece of code is: * too complex, or * very important, or * could have a bug —— [1]: https://diwank.space/field-notes-from-shipping-real-code-with-claude#:~:text=actual%20snippet%20from%20our%20project%E2%80%99s%20CLAUDE.md https://diwank.space/field-notes-from-shipping-real-code-wit...
- meeech 1y agoQ: How do you ensure tests are only written by humans? Basically just the honor system?
- diwank 1y agoYou can: 1. Add instructions in CLAUDE.md to not touch tests. 2. Disallow the Edit tool for test directories in the project’s .claude/settings.json file
- meeech 1y agoDisallow edit in test dirs is a good tip. thanks. I meant though in the wider context of the team - everyone uses it but not everyone will work the same, use the same underlying prompts as they work. So how do you ensure everyone keeps to that agreement?
- mathgeek 1y ago> So how do you ensure everyone keeps to that agreement? There's nothing specific to using Claude or any other automation tool here. You still use code reviews, linters, etc. to catch anything that isn't following the team norms and expectations. Either that or, as the article points out, someone will cause an incident and may be looking for a new role (or nothing bad happens and no one is the wiser).
- meeech 1y agoHonest question: approx what percent of the post was human vs machine written?
- diwank 1y agoI’d say around ~40% me, the ideating, editing, citations, and images are all mine; rest Opus 4 :) I typically try to also include the original Claude chat’s link in the post but it seems like Claude doesn’t allow sharing chats with deep research used in them. Update: here’s an older chatgpt conversation while preparing this: https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8a3 https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8...
- GiorgioG 1y ago[flagged]
- diwank 1y agoI don’t understand why not. I’m not a natural prose writer, but (I felt that) these ideas were worth putting out there. I posted on HN largely to get feedback.
- climb_stealth 1y agoJust want to say that I appreciate you sharing all that and being open about it. As someone who has mostly ignored the AI progression it is interesting to see. And a bit bewildering.
- malnourish 1y agoYou used your tools well. The times are adapting and it's best we get on with it. It's the only way we can discover another step-change. I use AI to help craft technical messages to different audiences and get various perspectives on my ideas and questions. It's a tool that's given me more insight into other perspectives than anything else, and it's helped me make some excellent slides. Executives and senior leadership really need things at different levels. They are abstracting domains like we extract functions. Then there are the technical leaders, who this speaks to. I shared this article with my VP and peers. I expect it will be too much for some, but it remains approachable. It's not all roses though, I tried using various LLMs to help me draft a personal message and it left me feeling remarkably conflicted. It was my message, but it lost my voice, even when just used to reach my niece's "audience" . I haven't found out how to use it and still allow for my creative emotional expression. I don't use it for emails, because it still feels professionally dishonest for me; for some reason, presentations don't. I'm bad at them and it helps. One more thing: I instruct LLMs to not let me meander like this.
- djrockstar1 1y ago[flagged]
- diwank 1y agoI’d say around ~40% me, the ideating, editing, citations, and images are all mine; rest Opus 4 :) I typically try to also include the original Claude chat’s link in the post but it seems like Claude doesn’t allow sharing chats with deep research used in them. See this series of posts for example, I have included the link right at the beginning: https://diwank.space/juleps-vision-levels-of-intelligence-pt-1/6#:~:text=You%20can%20also%20read%20the%20conversation%20I%20had https://diwank.space/juleps-vision-levels-of-intelligence-pt... I completely get the critique and I already talked about it earlier: https://news.ycombinator.com/item?id=44213823 https://news.ycombinator.com/item?id=44213823 Update: here’s an older chatgpt conversation while preparing this: https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8a3 https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8...
- GiorgioG 1y ago[flagged]
- Artoooooor 1y agoI finally decided few days ago to try this Claude Code thing in my personal project. It's depressingly efficient. And damn expensive - I used over 10 dollars in one day. But I'm afraid it is inevitable - I will have to pay tax to AI overlords just to be able to keep my job.
- Syzygies 1y agoI was looking at $2,000 a year and climbing, before Anthropic announce $100 and $200 Max subscriptions that bundled Claude Console and Claude Code. There are limits per five hour windows, but one can toggle back to metered API with the login/ command, or just walk the dog. $100 a month has done me fine.
- diwank 1y agoSame. I ran out on the $200 one too yesterday. It’s skyrocketed after Opus 4. Nothing else comes close
- StefanBatory 1y agoI had been musing over this. Will devs in very cheap countries still stay an attractive option, just because they'd be still cheaper monthly than Claude.
- diwank 1y agothe cost per token for ~similar performance is dropping by a factor of 2 every 10-11 months at the moment, so I am not sure. that said, I think devs in less expensive parts of the world are actually picking up these tools the fastest (maybe from existential angst? idk)
- deadbabe 1y agoWe’ve stopped hiring devs in cheaper countries because their quality of output isn’t much more than LLMs, but LLMs are faster and cheaper. Since we don’t really trust cheap devs to ship big important features, the market for the kind of work we allowed them to do has been totally consumed by LLMs.
- wonger_ 1y agoSome thoughts: - Is there a more elegant way to organize the prompts/specifications for LLMs in a codebase? I feel like CLAUDE.md, SPEC.mds, and AIDEV comments would get messy quickly. - What is the definition of "vibe-coding" these days? I thought it refers to the original Karpathy quote, like cowboy mode, where you accept all diffs and hardly look at code. But now it seems that "vibe-coding" is catch-all clickbait for any LLM workflow. (Tbf, this title "shipping real code with Claude" is fine) - Do you obfuscate any code before sending it to someone's LLM?
- diwank 1y ago> - Is there a more elegant way to organize the prompts/specifications for LLMs in a codebase? I feel like CLAUDE.md, SPEC.mds, and AIDEV comments would get messy quickly. Yeah, the comments do start to pile up. I’m working on a vscode extension that automatically turns them into tiny visual indicators in the gutter instead. > - What is the definition of "vibe-coding" these days? I thought it refers to the original Karpathy quote, like cowboy mode, where you accept all diffs and hardly look at code. But now it seems that "vibe-coding" is catch-all clickbait for any LLM workflow. (Tbf, this title "shipping real code with Claude" is fine) Depends on who you ask ig. For me, hasn’t been a panacea, and I’ve often run into issues (3.7 sonnet and codex have had ~60% success for me but Opus 4 is actually v good) > - Do you obfuscate any code before sending it to someone's LLM? In this case, all of it was open source to begin with but good point to think about.
- jstummbillig 1y agoIs it really though, when a lot of critical business data goes through Google workspace (usually without client side encryption), or are we trying very hard to be a bit special in the name of privacy? From a result standpoint I find curious how interesting people deem their code base to be to a LLM provider.
- diwank 1y agotrue but this does matter to a lot of enterprise customers that have to obey strict data provenance laws (for instance, there are no gpt-4.1 model endpoints hosted in India and hence, fin-tech companies cannot use those apis)
- lispisok 1y agoI think most of this is good stuff but I disagree with not letting Claude touch tests or migrations at all. Handing writing tests from scratch is the part I hate the most. Having an LLM do a first pass on tests which I add to and adjust as I see fit has been a big boon on the testing front. It seems the difference between me and the author is I believe whether code was generated by an LLM or not the human still takes ownership and responsibility. Not letting Claude touch tests and migrations is saying you rightfully dont trust Claude but are giving ownership to Claude for Claude generated code. That or he doesn't trust his employees to not blindly accept AI slop, the strict rules around tests and migrations is to prevent the AI slop from breaking everything or causing data loss.
- diwank 1y agoTrue but, in my experience, a few major pitfalls that happened: 1. We ran into really bad minefields when we tried to come back to manually edit the generated tests later on. Claude tended to mock everything because it didn’t have context about how we run services, build environments, etc. 2. And this was the worst, all of the devs on the team including me got realllyy lazy with testing. Bugs in production significantly increased.
- jaakl 1y agoDid you try to put all this (complex and external) context to the context (claude.md or whatever), with intructions how to do proper TDD, before asking for the tests? I know that may be more work than actual coding it as you know all it by heart and external world is always bigger than internal one. But in long term and with teams/codebases with no good TDD practises that might end up with useful test iterations. Of course developer commiting the code is anyway responsible for it, so what I would ban is putting “AI did it” to the commits - it may mentally work as “get out of jail card” attempt for some.
- diwank 1y agowe tried a few different variations but tbh had universally bad results. for example, we use `ward` test runner in our python codebase, and claude sonnet (both 3.7 and 4) keep trying to force-switch it to pytest lol. every. single. time. maybe we could either try this with opus 4 and hope that cheaper models catch up, or just drink the kool-aid and switch to pytest...
- nilirl 1y agoLot of visual noise because of model specific comments. Or maybe that's just the examples here. But as a human, I do like the CLAUDE.md file. It's like documentation for dev reasoning and choices. I like that. Is this faster than old style codebases but with developers having the LLM chat open as they work? Seems like this ups the learning curve. The code here doesn't look very approachable.
- skerit 1y agoVery interesting, I'm going to use some of these ideas in my CLAUDE.md file. > One of the most counterintuitive lessons in AI-assisted development is that being stingy with context to save tokens actually costs you more Something similar I've been thinking about recently: For bigger projects & more complicated code, I really do notice a big difference between Claude Opus and Claude Sonnet. And Sonnet sometimes just wastes so much time on ideas that never pan out, or make things worse. So I wonder: wouldn't it make more sense for Anthropic to not differentiate between Opus and Sonnet for people with a Max subscription? It seems like Sonnet takes 10-20 turns what Opus can do in 2 or 3, so in the end forcing people over to Sonnet would ultimately cost them more.
- diwank 1y agoyeah, the max subscription comes in two tiers, $100 gets you 5x the tokens than pro (which only has sonent) and the $200 gets you 20x. doing the math for tokens is kinda annoying and not straightforward atm. they also have a "hybrid" mode which uses opus until ~20% tokens for opus left then switches to sonnet
- dkobia 1y agoThank you for writing this. Many software developers on HN are conflicted about ceding control of software development to LLMs for many reasons including the fact that it feels unstructured and exploratory rather than rigidly planned using more formal methodologies. There's a good middle ground where the LLMs can help us solve problems faster optimizing for outcomes rather than falling in love with solving the problem. Many of us usually lose sight of the actual goal we're trying to achieve when we get distracted by implementation details.
- diwank 1y agoabsolutely! I think of these as new levers in the making, rather rusty, and def can often bite you in the behind but worth learning, and perhaps most importantly to help evolve them into useful tools rather than an excuse to ship sloppy engineering
- nxobject 1y agoAs I read (and appreciate) your documentation tips, I don’t even think they have to be labeled as AI-specific! ‘CLAUDE.md’ seems likely it could just as be ‘CONVENTIONS.md’, and comments to ‘AI’ could just as be comments to ‘READER’. :) Certainly I would appreciate comments like that when reading _any_ codebase, especially as an unfamiliar contributor.
- SatvikBeri 1y agoNot the OP, but in practice, the comments that tend to help Claude tend to be very different from what helps humans. With humans, I'll generally focus on the why. Our style guide for humans is about 100 lines long, with lines like "Add a ! to the end of a function name if and only if it mutates one of its inputs". Our style guide for Claude is ~500 lines long, and equivalent sections have to include many examples like "do this, don't do this" to work.
- __mharrison__ 1y agoI just tried this out with aider. It worked great. Vibe coded a PDF viewer with drawing capabilities in 30 minutes while waiting for a plane...
- remram 1y agoThe 2.3 MB picture at the top loaded comically slowly even on wifi.
- diwank 1y agoCompressed it. Thanks for letting me know :)
- mgraczyk 1y agoGood post, the only part I think I disagree with is > Never. Let. AI. Write. Your. Tests. AI writes all of my tests now, but I review them all carefully. Especially for new code, you have to let the AI write tests if you want it to work autonomously. I explicitly instruct the AI to write tests and make sure they pass before stopping. I usually review these tests while the AI is implementing the code to make sure they make sense and cover important cases. I add more cases if they are inadequate.
- diwank 1y agoThe risk, in my experience, is to reach a state where you as the dev is not easily able to understand/update the tests. That becomes very tricky
- m_kos 1y agoGood read – I have learned something new. I have been having a horrible experience with Sonnet 4 via Cursor and Web. It keeps cutting corners and misreporting what it did. These are not hallucinations. Threatening it with deletion (inspired by Anthropic's report) only makes things worse. It also pathologically lies about non-programming things. I tried reporting it but the mobile app says "Something went wrong. Please try again later." Very bizarre. Am I the only person experiencing these issues? Many here seem to adore Claude.
- threeseed 1y agoRoutinely had every one of these issues. I find it's much better just to use Claude Web and be extremely specific about what I need it to do. And even then half the code it generates for me is riddled with errors.
- j_crick 1y agoI think they might have cut its brains too much in the latest updates. I remember versions 3.5 doing okay on my simple tasks like text analysis or summaries or little writing prompts. In 4+ versions the thing just can't follow instructions within a single context window for more than 3-4 replies. When prompted about "why do you keep rambling if I asked you to stay concise" it says that its default settings are overriding its behavior and explicit user instructions, ditto for actively avoiding information that it considers "harmful". After pointing out inconsistencies and omissions in its replies it concedes that its behavior is unreliable and even extrapolates that it is made this way so users keep engaging with it for longer and more often. Maybe it got too smart to its detriment, but if yes then it's really sad what Anthropic did to it.
- wredcoll 1y agoWhat's the difference between "sonnet 4 via cursor" and claude code?
- linsomniac 1y ago"Sonnet 4" is the model, "cursor" is the IDE. "Claude Code" is another IDE, a TUI with a chat interface. Cursor is a VSCode fork with an AI panel in it.
- __mharrison__ 1y agoThanks for the post. It's very interesting time navigating the nascent field of AI assisted development. Curious if the author (or others) tried other tools / models.
- diwank 1y agoHave tried everything under the sun at the moment— broadly just two winners (and both have become my daily drivers for different use cases): 1. Claude Code with Opus 4 2. Cursor with Opus 4 or Gemini 2.5 Pro (Windsurf used to be an option but Anthropic has now cut them out) 3. (Coming up; still playing around) Claude Code’s GitHub Action
- deleted 1y ago[deleted]