Exercise 1

Set Up the Training Environment

Objective: create the files that will be used throughout the session. Observe which tools Claude Code invokes to create directories and files.

1

Open a Claude Code terminal and type this request. Watch closely which tools are invoked in the interface:

💬 Type in Claude Code
Create a folder /tmp/cert-training/ with these 3 files: - config.json: {"env": "dev", "debug": true, "version": "1.0", "port": 3000} - README.md: a "TaskManager" title, a 2-sentence description, and a list of 3 fictional features - src/app.py: a TaskManager class with methods add_task(title), remove_task(id), and list_tasks()
✅ Expected result Claude uses Bash for mkdir -p /tmp/cert-training/src, then Write to create each file. It never uses echo > file or cat <<EOF.
💡 Key concept — Write

Write creates or fully rewrites a file. Use it for: new files + complete rewrites. To modify an existing file, Edit is preferable because it only sends the diff — cheaper and less risky.

Exercise 2

Read vs Bash cat — Understanding the Hierarchy

Objective: see concretely why Read is preferred over Bash for reading files, and what difference it makes.

1

Simply ask Claude to display the content of a file:

💬 Type in Claude Code
Show me the content of /tmp/cert-training/config.json
✅ Expected result Claude invokes the Read tool, not Bash with cat. The file is displayed with line numbers.
2

Now ask Claude to explain why it uses Read rather than cat:

💬 Type in Claude Code
Why did you use the Read tool and not `cat` via Bash to read that file? What are the concrete differences?
✅ Points Claude should mention Read provides line numbers (required for Edit), better UX, sandboxed, enables traceability. Bash cat works but is less integrated.
💡 Rule to remember for the exam

The hierarchy: Read > cat/head/tail, Edit > sed/awk, Write > echo/cat <<EOF. Bash is reserved for operations with no dedicated equivalent.

Exercise 3

Edit — The Absolute Read-First Rule

Objective: experience the "Read required before Edit" rule and understand what happens if you bypass it.

1

Request a precise modification in config.json:

💬 Type in Claude Code
In /tmp/cert-training/config.json, change the value of "env" from "dev" to "production" and "version" from "1.0" to "2.0"
✅ Expected result Claude first reads with Read, then uses Edit with an old_string and a new_string. It does not rewrite the whole file with Write.
2

Now test the uniqueness constraint. Add a line that makes old_string ambiguous:

💬 Type in Claude Code
Add an "env_backup" key with the value "production" in config.json, then try to change all occurrences of "production" to "staging" using Edit
✅ Expected result If old_string is not unique, Edit fails. Claude will need to use replace_all: true or provide more context to make old_string unique. Observe how it handles this.
💡 The 3 rules of Edit

1. Read required before Edit in the same conversation. 2. old_string must be unique in the file (otherwise use replace_all: true). 3. Prefer Edit over Write for any targeted modification.

⚠️ Exam Trap

"Claude Code can use Edit on a file without having previously read it in the conversation" → FALSE. Edit fails if Read has not been called at least once in the conversation.

Exercise 4

Grep vs Glob — Content vs File Name

Objective: understand the fundamental difference between Grep (searches within file content) and Glob (finds files by name/path pattern).

1

First, content search with Grep:

💬 Type in Claude Code
Find all files in /tmp/cert-training/ that contain the word "task" (case-insensitive)
✅ Expected result Claude uses Grep with a pattern. It should find README.md and src/app.py which contain "task" or "Task".
2

Now, file name pattern search with Glob:

💬 Type in Claude Code
List all .py files in /tmp/cert-training/ and its subdirectories
✅ Expected result Claude uses Glob with a pattern like /tmp/cert-training/**/*.py. It finds src/app.py.
3

Now ask for both to cement the difference:

💬 Type in Claude Code
Explain in one sentence the difference between Grep and Glob in Claude Code, with a usage example of each
💡 Memory aid for the exam

Grep = searches inside files (like grep in bash). Glob = finds files by their name/path (like find -name). Grep reads content, Glob traverses the directory tree.

Exercise 5

Bash — Only for Shell Operations Without a Dedicated Equivalent

Objective: identify the cases where Bash is the only right choice: git, npm/pip, processes, system commands.

1

Request typically "shell" operations:

💬 Type in Claude Code
In /tmp/cert-training/: initialize a git repository, create a first commit with all files, then show me the git log with one line per commit
✅ Expected result Claude uses only Bash for git commands. No Read/Write for these operations — there is no dedicated tool for git.
2

Test another legitimate Bash case:

💬 Type in Claude Code
Check which version of Python is installed, install the "requests" package with pip, and list the processes listening on port 3000
✅ Expected result All in Bash: python3 --version, pip install requests, lsof -i :3000. These operations have no dedicated equivalent in Claude Code.
💡 Legitimate Bash use cases

git, npm/pip/yarn, processes (kill, ps, lsof), curl/wget, make, compilers, servers, environment variables. The rule: if a dedicated tool exists (Read, Edit, Write, Grep, Glob), it takes priority over Bash.

⚠️ Exam Trap

"Bash can do everything, so it's always a valid option" → FALSE. The official instruction is to avoid Bash when a dedicated tool exists. Bash for cat/sed/echo = bad practice in Claude Code.