This note documents the categories of operations Claude Code performs and the tools it uses. Claude Code runs the same kinds of commands a developer would run manually — just faster and more systematically. Knowing these patterns makes Claude Code’s output readable with comprehension rather than blind trust.
File Discovery
Rather than running raw find or ls commands, Claude Code uses built-in tools optimized for speed and safety. When searching for files, it uses glob patterns:
**/*.js All JavaScript files recursivelysrc/**/*.ts TypeScript files in src/*.{json,yaml} JSON and YAML files in current directorytest/**/*test.js Test files matching patternGlob patterns are a concise way to describe sets of files. The ** means “any number of directories deep.” The * means “any characters.” Combined, **/*.sql finds every SQL file in the entire project tree.
For directory listings, Claude Code’s internal tools provide structured output with metadata. You may occasionally see standard ls or ls -la when Claude needs a quick overview, but most file discovery happens through the built-in glob tool.
Content Searching
Claude Code’s search capabilities are powered by ripgrep (rg), a modern search tool that’s dramatically faster than traditional grep on large codebases. When you ask Claude to find something, it might run:
rg "function authenticate" --type js # Find in JavaScript filesrg "TODO" -c # Count occurrencesrg "error" -i -C 2 # Case-insensitive with context linesrg "import.*React" --glob "*.tsx" # Find React imports in TSX filesThe key ripgrep flags Claude Code uses:
| Flag | Purpose |
|---|---|
--type | Filter by file type (js, py, rust, etc.) |
-i | Case-insensitive search |
-C N | Show N lines of context around each match |
-c | Count matches instead of showing them |
--glob | Filter by file pattern |
-n | Show line numbers |
If you know grep, ripgrep is the same idea with better performance and smarter defaults (it respects .gitignore automatically, for instance). The syntax is similar enough that grep knowledge transfers directly.
File Reading and Modification
For reading files, Claude Code uses its built-in Read tool rather than cat. This provides line numbers and handles special files like images, PDFs, and Jupyter notebooks. The Read tool can also read specific sections of large files rather than loading everything into memory.
For modifications, Claude Code uses an Edit tool that makes surgical changes rather than rewriting entire files:
{ "file_path": "/path/to/file.ts", "old_string": "oldFunctionName", "new_string": "newFunctionName", "replace_all": true}This approach has two advantages over the sed or awk commands you might use manually. First, it’s precise — it replaces exactly the text specified, with no risk of matching unintended occurrences. Second, it produces clean diffs — the change is visible and reviewable, not buried in a complex sed expression.
When Claude Code needs to create a new file entirely, it uses a Write tool that creates the file with the specified content. Both Edit and Write require your approval before executing.
Git Commands
Git is where you’ll see the most actual bash commands in Claude Code’s output. These are standard git operations that you’d run yourself:
# Checking state (often run in parallel)git status # What's changed?git diff # Unstaged changesgit diff --staged # Staged changesgit log --oneline -10 # Recent commits
# Making changesgit add . # Stage all changesgit commit -m "message" # Commit with messagegit branch --show-current # Current branch name
# Working with remotesgit push origin maingit pull origin mainBefore committing, Claude Code typically runs git status, git diff, and git log in parallel to understand the full state before making changes.
Package Managers and Build Tools
Development workflows involve frequent package manager commands. Claude Code runs these when installing dependencies, building projects, or running tests:
# Node.js/npmnpm install # Install dependenciesnpm run build # Build projectnpm run dev # Start development servernpm test # Run tests
# Python/pippip install -r requirements.txtpytest # Run tests
# Other ecosystemscargo build # Rustgo build # Goyarn install # YarnThese commands are ecosystem-specific — you’ll see whichever ones match your project’s technology stack. Claude Code detects the project type from configuration files (package.json for Node, requirements.txt for Python, Cargo.toml for Rust) and uses the appropriate tools.
System and Process Commands
Occasionally Claude Code checks system state to understand the environment:
which python # Find where Python is installedenv # List environment variablesps # Check running processesfile document.pdf # Determine file typewc -l bigfile.txt # Count linesThese are diagnostic commands — Claude Code uses them to answer questions about the development environment, verify that dependencies are installed, or gather information needed to troubleshoot an issue.
The Pattern: Read, Plan, Execute, Verify
Across all these categories, Claude Code follows a consistent pattern:
- Read — gather information about the current state (file contents, git status, directory structure)
- Plan — determine what changes are needed based on your request
- Execute — make the changes (file edits, git operations, command execution)
- Verify — confirm the changes worked (compile, run tests, check output)
This is the same workflow a careful developer follows. The value of Claude Code isn’t that it does something different — it’s that it does the same thing faster and more consistently, without forgetting steps or getting distracted.
The commands Claude Code runs are the same commands a developer uses manually, applied systematically.