Quiz: Claude Code¶
6 questions
L1 (3 questions)¶
1. What is the difference between Claude Code's Read tool and using cat in the Bash tool?
Show answer
The Read tool provides structured file reading with line numbers, handles images/PDFs, respects permissions, and gives better UX. Bash cat is raw — no line numbers, no image support, and less user-friendly for code review. *Common mistake:* There is no difference; they are identical2. What is the purpose of CLAUDE.md files and how does precedence work?
Show answer
CLAUDE.md files provide project-specific instructions to Claude Code. Precedence: direct user instruction > nearest subtree CLAUDE.md > repo root CLAUDE.md > workspace root CLAUDE.md. More local wins. *Common mistake:* CLAUDE.md files are only for documentation3. How does Claude Code handle file edits — what is the difference between Edit and Write tools?
Show answer
Edit makes targeted string replacements (sends only the diff). Write overwrites the entire file. Prefer Edit for modifications to preserve context and minimize risk. Use Write only for new files or complete rewrites. *Common mistake:* Write is always preferred because it is fasterL2 (3 questions)¶
1. How do you configure Claude Code to automatically run commands before or after tool calls?
Show answer
Use hooks in settings.json — configure pre/post hooks that run shell commands in response to tool call events. Hooks can validate, lint, or notify based on what tool was called and its parameters. *Common mistake:* Write the commands in CLAUDE.md2. When should you use the Agent tool vs. direct Grep/Glob calls in Claude Code?
Show answer
Use Grep/Glob for simple, directed searches (specific file, class, function). Use Agent for broader exploration requiring multiple rounds of search, or for parallelizing independent research tasks that might overwhelm the main context. *Common mistake:* Always use Agent for every search3. What is the purpose of the TodoWrite tool in Claude Code and when should you use it?