RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /How-to
  5. /How to navigate and edit files using Claude Code's interactive mode
HOW-TO · DEV

How to navigate and edit files using Claude Code's interactive mode

intermediate·20 min·By Eruo Fredoline
Target environment
Ubuntu 24.04 · Claude Code 1.xmacOS 14.x · Claude Code 1.x
PREREQUISITES

Claude Code CLI installed and authenticated with an Anthropic account

What this does

Claude Code provides an interactive REPL mode that enables navigation through project directories, reading file contents, and making targeted edits with confirmation before applying changes. This workflow enables precise, context-aware code modifications without leaving the terminal.

Steps

  1. Launch Claude Code in interactive mode by running claude from any directory. The terminal enters a chat-style REPL prompt.
  2. List the current directory contents by running the /ls command. A formatted list of files and folders appears in the output.
  3. Navigate into a subdirectory using the /cd command followed by the directory name, for example /cd src.
  4. Read the contents of a specific file by typing /read <relative-path>, for example /read src/index.ts. The file contents display with line numbers.
  5. Request a targeted edit by describing the change in natural language, for example "Update the error handling in the validateInput function to return null instead of throwing".
  6. Claude Code displays a unified diff showing the proposed change, highlighting removed lines in red and added lines in green.
  7. Accept the proposed change by typing y or pressing Enter. Reject it by typing n.
  8. For bulk edits across multiple files, specify the scope in the prompt, for example "Refactor all console.log calls in the utils/ directory to use the logging module".
  9. Review the full diff summary before accepting multiple changes across files.
  10. Save and exit the session by typing /exit. Unsaved in-memory edits are discarded, but accepted changes are written to disk immediately upon confirmation.

Verification

claude
/lcd src
/read index.ts
exit

Expected output:

[interactive mode started]
Switched to: src/
--- src/index.ts ---
1: import { app } from './app';
2: export const index = app;
[interactive mode ended]

Common failures

  1. File not found error during /read — The path provided must be relative to the current working directory. Re-run /ls to confirm the file exists, or use /cd to navigate to the correct location before reading.

  2. Edit diff rejected but session state corrupted — If a complex edit is partially applied, the file may be left in an inconsistent state. Use git diff to review changes and git checkout -- <file> to restore the original.

  3. Long file reads truncated in terminal — Claude Code may truncate display for files larger than a few hundred lines. Request a specific section using a line range in the /read command, for example /read src/large-file.ts:50-100.

Related guides

  • Install Claude Code CLI and authenticate with your Anthropic account
  • Use Claude Code in a read-only reviewing mode for security-sensitive environments
← All how-to guidesCourses →