Claude Code: Optimize Your Implementations in One Try
Optimizing Claude Code for Efficient Implementations
Making Your Coding Agent More Efficient
Claude Code is extremely effective at converting natural language queries into functional code. If you ask simple questions or request basic implementations, Claude Code usually succeeds in doing this in one go, without you needing to make additional queries or tests to ensure everything works as expected. However, when you start asking for more complex tasks and implementations, Claude Code struggles to deliver these implementations in one shot.
In these cases, you often have to spend a lot of time testing Claude Code's implementation, evaluating its effectiveness, and checking if it aligns with your preferences. When you notice discrepancies, you need to ask Claude Code to correct them, ensure it fully understands your intent, and continue this process until the implementation is exactly as you want it.
This infographic highlights the main points of this article and discusses how to make your Claude Code more efficient for achieving one-shot implementations using three specific techniques.
Why Aim for One-Shot Implementations with Claude Code
First, it is important to explain why it is worth aiming for more one-shot implementations with Claude Code. The main reason is that a one-shot implementation saves you time. Instead of having to test and iterate on implementations with Claude Code, which is a very time-consuming process, you simply get the fully ready implementation immediately.
Thus, the primary reason you want to do this is simply to save time. This gives you more time to perform other implementations, fix bugs, or, in general, work on other tasks, which in turn makes you even more efficient. The efficiency with which you can implement solutions is the most critical factor in assessing your skills as an engineer.
How to Improve Claude Code for One-Shot Implementations
This section covers a few techniques used daily to make an instance of Claude Code more capable of handling one-shot implementations. The focus is on the exact techniques used for personal use cases. Of course, this may not apply exactly to every use case. However, it is possible to generalize these techniques and try to apply them to specific application areas.
Discussing Your Implementation with an LLM
The first piece of advice offered is based on aligning your implementation idea with that of the LLM. What you want to implement is, of course, a thought you have in mind and not something very concrete. Converting that into code is somewhat of a challenge, as there may be ambiguous elements in your thought or other factors that are not entirely clear. Therefore, it is crucial to discuss with an LLM what you are trying to implement, clarify anything that is vague, and ensure the LLM understands exactly what it needs to implement.
Before you start implementing anything, you should generally have a thorough discussion with an LLM about:
- What you are exactly trying to implement
- What you need to consider during the implementation
- What context is necessary for an effective implementation
This conversation can be had several times for one's own implementations.
If something that requires a lot of online research is being implemented, an initial discussion with Gemini Deep Research Pro Mode is usually held. In the user's opinion, Gemini is the best online research agent and the one that gives the best results. The discussion with Gemini produces a final product, whether a report or a plan for what is to be implemented, including everything to consider during the implementation, and this is passed on to the coding agent, which is currently Claude Code, but could of course be any coding agent of choice.
Le brief IA que les pros lisent chaque soir
Les 7 actus IA du jour, décryptées en 5 min. Gratuit.
Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.
Choisissez votre rythme
Gratuit · Pas de spam · Désabonnement en 1 clic
In other cases, the planning mode in Claude Code is simply used, with a direct discussion with Claude about what should be done and how it should be done. During planning, the model is explicitly instructed to ask questions when something is vague or ambiguous. This makes the model more likely to ask questions when it needs more context, which helps to better align with the coding agent exactly what is being implemented.
Note that Claude Code can also perform online research, so you could, in theory, have it do that if you also want to search the web.
Granting Testing Permissions to the LLM
Once the LLM has a very clear plan, developed in the previous section, it is now time for the LLM to implement the plan it created with you.
When the LLM carries out this implementation, it usually takes quite a bit of time, as you are using the best LLMs, which are often slower. Since the implementation takes time, it is crucial to make the LLM autonomous and capable of testing its own implementation before coming back to you. This will save you a lot of time, as the LLM can test its own work instead of asking you to test it.
To set this up, you need to give your LLM access to the browser. The way to do this varies depending on the IDs or CLIs you are using for coding. However, in Claude Code, you can launch it with dash-dash Chrome and install the Playwright MCP.
This gives Claude Code access to the browser, and the Playwright MCP is a very powerful tool for enhancing Claude Code's browser usage. This sacrifices a bit of speed for quality, but overall, it is a worthwhile trade-off in coding. Using faster but lower-quality models does not actually increase speed, as it simply makes the implementations worse, and you have to do more iterations, which, in the long run, takes more time.
Retaining Your Preferences
The final piece of advice concerns retaining your preferences from previous sessions. The initial sessions you have with Claude Code will be less efficient because Claude Code does not fully understand your preferences and how you like the code. Therefore, it is crucial that after each session with Claude Code, you have it memorize what it learned from the session, the key points it would have liked to know before the session, and if it were to start a new session, it would appreciate having that knowledge.
There are several ways to achieve this. A generalized knowledge command can be run after each session with Claude Code, where it stores relevant knowledge about the project in the claude.md file of the project and relevant knowledge about the user in the claude.md file at the user level.
Claude is judged to be very good at determining what content should be stored in which file, and it is generally trusted to store relevant user knowledge in the user file and project knowledge in the project file. It is as good as the user at determining where the content should be stored.
If you do this after each session, subsequent sessions will be more efficient because Claude Code will automatically better understand your intent and preferences and will adjust its implementations accordingly.
If you have a specific preference for frontend style, you won’t need to ask how to design the frontend of the website. It can simply read the claude.md file describing your preference and implement it immediately without needing to ask clarifying questions or even having to implement something first. Thus, the user will not be dissatisfied with the implementation and will not need to re-implement elements.
By applying these techniques, you can transform Claude Code into a more powerful tool, capable of achieving one-shot implementations, thereby increasing your productivity and efficiency as a developer.
Brief IA — L'actualité IA en français
L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.