Working Code
In a Claude Code session, type:
> /help
You'll see a list of available slash commands. Let's start with the most common ones:
> /status
This shows the current session state. Now let's work with files directly:
> Read the server.js file
Claude displays the file contents. Next, request a modification:
> Change the port number in server.js from 3000 to 8080
Claude shows the change as a diff and asks for approval. Press y to apply or n to cancel.
Try It Yourself
Follow these steps in order:
- Run
claudein any project. - Ask about a specific file's contents.
- Request that Claude add a comment to that file.
- Review the diff and try approving (
y) or rejecting (n).
After approving, check in another terminal that the actual file has changed.
"Why?" — Why the Approval Flow Matters
Claude Code is a powerful tool that can directly modify files. That's why every change goes through your approval. This is both a safety mechanism and a learning opportunity. The habit of reading diffs builds your code review skills.
Key Slash Commands
| Command | Function |
| ---------- | ----------------------------------------- |
| /help | List available commands |
| /status | Check current session state |
| /clear | Reset conversation history |
| /compact | Summarize conversation to save context |
| /model | Check or change the current model |
| /cost | View token usage and cost for the session |
Keyboard Shortcuts
| Key | Function |
| -------- | ------------------------- |
| Esc | Stop the current response |
| Ctrl+C | End the session |
| Tab | Autocomplete file paths |
Deep Dive
Can I run everything automatically without approval?
The --dangerously-skip-permissions flag makes everything execute without approval. But as the name suggests, it's dangerous. Only use it for trusted operations, and only when you can roll back with Git.
- Run
/helpto see the full command list. - Ask Claude to read any file, then request a one-line change.
- Review the diff — press
yonce andnonce to feel the difference. - Check your token usage with
/cost.
Q1. When Claude Code wants to modify a file, what can the user do?
- A) Changes are always applied automatically
- B) You can approve with
yor reject withn - C) Modification is impossible — only reading is allowed
- D) You must confirm in a web browser