File Editing and Navigation
How Claude Code reads, edits, and navigates your codebase using built-in tools.
How Claude Code Interacts with Files
Claude Code has native file system tools: Read, Write, Edit, Glob, and Grep. These run in your local environment with full filesystem access (scoped to your working directory by default).
Reading Files
Claude automatically reads files relevant to your request. You can also explicitly ask:
"Read
src/lib/db/schema.tsand explain the data model."
For large files, Claude reads in chunks. If a file exceeds 2,000 lines, ask it to read specific sections:
"Read lines 100-300 of schema.ts"
Editing Files
Claude uses a surgical Edit tool that replaces specific text blocks rather than rewriting entire files. This is precise and minimizes diff noise.
When Claude proposes an edit, it shows you the exact change before applying it. You can reject edits or ask for alternatives.
Glob and Grep
For exploration, Claude uses Glob to find files by pattern and Grep to search content:
- "Find all files that import from
@/lib/auth" - "Search for all usages of
getServerSession"
These are far faster than manual searches and help Claude build accurate context.
The Multi-File Workflow
For features that span multiple files, Claude coordinates changes across the codebase in a single session. Ask it to:
- Read all affected files first
- Propose the full change plan
- Execute file by file
Always re-read edited files after changes — Claude's memory of file contents can drift in long sessions.
Key Rule: Verify Every Edit
After Claude edits a file, re-read it to confirm the change is correct. Don't assume the edit succeeded — tool results can be truncated and context can decay.