The Explore → Plan → Code → Commit workflow in Claude Code

Claude www.youtube.com

Brief Summary

This video explains how to effectively use Claude for coding by following the "explore, plan, code, and commit" workflow. It emphasizes the importance of using plan mode to gather research and create a plan of action before writing any code. The video also covers how to provide Claude with the right tools and context, such as a test suite and the Claude and Chrome extension, to help it complete its goals. Finally, it provides tips on testing, reviewing, and committing code with Claude's assistance.

  • Follow the "explore, plan, code, and commit" workflow.
  • Use plan mode to gather research and create a plan of action before writing any code.
  • Provide Claude with the right tools and context, such as a test suite and the Claude and Chrome extension.
  • Test, review, and commit code with Claude's assistance.

Explore, Plan, Code, and Commit Workflow

The most effective way to use Claude for coding is to follow the workflow: explore, plan, code, and commit. Many users directly ask Claude to write code, which often leads to more corrections later. The explore phase helps Claude gather relevant context about the project. The plan phase involves creating a detailed plan of action that Claude can use to determine if it is successful. The code phase is the iterative process of collaboration between the user and Claude to achieve the final outcomes of the plan. Finally, the commit phase involves reviewing and pushing the code to start working on the next feature.

Plan Mode for Research and Planning

Plan mode is the fastest way to handle the explore and plan phases. In plan mode, Claude can read files to gather research but cannot edit them. To enter plan mode, use shift and tab until you see the plan mode option. For example, you can ask Claude to add WebP conversion to an image upload pipeline, figure out where it should happen, identify necessary dependencies, and determine the best approach. Claude will then read relevant files, conduct web searches, and provide a plan of action. Review the plan to ensure it meets your criteria and revise it as needed. Correcting the plan at this stage is more efficient because no code has been written yet. You can also use explore without being in plan mode by simply asking Claude to explore your codebase.

Approving and Guiding the Plan

Once the plan looks good, you can approve it to allow Claude to proceed. Claude can automatically accept file edits or ask for approval each time. Claude will attempt to troubleshoot the codebase before finalizing the plan, but sometimes course correction is necessary. The benefit of using plan mode is that you have the context of how Claude arrived at its results, which helps guide its next decision. To ensure Claude is confident in its results, be explicit about what you consider correct when writing your plan.

Adding Tools and Context for Better Results

Adding tools that help Claude complete its goals reduces back-and-forth communication. For web UI development, use the Claude and Chrome extension so Claude can control a tab and test the UI before finishing. Include a test suite in your project that Claude can continuously validate. Claude can also write tests for you. Ensure the tests are a reliable source of truth for your team to avoid false positives. If Claude repeatedly encounters the same issues, ask it to save the solution to a Claude MD file.

Testing, Reviewing, and Committing Code

After testing and confirming that you are satisfied with the results, it is time to push your code. Before committing, use a sub-agent code reviewer to examine your code. Then, have Claude generate a commit message in your preferred style. Repeat this process for each feature.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the App Store
Get it on Google Play

Transcript

Full transcript of “The Explore → Plan → Code → Commit workflow in Claude Code”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:03 If you take one thing away from Claude code, let it be this workflow: explore, plan, code, and commit. Without this, most people jump straight to pasting in Claude to write code, which means more course correcting later on. The fastest way to handle step one and two is with plan mode. With plan mode, Claude can't edit files. It just reads files to gather research on how to tackle this implementation. To enter plan mode, hit shift and tab until you see the plan mode under the text input. I need to add WebP conversion to our image upload pipeline. Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it. And Claude will read relevant files, do some web searches, and give you a plan

0:49 of action. Make sure you review it and determine if it meets your criteria. Otherwise, I can ask it to add on or revise some areas. Perfect. And this right here is the best place to course correct because it's before any code is written. You can also use explore without being in plan mode by just asking Claude to explore your code base. Now, once the plan looks good, you can select approve to accept the plan and let Claude toggle all of the list items it provided. You can determine if you want Claude to auto accept the file edits or ask every single time. Claude will do its best to troubleshoot your code base before considering the plan finished. But at times, you'll need to course correct. This is the benefit of working with plan mode because after the plan is finished, we also have the

1:34 context of how it got to the results to help it guide its next decision. In order for Claude to be confident in its results, it has to be clear on what it deems correct. When writing your plan, make this explicit. Adding tools that will help Claude complete its goals will remove a lot of back and forth. For example, if you're building web UIs, make sure you have the Claude and Chrome extension so that Claude code can control a tab and test out the UI before deeming it finished. In your project, include a test suite that Claude can continuously validate on. Claude can even write tests for you. Before passing this off to Claude, make sure that the tests are a source of truth for you and your team to avoid any false positives. Quick tip, if you find Claude keeps running into the same issues, ask Claude

2:21 to save the solution to his Claude MD file. Now, once you have tested for yourself and are happy with the results, it's time to push your code. A tip before you commit, run a sub agent code reviewer to look at your code. Then you get Claude to generate a commit message for you in your style. Rinse and repeat. >> [music] >> If you want to be effective with Claude code, follow the explore, plan, code, and commit workflow. Exploration will give the relevant context Claude needs for your project. Plan will create a plan of action that Claude will use to determine if they are successful. Code is the back and forth that you and Claude do before settling on the final outcomes of the plan. Commit helps you review and push your code so you can start on your next feature.

Share

More video summaries