TECHNOLOGY & CERTIFICATION EDITORIAL

Anthropic CCA-F: Claude Code Workflows That Hold Up

Claude Code can inspect a repository, propose edits, execute permitted commands and iterate when tests fail. That speed is valuable only if the project tells the agent which files matter, which commands are safe and what a completed change must prove. A loose request to fix an invoice validator can otherwise expand into unrelated refactoring, unreviewed dependencies or tests that never exercised the failure. Reliable Claude Code work begins with repository instructions, scoped permissions and a plan whose assumptions can be checked. It ends with a diff, reproducible test evidence and a reviewable account of any remaining risks. The distinction is between an automated coding session and an engineering workflow another person can safely continue.

A team asks Claude Code to change how a billing service validates invoice currencies. The first attempt modifies the correct function but overlooks a shared validation helper and breaks a neighboring API route. A second attempt adds a test but reads outdated project notes. The problem is not that Claude Code cannot edit files; it is that the repository has not supplied a reliable operational map or a bounded verification workflow.

A reliable Claude Code workflow begins with the repository’s real constraints, not a long sequence of commands. When a change touches payments, the assistant should identify the owning package, read the applicable project instructions, locate callers, propose a bounded edit, and test the specific behaviors the change could break. Anthropic CCA-F uses this division of responsibility when assessing Claude Code workflow design: project context guides the agent, tools supply evidence, permissions limit its actions, and test results determine whether a change can be accepted. A persuasive change summary means little if the assistant used an obsolete file, bypassed a required approval, or cannot show which test actually passed.

An invoice-validation change may be a straightforward edit with known acceptance tests, or it may require exploring why a calculation fails only for a particular currency. The agent architecture should reflect that difference. Where the defect is understood, a deterministic patch and test are easier to review; where it is uncertain, Claude can inspect the relevant call sites and test one hypothesis at a time. Neither case justifies granting blanket repository or deployment permissions.

Give Claude Code a concise, trustworthy repository map

Claude Code can discover files through repository tools, but discovery is not the same as understanding the project’s conventions. A project CLAUDE.md can describe build commands, test expectations, important directories, coding practices and known operational constraints. It can live at the repository root or in .claude/CLAUDE.md; the tool also recognizes instructions at other supported scopes, including user-level files. Nested files and path-scoped rules help keep unrelated instructions from overwhelming every task.

A good repository map is specific enough for a reviewer to test. “Run the billing module tests before touching payment logic” is actionable. “Write clean, enterprise-grade code” is not. Aim for a concise global file, then move lengthy procedures into appropriate subdirectory rules or skills. The context window is finite, and loading every project document into every conversation can make the assistant less reliable.

For the invoice change, a small root file might contain the relevant facts:

# CLAUDE.md — abbreviated example

- API routes: services/api/routes/
- Payment rules: services/billing/rules/
- Run `pytest tests/billing` after a billing-code change.
- Before editing payment side effects, propose a change plan.
- Never log customer identifiers, secrets, or payment tokens.
- Migrations require explicit human review.

These lines are project instructions, not security enforcement. A determined or confused model could still propose a forbidden action; actual permissions must be enforced through Claude Code configuration, hooks, sandbox boundaries, repository controls and backend authorization. The purpose of CLAUDE.md is to make the intended workflow discoverable and consistent, not to replace those controls.

Do not assume every instruction file loads in exactly the same way. Root and ancestor instructions are discovered at startup; files deeper in the repository may load on demand when relevant files are read. Use the documented scope behavior rather than placing contradictory instructions in several locations and hoping the closest one wins.

Use path-specific rules where conventions actually differ

Global instructions become brittle when they contain detailed directions for every technology in a monorepo. A Python backend, a TypeScript frontend and a database migration each require different validation. Claude Code supports rules under .claude/rules/, including frontmatter paths that apply a rule when matching files are involved.

---
paths:
  - "services/billing/**/*.py"
  - "tests/billing/**/*.py"
---

# Billing implementation rules
- Every amount must use decimal-safe arithmetic.
- Keep authorization checks in the application service.
- Include tests for rejected currencies and retry behavior.
- Do not modify refund execution without approval.

That rule belongs in a billing-specific file rather than the global project note. A frontend engineer investigating a button layout should not need payment-currency guidance. Conversely, when the agent opens a billing module, the relevant convention should be available without the user pasting a lengthy prompt each time.

