5 ms·
Author 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,
by diwank 1y ago
Author 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).
- davidmurdoch 1y agoWhy?
- peter422 1y agoJust to provide a contrast to some of the negative comments… As a very experienced engineer who uses LLMs sporadically* and not in any systematic way, I really appreciated seeing how you use them in production in a real project. I don’t know why people are being negative, you just mentioned your project in details where it was appropriate to talk about the structure of it. Doesn’t strike me as gratuitous self promotion at all. Your post is giving me motivation to empower the LLMs a little bit more in my workflows. *: They absolutely don’t get the keys to my projects but I have had great success with having them complete specific tasks.
- diwank 1y agoReally appreciate the kind words! I did not intend the post to be too much about our company, just that it is the codebase I mostly hack on. :)
- mafro 1y agoGreat post. I'm fairly new to the AI pair programming thing (I've been using Aider), but with 20 years of coding behind me I can see where things are going. You're dead right in the conclusion about now being the time to adopt this stuff as part of your flow -- if you haven't already. And regarding the HN post getting buried for a while there...[1] Somewhat ironic that an article about using AI to help write code would get canned for using an AI to help write it :D [1]: https://news.ycombinator.com/item?id=44214437 https://news.ycombinator.com/item?id=44214437
- kikimora 1y agoThanks for the great article, this is much needed to understand how to properly use LLM at scale. You mentioned that LLM should never touch tests. Then followed up with an example refactoring changing 500+ endpoints completed in 4 hours. This is impressive! I wonder if these 4 hours included test refactoring as well or it is just prompting time?
- diwank 1y agothat didn't include the testing, that def took a lot longer but at least now my devs don't have an excuse for poorly written tests lol
- localhost 1y agoDid you use Claude Code to write the post? I'm finding that I'm using it for 100% of my own writing because agentic editing of markdown files is so good (and miles better than what you get with claude.ai artifacts or chatgpt.com canvas). This is how you can do things like merge deep research or other files into the doc that you are writing.
- diwank 1y agono, just used chatgpt to bootstrap the research :) here's the original chat: https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8a3 https://chatgpt.com/share/6844eaae-07d0-8001-a7f7-e532d63bf8... I also used bits from claude research but apparently if you use claude research, they don't let you create a share link -_-
- localhost 1y agoRight. But you can copy paste that into a separate doc and have Claude Code merge it in (and not a literal merge - a semantic merge "integrate relevant parts of this research into this doc"). This is super powerful - try it!
- gavinray 1y agoDoes Claude Code perform any different than browser Claude for writing tasks? I recently wrote a long Markdown document, and asked Claude, ChatGPT, Grok, and Gemini to improve it. Comparing outputs, it was very close between Gemini and Claude, but I decided that Claude was slightly better-written.
- localhost 1y agoThe models are the same, but the actual prompts sent to the model are likely somewhat different because of the agentic loop - so I would imagine (without having done the experiments) there will be slight differences. Unclear whether they will be more or less than the variance in responses sent multiple times to the same experience (e.g., Claude.ai variance vs. Claude Code variance vs. variance between Claude.ai and Claude Code). Would be an interesting controlled experiment to try!
- r0b0ji 1y agoAt one place you mentioned, if a test is updated by AI, you reject the PR. How do you know if it was generated or updated by AI. From the article I only got that it's a git commit message convention to add that but that too is only at commit level.
- noufalibrahim 1y agoThere are a lot of posts around but this was very practical and gives me a system i can try to implement and perhaps improve. Much appreciated. Thanks for taking the time to write it. One thing I would have liked to know is the difference between a workflow like this and the use of aider. If you have any perspective on that, it would be great.
- diwank 1y agoThank you! aider is a different beast actually, I found its memory/context handling best in class. Somehow though, I ended up liking Claude Code the most because of its TUI but really a matter of personal preference and workflow
- panny 1y ago>Think of this post as your field guide to a new way of building software. By the time you finish reading, you’ll understand not just the how but the why behind AI-assisted development that actually works. Hi, AI skeptic with an open-mind here. How much will this cost me to try? I don't see that mentioned in your writeup.
- diwank 1y agoThere are a bunch of different options so it depends on the models you end up liking but the simplest place to start is to get Claude Max $100 tier and use Opus 4 (the others don’t really get you the full experience)
- mcv 1y agoI hear a lot of good stuff about Claude Code lately, but before, it was all about Copilot or Cursor. And some options are a lot cheaper than others. Is Claude Code so much better now? I admit I have no idea what the real differences are. Everybody seems to claim to be the best and most comprehensive AI coding solution.
- indigodaddy 1y agoIsn't Claude Code fully functional/available now on the $20 Pro monthly plan?
- diwank 1y agoIn my experience, you’ll run out of Opus usage credits way too quickly on the Pro plan