Claude Code Exercises

Fill in the blanks to test your knowledge.

1

The npm command to install Claude Code globally is: npm install -g @anthropic-ai/___

const installCommand = {
tool: "npm",
flags: ["install", "-g"],
package: "@anthropic-ai/",
result: "claude command available globally in any terminal",
};
2

Claude Code reads a ___ file in the project root automatically at the start of every session to load persistent project context

const persistentContext = {
filename: ".md",
location: "project root",
contents: [
"Tech stack",
"Coding conventions",
"Project structure",
"Commands",
"Workflow instructions",
"Constraints",
],
readAutomatically: true,
};
3

The Claude Code slash command that summarizes a long conversation without losing task context (unlike /clear) is /___

const contextManagement = {
"/clear": "Wipes all conversation history — fresh start",
"/": "Compresses conversation to a summary — keeps task context",
useCase: "Long sessions where context drift is starting",
};
4

The flag that disables all permission prompts in Claude Code (appropriate for CI/CD pipelines only) is --dangerously-skip-___

const permissionFlags = {
safe: "interactive approval for each tool use",
cicd: "--dangerously-skip-",
warning: "Never use in interactive sessions on real codebases",
appropriateUse: ["CI/CD pipelines", "Docker sandboxes", "Controlled automation"],
};
5

To run Claude Code in one-shot (non-interactive) mode with a single task, use the ___ flag

const claudeCodeModes = {
interactive: "claude",
oneShot: "claude \"Add loading spinner to LoginButton\"",
continue: "claude --continue",
description: "One-shot mode executes one task and exits",
};
6

The Explore-Plan-Execute pattern involves asking Claude Code to produce a ___ before making any changes

const safeDevelopmentPattern = {
step1: "Ask Claude Code to explore codebase",
step2: "Ask Claude Code to produce a ",
step3: "Review the for correctness",
step4: "Authorize execution",
benefit: "Visibility before irreversible file changes",
};
7

The git command to review all changes Claude Code made before committing, file by file interactively, is git add ___

const gitSafetyWorkflow = {
before: "git status // confirm clean tree",
afterSession: [
"git diff // see all changes",
"git add // stage interactively, file by file",
"git commit // only after review",
],
purpose: "Catch unwanted changes before they enter history",
};
8

Claude Code's /init command generates a ___ file by analyzing the current project's codebase structure

const initCommand = {
command: "/init",
generates: ".md",
basedOn: [
"package.json",
"tsconfig.json",
"directory structure",
"existing code patterns",
],
reminder: "Always review and add team conventions not visible in code",
};