My Claude best practices (so far)

My Claude best practices (so far)

by: Manuel 6 min read 0 comments

Like everyone I've been using AI and especially Claude for a few months. It's great and, although it is expensive to be genuinely useful, I developed over time some internal rules and "best practices" that I see that generate the best results.

These are my techniques that I developed by trial and error, but also by trying stuff that I see online and failing.

Note

I mention Claude in this article since it's the tool I use but you use these suggestions with any other tools that you use and they will, theoretically, work.

I thought this is the best place to document them, so I'll add and remove things over time as I find better techniques.

You don't always need the smartest model

Claude comes in several models. Fable is the most capable, Opus sits in the middle, and Sonnet is the fastest and cheapest. This is common sense, but using Fable for everything that you do is a waste of resources. Think of having a PhD validating your text for typos. Doesn't make sense. So adjust to the need that you have.

There are a lot more examples, but these are the ones that come to mind.

Planning

Fable for planning and defining the tasks that need to be done. I have my todo list checked by Fable and for each task I plan, organize and update the tasks.

Implementation

Opus to do the actual work.

Since the strategy is defined by the best model then Opus can have clear guidelines on how to implement things and since it's quite smart can generate decent code.

This is a great way to have Fable level implementation at a fraction of the cost, and therefore not reaching your daily limits as fast (or at all). A token is a chunk of text, roughly a short word, and your plan caps how many you can use per day.

Typos

Sonnet is great at this. For example, after writing an article I point Claude to it and ask it to find typos. We don't need a super smart model to fix typos so this model, which costs a fraction as much per token, can do the job quite nicely. Again more savings, especially if we don't have huge quotas.

Inconsistencies

I like to ask the agent to look at the articles or code and "find things that don't make sense". I keep "doesn't make sense" generic so that the model can have some liberty coming up with stuff. Sometimes it misses, sometimes it's useful, but it's a good exercise.

For this it depends a lot on the type of complexity. If you're pointing this at code, probably using a smarter model would be better, but if you're doing this in an article then a Sonnet or Opus is enough.

"Don't make mistakes" and better prompts

I should not need to write this but here we are. This is THE MOST suggested tip to add to Claude's instructions and it's quite useless. Anthropic even jokes about it in their presentations.

Writing "don't make mistakes" in the prompt does very little, and there are a lot of better things to write.

Here are some guidelines that helped me a lot:

  1. Clear and direct instructions - don't leave space for ambiguity unless you want to (my "find inconsistencies" example above, for instance). Ambiguity will let the agent go in one direction that may not be the one you want.
  2. Curate the information - Models all become "dumber" when the context increases, so providing a lot of information doesn't help at all. Curate the information that you provide it to the task at hand.
  3. One task per session - Still related with the ones above, provide the context needed for each of the tasks. The session forgetting the information can be used to your benefit, especially because of the "dumber" problem.
  4. Tell the objective - Describe to the model what you're trying to achieve gets the best results. The model knows what you're trying to achieve so it guides the implementation in that direction.

There are a lot more, but let's keep things simple for now.

Tell it what not to do

When I see Claude doing things that I don't like I store it in CLAUDE.md, a file in your project that Claude reads at the start of every session. It allows for the context to be clear in the next sessions. There are more advanced solutions like hooks for example, which run a script automatically when Claude does something, but simple is always better.

When you see something that you don't like ask Claude not to do it again, explain why and ask it to put that in CLAUDE.md.

Telling why is important. It will do 2 things. It will allow it to fix in the session the mistake and provide context so that it knows the next time it's opened.

Although we don't want to have CLAUDE.md too big, repeating mistakes between sessions is a waste of effort, so find your balance.

One prompt is not magic

"I prompted this and got X". I'm sure that you see these posts all the time and this is as useful as "eat X and you will lose weight" or "give me 5 minutes and I'll change your life".

Things simply don't work that way. There's no single shortcut, so ignore those posts and that advice.

Learning, adjusting and trying are the only things that actually work, which leads me to my next one.

Focus on your process, not someone else's

Notice that I'm giving you "best practices" that work for me but things could work differently for you. The idea is always the same. Start with your process, iterate, measure and then adapt.

I see things like "spec-driven development" that use a large number of tokens and generate a lot of documents to end up with a complex implementation. They are trying to get you started and have "one prompt" that can implement whole feature sets. That works for some people. If it is not working for you, build your own process instead.

Like I mentioned before, small tasks per session generate the best results.

Focus on your own process. I would recommend:

  1. Start with a small task
  2. Run it via Claude using the prompt tips that I mentioned
  3. Check what's wrong and tell it what not to do.
  4. Continue until it's done properly.
  5. Try again with another task.

Break things down into pieces. In the end if Claude does 100 things how can you validate if they are done properly?

This iterative process only works for you because your process is different from anyone else's. In the end Claude needs to adjust to you not the other way around.

Final Thoughts

Like I mentioned this is not an exhaustive list, but I'll add stuff over time.

Also there are a lot of things that advanced users use like hooks (mentioned before), skills, sub-agents, etc, but I want to keep things simple. Strategy is king, so starting small and improving takes you a long way.

If you have other experiences please comment or reach out and I'll be happy to feature them here and learn from you.

Photo by Jeremy Beck on Unsplash

Comments

Spotted a mistake or have a better approach? Let me know. I read and reply to every one.

💬

No comments yet

Be the first to share your thoughts on this article!

Leave a Comment

All comments are reviewed for spam before being displayed 5000 left
Replying to