Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  1. Blog
  2. /
  3. Claude
  4. /
  5. Claude Code

Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges

Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.

Chaand Sheikh

·27 November 2026Claude Code

What you will learn

  • Decide what belongs in git for a Claude app (prompts, tool schemas, model pin, evals, CLAUDE.md) and what stays out (the API key)
  • Map changed files to the checks they need, so a prompt edit triggers evals
  • Ask Claude to review a diff and treat the reply as advice, not an approval
  • Add the Claude Code GitHub Action to pull requests with the key in GitHub Secrets

Before you start

  • Git and GitHub fundamentals
  • The Claude Messages API: your first call

Every change to a Claude app starts in git. A teammate edits the system prompt of a returns helper, opens a pull request, and the change has to pass checks and a review before it ships. This article follows that one change, and shows where Claude fits into the road without taking the final decision.

A change travels three steps

  1. A teammate edits the system prompt, on a branch in git.
  2. A pull request opens. Checks run, and Claude reviews the change.
  3. A person looks at everything and approves. Then the change merges.

Every change to a Claude app takes the same road.

What goes in git

The code, of course. But also everything else that decides how the app behaves:

  • the prompts (here prompts/returns.txt),
  • the tool schemas,
  • the model pin,
  • the evals,
  • and the CLAUDE.md file with the team's standards.

A prompt change is a code change, and git keeps its whole history. One thing stays out: the API key. It lives in GitHub Secrets, and the .env file that holds it locally is listed in .gitignore, so it never gets committed:

.env
__pycache__/

The road itself is the usual one: branch, commit, pull request, review, merge. Keep commits small, one idea each, so a reviewer can follow the change. If git itself is new to you, start with Git and GitHub fundamentals.

Who decides the merge

Five stops on one pull request Pull request Checks can block Claude review advice only Human approves Merge Merge needs passing checks and a person's approval.
Claude can review every change. A person still decides.

Checks come first. A change that needs evals can't merge until the evals pass. Claude's review points at risks, but it isn't an approval. So merging needs passing checks and a person's approval.

change_gate.py: which checks does a change need?

"""Decide which checks a change needs before it can merge."""

# which part of the repo needs which check
RULES = [
    ("prompts/", "evals"),
    ("tools/", "evals"),
    ("src/", "tests"),
]


def required_checks(changed_files):
    checks = []
    for path in changed_files:
        for prefix, check in RULES:
            if path.startswith(prefix) and check not in checks:
                checks.append(check)
    return checks
  • A table maps each path prefix to the check it needs. Prompts and tools need evals; source code needs tests.
  • Every changed file is matched against the prefixes, and each check is collected once.
  • So a prompt edit comes back as evals.

claude_review.py: advice, then a merge status

"""Ask Claude to review a diff. A person decides."""
from stand_in import MODEL

SYSTEM = "You are a code reviewer. Name the main risk."


def review(client, diff):
    msgs = [{"role": "user", "content": diff}]
    r = client.messages.create(
        model=MODEL, max_tokens=200,
        system=SYSTEM, messages=msgs,
    )
    return r.content[0].text


def merge_status(checks_passed, human_approved):
    if not checks_passed:
        return "blocked, checks failed"
    if not human_approved:
        return "waiting for a human approval"
    return "ready to merge"
  • The system prompt gives Claude the role of a reviewer.
  • The diff goes to Claude in a normal messages.create call, and the reply comes back as text. It's advice and nothing more.
  • merge_status never looks at Claude's reply. Failed checks block; passing checks without a person's approval wait.

Gate and review: what the run printed

run_all.py sends two changes through the gate and the review. Change 1 deletes the shipping line from prompts/returns.txt; change 2 is a one-line fix in src/handler.py. The project runs against a stand-in (the real Anthropic SDK on an httpx mock transport), so the review replies and the check results are scripted for the demo.

