Module 01 · Claude Code Fundamentals
Your First Session: Reading, Editing, and Running Code
Open lesson + course map
On this lesson
Course outline
Module 1 · Claude Code Fundamentals
Module 2 · CLI Workflows
Module 3 · Model Context Protocol Basics
Module 4 · Building an MCP Server
A professional session follows inspect → plan → edit → verify → review. Claude’s final explanation is not evidence; the diff, tests, and observed behavior are.
// concept
Define the Task Contract
State exact behavior, scope, and checks:
Problem: negative quantity is accepted
Required: reject non-integer and non-positive quantity
Preserve: valid quotation totals and public API
Allowed files: src/quote.ts and tests/quote.test.ts
Verify: npm test and npm run lint
Stop: unclear requirement or same failure twiceAsk Claude to inspect before editing. Review its understanding and file list. A plan is useful when it exposes assumptions; it is not permission to expand scope.
// concept
Make the Change Reviewable
Keep the patch small. Avoid unrelated formatting, dependency upgrades, or generated-file churn. Run targeted tests first, then broader relevant gates. Read the diff yourself and test an edge case the model did not mention.
If a command is destructive, changes external state, accesses credentials, publishes, deploys, sends a message, or modifies production data, stop and use a separate authorized workflow.
// worked_example
Worked Example
Claude reads the quotation function and tests, proposes an integer/positive guard, and edits two files. The targeted tests pass. The developer inspects the diff and adds a maximum-quantity business rule only after confirming that it is actually required; it is not smuggled into the first patch.
An independent command run confirms lint and tests. git status shows only the intended files. The completion note names behavior, evidence, and remaining assumptions.
// failure_cases
Failure Cases to Diagnose
6 cases to diagnose
“Fix this” with no observable requirement
write acceptance criteria.
Agent edits before inspecting
restore and begin from current facts.
Test rewritten to accept the bug
compare against the requirement.
Large formatting diff hides logic
separate mechanical changes.
Command output assumed successful
check exit code and relevant result.
Untracked generated files ignored
review complete status.
// pakistan_angle
Pakistan Angle
Test exact PKR handling with integers or decimal-safe types; floating-point shortcuts can corrupt money. Use local examples but label sample tax, delivery, or discount rules rather than inventing legal or business policy.
For freelance work, preserve client changes already in a dirty worktree. Do not reset or overwrite unknown edits. Record what you changed and let the client reproduce checks without access to your Claude session.
// hands_on
Hands-On Exercise
5 steps
Write a bounded bug contract.
Ask for inspection and plan only.
Approve the smallest edit.
Run targeted and broader checks independently.
Review diff/status and produce evidence-based handoff.
// completion_rubric
Completion Rubric
6 checks — tick as you verify
// sources
Sources
3 official sources — check every claim yourself
// check_yourself
Check yourself
4 questions · answers and options are taken word-for-word from this course
1 / 4 · diagnose
Your work shows this failure mode: ““Fix this” with no observable requirement.” What does the lesson tell you to do about it?