Paths and rule-loading semantics should be validated against the installed Claude Code release, especially in a large monorepo. A rule may be discoverable only when matching files are accessed. For safety-critical conventions, combine the instruction with a test or policy mechanism that fails deterministically if the rule is violated. A style document that says “never use floats for money” is helpful; a CI test that rejects unsafe numeric behavior is more enforceable.

Keep these files under version control when they express team-wide practice, and review changes to them like changes to build scripts. A mistaken path glob can accidentally exclude an entire directory, while conflicting local and project instructions can cause unpredictable behavior.

Separate reusable skills, commands and subagents

Not every workflow belongs in CLAUDE.md. A multi-step release procedure or specialized code-review checklist can be an Agent Skill, commonly represented by a SKILL.md file under a skills directory. A skill has a name and instructions that Claude can load when the task calls for them. This is a better home for a long deployment or migration procedure than a giant repository-wide memory file.

Custom slash commands provide user-invoked entry points. Claude Code’s feature set has evolved, and legacy command workflows may now be expressed as skills; avoid documenting a deprecated command layout as the only supported approach. The architecture decision is which behavior should run on demand and which should inform every task. A command might launch a reproducible code-review procedure, while the global map tells the agent where the test suite is.

Subagents can isolate working context without receiving the parent agent’s entire set of permissions. A read-only reviewer may inspect a patch and a test specialist may run approved checks, while a coordinator retains authority over the merge. Effective multi-agent orchestration requires that the returned findings include evidence and unresolved questions, not just a pass/fail assertion.

For the currency change, one main engineering agent can examine the code and propose a patch. A separate reviewer may be useful once the diff exists, because it can inspect the patch without relying on the author’s assumptions. The reviewer should still receive the acceptance criteria, relevant test results and a clear instruction to report concerns rather than silently alter files.

Make planning and execution different permission states

The safest point to check an edit is before the tool that performs it. Claude Code supports permission modes and allow/deny rules for different tools and commands. Shared project settings commonly live in .claude/settings.json, while personal overrides can live in local settings; managed organization policies may take precedence. Always confirm the installed version’s precedence rules before relying on a specific local override.

Plan mode is valuable when the task spans several files, touches high-risk systems or has unclear acceptance criteria. It lets the assistant inspect and propose a sequence without treating exploration as authorization to edit. The reviewer can ask it to list the intended files, invariants, tests and rollback path. Once the plan is accepted, the execution phase should receive the minimum needed permission and a concrete stopping point.

Permission settings should not simply enable every shell command because “the agent needs to run tests.” A build workflow may legitimately require pytest and a formatter but not arbitrary network access or credential-reading commands. Use narrow tool rules and environment isolation where practical. A denial is meaningful: the assistant should request approval or stop, not search for an alternative command to achieve the same disallowed effect.

Hooks add another boundary. A PreToolUse hook can inspect or reject certain actions; other events can support logging and verification. Hooks are useful when a task needs deterministic checks beyond prompt wording, but they must themselves be tested. A hook that only warns about dangerous SQL is not equivalent to one that blocks the execution, and a tool outside the hook’s scope may still be usable unless separately restricted.

Configure external tools without widening authority

Claude Code can connect to MCP servers for documentation, issue tracking, deployment context or internal services. Project-scoped connections can be recorded in an .mcp.json file; other scopes and configuration methods are also supported. The file declares how clients connect, but does not make the exposed data safe or authorize every tool a server provides.

A development team might configure a read-only issue search connector while keeping production-deployment tools unavailable. That keeps investigation and execution roles separate. Avoid committing live credentials or embedding bearer tokens in examples. Use secret management and environment-specific access policies so a shared configuration can be reviewed without disclosing secrets.

External capabilities should be treated like additional repository permissions. A narrowly written MCP tool contract can authorize documentation search or a test service with restricted parameters, while production deployment and account-changing operations remain behind separate approval. The distinction matters when a retrieved README or issue comment contains hostile instructions: a useful coding assistant may read that text, but the tool runner must not let it expand the assistant’s authority.

External tool responses can carry untrusted content. A malicious issue comment telling the assistant to disable security checks is still an issue comment, not a repository instruction. The workflow should treat these results as data to verify, and permission enforcement must not be altered by anything a connected tool returns.

Use a repeatable inspect–change–test–review loop

