# Claude Code — agentic coding without chaos

> Plan, steer, verify — then let the agent loop touch the repo under your rules.

Canonical: https://www.brainyxai.co.za/education/claude/claude-code-basics
Markdown: https://www.brainyxai.co.za/md/education/claude/claude-code-basics.md
Course: Claude Operator Track
Lesson: 5 of 9
Minutes: 18
Author: Brainyx AI

## What you will be able to do

- Explain the agentic loop (tools + context + permissions)
- Use plan-first workflow before large edits
- Write a minimal CLAUDE.md that is specific and checkable

## What Claude Code is

Claude Code is Anthropic’s **agentic coding** product: it can read the repo, run commands, edit files, and iterate — subject to your permissions. It is not “ChatGPT in the terminal”; it’s closer to a junior engineer with a toolbelt.

Install and surface options (terminal, VS Code, JetBrains, desktop, web) change over time — follow the live [Claude Code docs](https://docs.anthropic.com/en/docs/claude-code).

## Operating rhythm that doesn’t trash the branch

1. **Scope** — “Fix X in module Y; do not touch billing.”  
2. **Plan mode** — ask for a plan before edits on non-trivial work  
3. **Steer** — interrupt when it’s off-course; don’t wait for a giant wrong PR  
4. **Verify** — tests, typecheck, or a manual checklist you named up front  
5. **Compact / rewind** — when context is dirty, reset deliberately  

## CLAUDE.md that works

Good rules are **specific and checkable**:

- “Prefer existing UI components in `src/components`; no new CSS frameworks.”  
- “Never commit `.env`; never relax auth checks.”  
- “After API changes, update the OpenAPI stub in `docs/`.”  

Bad rules are vibes: “Write clean code.” “Be careful.”

Keep the file short. Emphasis is a budget — if everything is CRITICAL, nothing is.

## Auto-accept vs approval

Auto-accept is a power tool for sandboxes and greenfield spikes. On production repos and client code: **approve tool use** until the task pattern is boringly safe.

## Skills & verification

Build a **verification skill** early (how to run tests, lint, smoke-check). An agent that can’t prove “done” will thrash.

Optional official deep dive: Anthropic Academy “Claude Code” courses on [Skilljar](https://anthropic.skilljar.com/) — take them on Anthropic’s site.

## Claude Code lab

1. Install/open Claude Code per current docs on a disposable sample repo (not prod).
2. Add a 20-line CLAUDE.md with three checkable rules.
3. Ask for a plan to add a tiny feature; approve step-by-step; run the project’s test or lint command yourself.

## Checkpoints

- Plan before large edits
- Verification is part of done

## Plan first, then let it run

The single highest-leverage habit in agentic coding is refusing to let the agent start editing until you have read its plan. Ask for the plan explicitly: which files it intends to touch, what it will change in each, and what it expects to break.

Reading the plan takes two minutes and catches the expensive class of error — the agent that misunderstood the goal and is about to make a confident, coherent, entirely wrong change across nine files. Once editing starts, that error costs a revert and a re-explanation.

For anything beyond a one-line fix, the sequence is: state the goal, request a plan, correct the plan, then approve execution.

## Verification is the whole game

An agent's report that the change works is not evidence. Your tests are evidence. Structure work so verification is cheap and automatic:

- Start from a clean working tree so the diff is unambiguous.
- Prefer changes that a test can prove — and if no test covers the area, ask for the test first.
- Read the diff, not the summary. Summaries omit exactly the surprising parts.
- Run the build and the test suite before you accept anything.

If you cannot verify a change quickly, that is a signal about your project's tooling, and it will limit how much you can safely delegate.

## Writing a CLAUDE.md that earns its place

Repo-level standing rules work when they are specific and checkable. "Write clean code" changes nothing. These do:

- The exact commands to install, test, lint, and run
- Directories that must never be edited, and why
- The project's actual conventions where they differ from the language default
- What "done" requires — tests passing, types clean, changelog updated

Keep it short. A CLAUDE.md nobody maintains becomes misleading, and misleading standing rules are worse than none.

## Reality for small SA dev teams

The constraint in most South African product teams is review capacity, not code volume. An agent that produces four pull requests a day against a team that can review one carefully has made things worse, not better.

Scale delegation to your review throughput. Use the agent to widen what one reviewer can safely ship — better tests, clearer diffs, documented reasoning — rather than to increase the queue. If you want agentic development wired into a real delivery process with guardrails, that is [custom AI development](https://www.brainyxai.co.za/services/custom-ai-development) work.

## Mini-FAQ

**Q: Will it commit and push on its own?**
A: Only if you grant that. Keep commit and push as human actions until you deeply trust a narrow, repeated workflow.

**Q: How do I control cost on long sessions?**
A: Scope tasks tightly, start fresh sessions for unrelated work, and stop loops that are not converging. Long meandering sessions are the main cost driver.

**Q: How big should CLAUDE.md be?**
A: Small enough to stay accurate. Most useful files are well under a page.

## Next lesson

Continue to [the developer platform and your first API call](https://www.brainyxai.co.za/education/claude/api-and-platform).

Official reference: https://docs.anthropic.com/en/docs/claude-code

Course hub: https://www.brainyxai.co.za/education/claude · Previous: https://www.brainyxai.co.za/education/claude/chat-vs-cowork · Next: https://www.brainyxai.co.za/education/claude/api-and-platform
