DaleSchool

Your AI Partner in the Terminal

Beginner15min

Learning Objectives

  • Control Claude Code with slash commands
  • Ask Claude to read and modify files
  • Understand the flow of approving or rejecting changes

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:

  1. Run claude in any project.
  2. Ask about a specific file's contents.
  3. Request that Claude add a comment to that file.
  4. 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.

  1. Run /help to see the full command list.
  2. Ask Claude to read any file, then request a one-line change.
  3. Review the diff — press y once and n once to feel the difference.
  4. 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 y or reject with n
  • C) Modification is impossible — only reading is allowed
  • D) You must confirm in a web browser

Further Reading