CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 7 · Lesson 37/38

    Explore, plan, implement, commit: the Claude Code loop

    Improve developer workflows using AI-assisted tooling

    13 min read
    2.33% of exam
    4 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Run a Claude Code task as four separate phases (explore, plan, implement, commit) and say why research and planning come before any code is written
    • Choose the permission mode that matches how much the task should be allowed to change without your approval
    • Write prompts that point Claude at exact files, sources and symptoms instead of describing them loosely
    • Keep a session clean by interrupting, rewinding, clearing and delegating research to subagents
    • Give Claude a check it can run (a test, a screenshot or a build) so it can verify its own work

    Key concept

    Explore, plan, implement, commit — A Claude Code workflow that keeps reading and planning apart from editing. Claude first learns the relevant code, then proposes a plan you can review, and only after that writes, tests and commits the change.

    1.Explore, plan, implement, commit

    Claude Code is an agent. It reads files, runs shell commands, edits code and uses git in your project, so a vague request such as "add Google OAuth" can turn straight into edits across a codebase it has not read yet. The explore, plan, implement, commit loop prevents that. Each phase is its own prompt, and no code is written until Claude understands the existing code and you have agreed on a plan.

    The four phases as separate prompts, using an OAuth feature as the exampletext
    Explore
    
    read /src/auth and understand how we handle sessions and login.
    also look at how we manage environment variables for secrets.
    
    Plan
    
    I want to add Google OAuth. What files need to change?
    What's the session flow? Create a plan.
    
    Implement
    
    implement the OAuth flow from your plan. write tests for the
    callback handler, run the test suite and fix any failures.
    
    Commit
    
    commit with a descriptive message and open a PR

    Explore asks Claude to read and explain, and nothing else. Plan asks which files will change and how the flow will work, and the answer is something you can review and correct while correcting it costs nothing. Implement refers back to "your plan" and includes its own check: write tests, run the suite, fix the failures. Commit turns the finished work into a commit and a pull request.

    Plan mode makes the first two phases safe. If you start a session with claude --permission-mode plan, Claude can investigate and propose changes but cannot write to your source files. You review the proposal and then leave plan mode to implement it, so nothing reaches disk until you have seen the plan.

    Checkpoint 1 of 7· Fill the gap

    In the four-phase OAuth example, the Implement prompt ties the work back to an earlier phase. Which word completes it?

    Explore
    
    read /src/auth and understand how we handle sessions and login.
    also look at how we manage environment variables for secrets.
    
    Plan
    
    I want to add Google OAuth. What files need to change?
    What's the session flow? Create a plan.
    
    Implement
    
    implement the OAuth flow from your  ? . write tests for the
    callback handler, run the test suite and fix any failures.
    
    Commit
    
    commit with a descriptive message and open a PR

    Checkpoint 2 of 7· Check yourself

    You want Claude to investigate a codebase and propose a change for you to review. Nothing should be written to your source files until you have seen the proposal. How should you start the session?

    Sources12

    2.Matching the permission mode to the task

    The permission mode sets which actions Claude takes on its own and which ones wait for you. Choosing a mode is a workflow decision. Exploring an unfamiliar repo, reviewing untrusted code and doing a routine refactor each need a different amount of freedom.

    Permission modes compared by what runs without your approval
    ModeRuns without askingWaits for youBest for
    Manual (the default prompting mode)Reading and searchingEvery file edit and every shell commandUntrusted code, such as an external contributor's pull request
    Accept editsFile edits and common filesystem commands like mkdir and mvOther shell commandsImplementation work where you trust the edits but want to see commands
    PlanExploration only; source files are not editedLeaving plan mode to implementThe explore and plan phases
    AutoMost actions; a background classifier blocks the risky onesNothing routine, because the classifier decides instead of asking youLong sessions where prompting on every step would slow you down

    Take a security engineer reviewing a pull request from outside the team. Claude should read the files and run analysis, but every edit and every command needs the engineer's approval first. Manual is the only mode in the table that meets this. Accept edits would apply file changes without asking. Auto would let a classifier approve most actions. Plan blocks edits, but it is a mode for proposing changes, not for approving them one at a time. bypassPermissions goes further than any of these and drops the prompts entirely. It is not even in the normal Shift+Tab cycle until you start Claude Code with --allow-dangerously-skip-permissions. In recent versions of Claude Code, Auto is the built-in starting mode for interactive sessions, so you switch to Manual deliberately when you need it.

    Between these modes, permission allowlists let you pre-approve individual commands you know are safe, such as npm run lint or git commit. Claude then stops asking about those commands while still asking about everything else. Pre-approving a few specific commands is safer than switching the whole session to a more permissive mode.

    Checkpoint 3 of 7· Match them up

    Match each permission mode to the task it suits best.

    Tap a term, then the definition that fits it.

    Checkpoint 4 of 7· Exam question

    A security engineer wants Claude Code to review a pull request from an external contributor. Claude should be able to read files and run analysis commands, but the engineer must manually approve every file edit and shell command before it executes. Which permission mode satisfies this requirement?

    Sources134

    3.Pointing Claude at exact context

    The precision of a prompt limits the precision of the result. If you ask "fix the login bug", Claude has to search for the bug, guess what it is, and decide for itself when the fix is done. If you name the location, the scenario and the fix condition, it has none of those to guess. The table below pairs vague requests with specific versions of the same request.

    Vague requests rewritten to give Claude the exact context
    TechniqueVagueSpecific
    Scope the taskadd tests for foo.pywrite a test for foo.py covering the edge case where the user is logged out. avoid mocks.
    Point to sourceswhy does ExecutionFactory have such a weird api?look through ExecutionFactory's git history and summarize how its api came to be
    Reference existing patternsadd a calendar widgetlook at how existing widgets are implemented on the home page; HotDogWidget.php is a good example
    Describe the symptomfix the login buglogin fails after session timeout; check the auth flow in src/auth/, write a failing test that reproduces the issue, then fix it

    Referencing a file with @ works better than describing where the code lives, because Claude reads the file before it responds. Explain the logic in @src/utils/auth.js puts that exact file in context. A directory reference such as @src/components gives Claude the list of files in that directory, not their contents. Use it to orient Claude, then reference the files that matter.

    Context can arrive in other ways too. You can paste or drag in a screenshot of an error or a design mockup. You can pipe data straight into Claude with cat error.log | claude -p "explain this error". You can give a documentation URL. Or you can tell Claude to fetch what it needs itself with Bash commands, MCP tools or file reads, which saves you from pasting large amounts of text.

    Checkpoint 5 of 7· Check yourself

    A developer types "review the error handling in @src/api" and expects Claude to have the code of every handler in context before it answers. What does the directory reference actually give Claude, and what should the developer do?

    Sources42

    4.Redirecting, clearing and delegating

    Correct a session as soon as it drifts. Waiting means more wasted work to undo. Press Esc to stop Claude in the middle of an action: the running tool call is cancelled and the context is kept, so you can redirect it straight away. If Claude is heading the right way and only needs a nudge, type the correction and press Enter without stopping it. The message is queued, and Claude reads it as soon as its current tool calls finish, within the same turn. If the work has already gone wrong, press Esc twice or run /rewind to restore an earlier state of both the conversation and the code.

    Leftover context also costs you. A long session full of material from an unrelated earlier task can make Claude perform worse. Run /clear between unrelated tasks to start from an empty context. For a quick side question, use /btw: its answer never enters the conversation history. When a session has to keep going, /compact Focus on the API changes summarizes it according to your instructions instead of whatever the automatic summary would choose to keep.

    Subagents keep the main context clean in a different way. A prompt such as "use subagents to investigate how our authentication system handles token refresh" sends the file reading to a separate agent, and only its findings come back to your session. A subagent can also be a reusable specialist with a fixed tool set and its own instructions, defined in a file:

    A subagent definition limited to read and search tools plus Bash, with its own model and instructionsmarkdown
    ---
    name: security-reviewer
    description: Reviews code for security vulnerabilities
    tools: Read, Grep, Glob, Bash
    model: opus
    ---
    You are a senior security engineer. Review code for:
    - Injection vulnerabilities (SQL, XSS, command injection)
    - Authentication and authorization flaws
    - Secrets or credentials in code
    - Insecure data handling
    
    Provide specific line references and suggested fixes.

    Checkpoint 6 of 7· Fill the gap

    Your team wants a reusable security-review subagent that can only read and search code and run Bash, so it can never edit files. Which frontmatter field sets that fixed tool set?

    ---
    name: security-reviewer
    description: Reviews code for security vulnerabilities
     ? : Read, Grep, Glob, Bash
    model: opus
    ---
    You are a senior security engineer. Review code for:
    - Injection vulnerabilities (SQL, XSS, command injection)
    - Authentication and authorization flaws
    - Secrets or credentials in code
    - Insecure data handling
    
    Provide specific line references and suggested fixes.

    Sources412

    5.Giving Claude a way to check its own work

    Feedback loops and iterative refinement inside the system mean the system checks its own output and improves on it. In Claude Code, that requires giving Claude something concrete to check against. "Implement a function that validates email addresses" has no finish line. Adding example cases (user@example.com is true, invalid is false, user@.com is false) and the instruction "run the tests after implementing" gives Claude a result it can verify. UI work follows the same pattern: paste a screenshot of the design, ask Claude to screenshot its result, compare the two, and fix the differences. For a failing build, paste the actual error and ask for the root cause to be fixed, not for the error to be suppressed.

    There are four ways to attach the check, depending on how long it needs to apply and how firmly it must hold:

    • In one prompt: ask Claude to run the check and keep iterating in the same message.
    • Across a session: set the check as a /goal condition. A separate evaluator re-checks it after every turn, and Claude keeps working until the goal is met.
    • As a deterministic gate: a Stop hook runs your check as a script and blocks the turn from ending until it passes.
    • As a second opinion: a verification subagent has a fresh model try to refute the result, so the agent that did the work is not the one grading it.

    Checkpoint 7 of 7· Match them up

    A team wants Claude to check its own work in four different situations. Pick the way of attaching the check that fits each one.

    Tap a term, then the definition that fits it.

    Sources4

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Plan: Claude explores and proposes a plan without editing your source files”
      ↩︎ Explore, plan, implement, commit
      “Manual: Claude asks before file edits and shell commands”
      ↩︎ Matching the permission mode to the task
      “Auto: a classifier reviews most actions in the background and blocks the risky ones instead of asking you.”
      ↩︎ Matching the permission mode to the task
      “Type a correction and press Enter without stopping Claude.”
      ↩︎ Redirecting, clearing and delegating
      “Manual: Claude asks before file edits and shell commands”
      ↩︎ Exam trap 1
      “Accept edits: Claude edits files and runs common filesystem commands like mkdir and mv without asking, still asks for other commands”
      ↩︎ Prediction
    2. 2.
      “Plan before editing to review changes before they touch disk”
      ↩︎ Explore, plan, implement, commit
      “Directory references show file listings, not contents”
      ↩︎ Pointing Claude at exact context
      “Delegate research to subagents to keep your main context clean”
      ↩︎ Redirecting, clearing and delegating
      “Plan before editing to review changes before they touch disk”
      ↩︎ Key concept
      “Directory references show file listings, not contents”
      ↩︎ Exam trap 2
    3. 3.
      “Add bypassPermissions to the Shift+Tab mode cycle without starting in it.”
      ↩︎ Matching the permission mode to the task
    4. 4.
      “Permission allowlists: permit specific tools you know are safe, like npm run lint or git commit”
      ↩︎ Matching the permission mode to the task
      “Reference files with @ instead of describing where code lives. Claude reads the file before responding.”
      ↩︎ Pointing Claude at exact context
      “Esc: stop Claude mid-action with the Esc key. Context is preserved, so you can redirect.”
      ↩︎ Redirecting, clearing and delegating
      “/clear: reset context between unrelated tasks. Long sessions with irrelevant context can reduce performance.”
      ↩︎ Redirecting, clearing and delegating
      “The answer never enters conversation history, so you can check a detail without growing context.”
      ↩︎ Redirecting, clearing and delegating
      “a Stop hook runs your check as a script and blocks the turn from ending until it passes”
      ↩︎ Giving Claude a way to check its own work
      “a verification subagent or a dynamic workflow that checks its own findings has a fresh model try to refute the result”
      ↩︎ Giving Claude a way to check its own work
      “As a deterministic gate: a Stop hook runs your check as a script and blocks the turn from ending until it passes.”
      ↩︎ Checkpoint

    Continue to part 2 of 2

    Claude Code hooks, shared skills and CI automation

    Spotted a mistake, or was something unclear? Tell us.