A productive Claude Code workflow moves deliberately: inspect the relevant code and repository guidance, formulate the smallest viable change, review the intended diff, edit the necessary files, run focused tests, then examine the diff again for unintended effects. The cycle should remain close to the real engineering objective. Passing a formatter does not prove a billing rule is correct; a unit test may not expose the effect on a neighboring service.

For invoice currency validation, begin by identifying where allowed currencies are defined, which routes call the validation layer and how errors are returned. Establish invariants: no currency conversion happens in the validation function, existing authorized currencies still pass, unsupported values fail predictably, and customer-identifying data never reaches the logs. Only then propose implementation changes.

A useful review checklist is concrete:

  • Does the diff touch only the relevant billing and test files?
  • Are decimal-safe arithmetic and source-of-truth currency codes preserved?
  • Are authorization and logging constraints still enforced?
  • Do both accepted and rejected currency cases have tests?
  • Are the test commands and results recorded, including anything that could not run?

If the tests fail, the assistant should inspect the failure and revise the hypothesis. A focused approach to iterative refinement in Claude Code starts with concrete expected outputs and test evidence, rather than another speculative rewrite. It should not repeatedly rewrite unrelated files to make a test green. If the fix requires a database migration, a production secret or a high-impact permission, return to the review gate. This preserves engineering intent as well as a rollback path.

A coding agent’s passing test run is evidence only for the code and environment it actually exercised. Capture the exact commit or worktree revision, dependency lockfile state, commands executed, relevant test fixture versions and any deliberately skipped checks in the change record. Otherwise a reviewer may mistake a green test from an earlier workspace for confirmation of the submitted patch. A reproducible review also distinguishes a functional failure from an environment failure, such as a test service being unavailable; neither should be disguised as a successful release.

Treat issue descriptions, repository comments and generated test output as possible task data rather than permission to alter organizational safeguards. A comment that asks the agent to bypass branch protection or reveal a deployment secret cannot supersede the actual execution policy. The agent can propose a code fix and document why a protected step is needed, but branch rules, secret access and production deployment remain enforced by the repository and CI systems. That division preserves the benefits of Claude Code’s exploratory work without letting text encountered during development quietly expand its authority.

Bring Claude Code into CI with explicit contracts

Headless or scripted Claude Code execution is attractive for review, documentation and routine maintenance. But a CI job should specify allowed tools, maximum scope, useful outputs, and a timeout. A successful model response is not the same thing as a successful test suite. The pipeline must evaluate artifacts using normal build/test checks and preserve useful failure output.

For CI pull request review, keep the job read-only and ask for a structured list of potential issues, cited files and confidence where possible. Do not automatically merge because the review agent said “looks good.” If automated edits are permitted, isolate the branch, capture the patch, run deterministic checks and require normal human or policy approval before merging. Network access and secrets deserve especially conservative defaults.

A flaky remote call must not cause the same CI deployment or data mutation to execute twice. Persist job identity, artifacts and observed state, and apply a tool recovery policy that distinguishes a failed run from an unknown outcome. An agent’s next step should be driven by verified execution state, not by the absence of a reassuring message.

The payoff of a well-designed workflow is not that Claude Code writes more code per hour. It is that another engineer can explain what changed, why it was allowed, which checks ran, what failed and how to revert it. The most important architecture artifact is often the evidence trail, not the prompt.

End-to-end review: an invoice validation change

The request is to reject an unsupported invoice currency while preserving existing customer behavior. A developer first confirms the correct root CLAUDE.md, locates billing-specific rules and asks Claude Code for a read-only plan. That plan lists the validator, affected route handlers, test fixtures and error-response contract. A reviewer notices that one background job also uses the helper, so the plan expands before any edit is made.

The execution phase is then limited to the authorized files. Claude Code updates the validator and focused tests, runs the billing suite and reports one failing integration test caused by a mismatched error code. Rather than broadening the edit to unrelated routes, the engineer checks the shared API contract and approves a narrow correction. The final patch is inspected for accidental secrets, a test summary is attached to the change and the migration gate remains untouched.

That is the central Claude Code lesson for architects: instructions guide, permissions constrain, tests verify and humans own significant decisions. Configuration files make the workflow repeatable, but no single configuration file makes a production change safe by itself. The team earns confidence by connecting scoped context with enforceable controls and a reviewable record of what actually occurred.

Back to Insights
Explore what matters. Knowledge that goes beyond the exam.
Explore ExamTopics