show("change 1, a prompt edit", ["prompts/returns.txt"], PROMPT_DIFF, False, False)
show("change 2, a code fix", ["src/handler.py"], CODE_DIFF, True, False)
print("change 2, after approval")
print("  merge:", claude_review.merge_status(True, True))
change 1, a prompt edit
  needs: evals
  claude: test model reply: This diff removes the shipping line.
  merge: blocked, checks failed
change 2, a code fix
  needs: tests
  claude: test model reply: No risks found in this diff.
  merge: waiting for a human approval
change 2, after approval
  merge: ready to merge
  • The prompt edit needs evals. Claude's review flags the removed shipping line. The checks failed, so the merge is blocked.
  • The code fix needs tests. Claude finds no risks, but the merge still waits for a person.
  • After the approval, it's ready to merge.

Three ways to bring Claude Code in

WhereHow it runs
A script or CI stepclaude -p runs without a person, prints the reply and exits. --allowedTools lists the tools it may use without asking.
GitHubThe Claude Code GitHub Action. Mention @claude in a pull request or issue to ask for help, or give it a prompt and it runs on the workflow's events. The key comes from GitHub Secrets.
Automatic reviewAnthropic also offers a Code Review feature that reviews pull requests with no workflow file to write; check the Claude Code docs for which plans include it.

In GitHub, the CLAUDE.md file in the repo holds the standards Claude follows, so Claude reads the same rules your team does. For a full headless review bot with JSON findings, see a Claude Code review bot in CI.

claude-review.yml: the Action on every pull request

The workflow file lives in .github/workflows/. The project follows the Claude Code docs page "Claude Code GitHub Actions":

name: Claude review
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Review this pull request for risks."
          claude_args: "--max-turns 5"
  • It runs when a pull request is opened or gets new commits (synchronize).
  • The first step checks out the repository; the second runs the Claude Code GitHub Action, version 1.
  • The key comes from secrets.ANTHROPIC_API_KEY, never from the file itself.
  • Because there's a prompt, the action runs on its own without waiting for an @claude mention. By default the result appears in the workflow run log.

Notice the permissions: the job can read the code and the pull request. It can't merge anything. The merge stays with a person, exactly as in merge_status. For the GitHub Actions basics behind this file, see CI with GitHub Actions.

Common mistakes

  • Letting Claude's review replace a human. Merging needs passing checks and a person.
  • Keeping prompts out of git because "they aren't code". Prompts change behaviour as much as code does. Version and gate them like code.
  • Putting the API key in the workflow file. Never. Keep it in GitHub Secrets and keep .env in .gitignore.
  • Running only unit tests on a prompt edit. Map prompts/ and tools/ to evals, so a harmless-looking edit can't skip them.

Quick recap

RuleIn the project
Everything but secrets goes in gitprompts/returns.txt in the repo, .env in .gitignore
Every change passes its checkschange_gate.py maps paths to tests or evals
Claude's review is adviceclaude_review.review returns text only
A person approves the mergemerge_status waits for a human approval

Try it yourself

Add a rule for an evals/ folder to RULES (an edit to the eval cases should need a person's review of the cases themselves, say "eval review"). Then pass a change that touches both prompts/ and src/ and check that required_checks returns both checks, each once.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Claude · 4 of 66

Previous
One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
Next post
Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Related posts

CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages

Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.

Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It

Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.

One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI

Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.

Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies

A coding agent is told to clean up the data folder and picks rm -rf data/. A PreToolUse hook sees the call before the tool runs: tests and single-file deletes pass, a force push asks a person, and rm -rf, DROP TABLE and a write to .env are denied with a reason.

On this page

  • A change travels three steps
  • What goes in git
  • Who decides the merge
  • change_gate.py: which checks does a change need?
  • claude_review.py: advice, then a merge status
  • Gate and review: what the run printed
  • Three ways to bring Claude Code in
  • claude-review.yml: the Action on every pull request
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.