How to use Claude Code: a hands-on tutorial for daily work
A practical Claude Code tutorial for after installation: your first session, permission modes, plan mode, CLAUDE.md and /init, the slash commands that matter, context management, subagents, hooks, MCP and skills, plus a worked example from bug to tested pull request.
This tutorial starts where installation ends. If you have not installed the agent yet, follow How to install Claude Code, and if you want the big picture of what it is and what it costs, read the Claude Code overview. What follows is how to work with it day to day: the controls you touch every session, the files that make it better over time, and a full worked example. Everything here reflects Anthropic's Claude Code docs as of October 2026.
Your first session
Start the agent from the root of a repository:
cd ~/projects/my-repo
claude
Start with questions rather than code: "give me an overview of this codebase", "how is authentication handled?". You learn the repo and see how Claude navigates it at the same time.
Reference files with @ (@src/utils/auth.js) instead of describing where code lives, and paste screenshots of errors or mockups straight into the prompt. To pick a session back up later, claude --continue resumes the most recent conversation in that directory and claude --resume shows a list.
Permission modes
A permission mode decides what Claude may do without asking. Press Shift+Tab to cycle through them during a session; the status bar shows the active one.
| Mode | Runs without asking | Use it for |
|---|---|---|
Manual (default) | Reads only | Sensitive work, unfamiliar code |
acceptEdits | Reads, file edits, common filesystem commands | Iterating on code you are reviewing |
plan | Reads; no edits until you approve a plan | Exploring before changing anything |
auto | Most actions, reviewed by a classifier model | Long tasks with fewer interruptions |
dontAsk | Only pre-approved tools, everything else denied | Locked-down CI and scripts |
bypassPermissions | Everything | Isolated containers and VMs only |
In current versions, auto mode is the starting mode for interactive terminal and VS Code sessions, provided you use a supported model and your organization has not turned it off. To approve every step yourself, start with claude --permission-mode manual.
Modes set the baseline. On top of them, /permissions manages allow, ask and deny rules. Deny rules apply in every mode, so this is the place to block things like pushing to main:
{
"permissions": {
"allow": ["Bash(npm run test *)", "Bash(npm run lint)"],
"deny": ["Bash(git push origin main)"]
}
}
That block goes in .claude/settings.json and is shared with the team through git.
Plan mode: explore, plan, then code
For anything that touches several files, separate thinking from typing. Anthropic's recommended loop has four steps:
- Explore in plan mode (Shift+Tab until
plan mode on, or/planin front of one prompt). Claude reads and answers without editing. - Plan. Ask what needs to change and for a step-by-step plan. Press Ctrl+G to open the plan in your editor and fix it directly.
- Implement. Approve the plan; the session leaves plan mode and Claude starts editing, checking its work against the plan.
- Commit. Ask for a descriptive commit and a pull request.
Skip the plan when you could describe the diff in one sentence.
CLAUDE.md and /init
Every session starts with an empty context window. CLAUDE.md is how knowledge survives between sessions: Claude loads it at the start of every conversation.
Run /init once per repository. It analyzes the codebase and drafts a CLAUDE.md with build commands, test instructions and conventions it finds. If one already exists, it suggests improvements instead of overwriting. Then edit by hand. Keep commands Claude cannot guess, style rules that differ from defaults, PR conventions and gotchas. Leave out anything Claude can learn by reading the code, and keep each file under about 200 lines. A bloated CLAUDE.md gets followed less, not more. Where the files live:
| File | Scope |
|---|---|
./CLAUDE.md or ./.claude/CLAUDE.md | The project, committed for the team |
./CLAUDE.local.md | Your personal notes for this project (add to .gitignore) |
~/.claude/CLAUDE.md | You, across all projects |
/memory opens these files for editing, and @path/to/file inside a CLAUDE.md imports another file.
The slash commands you will actually use
Type / to see everything. These are the ones that come up daily:
| Command | What it does |
|---|---|
/clear | New conversation, empty context |
/compact [focus] | Summarize the conversation to free space |
/context | Show what is filling the context window |
/rewind | Restore conversation and/or code to an earlier checkpoint (also Esc Esc) |
/plan [task] | Enter plan mode, optionally with a task |
/mcp | Manage MCP servers and their OAuth logins |
/code-review | Review the current diff for bugs in a fresh subagent |
Your own commands are now skills (more on that below): .claude/commands/deploy.md still works and creates /deploy, exactly like .claude/skills/deploy/SKILL.md.
Managing context
The context window is the resource that matters most. Every file read and every command output lands in it, and quality drops as it fills. The habits that keep sessions sharp:
/clearbetween unrelated tasks. Mixing three topics in one session is the most common failure.- Correct early. Esc stops Claude mid-action with context intact. After two failed corrections,
/clearand write a better prompt. /compact Focus on the API changeswhen you want to keep going but trim history.- Rewind instead of arguing. Checkpoints are taken on every prompt, so you can let Claude try something risky and roll back. They only track edits made through Claude's own file tools, not Bash, so git remains your real safety net.
Subagents
A subagent runs in its own context window and reports back a summary, so exploration does not fill your main session. Built-in ones include Explore (read-only search) and Plan. The simplest use is to ask: "use a subagent to investigate how our auth system handles token refresh".
Custom subagents are Markdown files in .claude/agents/ (project) or ~/.claude/agents/ (personal). Only name and description are required in the frontmatter; the body is the agent's instructions:
---
name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
model: opus
---
Hooks
CLAUDE.md is advice. A hook is a guarantee: a shell command Claude Code runs at a fixed point in its lifecycle, such as PreToolUse, PostToolUse, Notification or Stop. This example from Anthropic's docs runs Prettier on every file Claude edits:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
}
]
}
]
}
}
Put it in .claude/settings.json and check it with /hooks. If Claude keeps breaking a rule in CLAUDE.md, turn it into a hook.
MCP and skills in brief
MCP servers connect Claude Code to external systems such as issue trackers, databases and design tools:
claude mcp add --transport http notion https://mcp.notion.com/mcp
Then run /mcp inside a session to log in. The full walkthrough is in adding an MCP server to Claude Code.
Skills are folders with a SKILL.md in .claude/skills/<name>/ (or ~/.claude/skills/ for personal ones). Claude loads one automatically when its description matches the task, or you run it as /name. Add disable-model-invocation: true for workflows with side effects, like deploys, that should only run when you type the command. See Claude skills explained.
Worked example: from bug report to pull request
A realistic flow for a bug report that says login fails after a session timeout:
- Start clean.
/clear, or a new session. In plan mode, prompt: "users report that login fails after session timeout. check the auth flow in src/auth/, especially token refresh. explain the likely cause". - Reproduce first. "Write a failing test that reproduces the issue. Run it and show me the output." A failing test is the check Claude will iterate against.
- Plan and approve. Ask for a minimal fix plan, adjust it with Ctrl+G if needed, approve.
- Fix and verify. "Implement the fix, run the auth tests and the linter, fix any failures. Address the root cause, do not suppress the error." Ask Claude to show the test output rather than just claim success.
- Review. Run
/code-reviewso a fresh subagent looks at the diff without the reasoning that produced it. - Ship. "Commit with a descriptive message and open a PR." With
ghinstalled and authenticated, Claude creates the PR and links the session to it;claude --from-pr <number>finds that session again later.
The key move is step 2: give Claude a check it can run, and it closes the loop itself instead of waiting for you to spot mistakes.
Tips that actually help
- Be specific. Name files, the scenario and what "done" looks like. "Add tests for foo.py" is weaker than "write a test for foo.py covering the logged-out case, avoid mocks".
- Point to existing patterns in the repo rather than describing them.
- Run parallel work in worktrees with
claude --worktree feature-authso edits do not collide. - Name sessions with
/renameso/resumestays useful.
Rolling it out to a team
For a team, the open questions are where traffic goes, which MCP servers are allowed and who can see what was done. Claude Code can run against an LLM gateway instead of Anthropic directly, which puts model access, MCP policy and logging in one place. Walma AI Hub is that gateway, running in the customer's own Azure tenant in an EU region; see the AI Hub or the MCP gateway guide for how the controls fit together.
Frequently asked questions
How do I start using Claude Code?+
Open a terminal in your project folder and run claude. Ask for an overview of the codebase first, then run /init to generate a CLAUDE.md with your build and test commands. From there, describe tasks in plain language and let Claude read, edit and run commands, reviewing as it goes.
What are the permission modes in Claude Code?+
Manual (config value default) asks before edits and commands. acceptEdits auto-approves file edits and common filesystem commands. plan lets Claude read and propose a plan without editing. auto lets a classifier model review actions instead of you. dontAsk only runs pre-approved tools, and bypassPermissions skips checks and is meant for isolated containers. Press Shift+Tab to cycle modes during a session.
How do I use plan mode in Claude Code?+
Press Shift+Tab until the status bar shows plan mode on, prefix a single prompt with /plan, or start with claude --permission-mode plan. Claude explores and writes a plan without editing your source. Press Ctrl+G to edit the plan in your text editor, then approve it to let Claude start implementing.
What is the difference between /clear and /compact?+
/clear starts a new conversation with an empty context, which is what you want between unrelated tasks. /compact keeps the same conversation but summarizes it to free space, and accepts focus instructions such as /compact Focus on the API changes.
Do custom slash commands still exist in Claude Code?+
Yes, but they have been merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. Existing command files keep working; skills add supporting files and frontmatter that controls whether Claude can invoke them on its own.
The same tools, in your EU region, under your control
A 20-minute walkthrough with an engineer. We map it to your tools, your MCP servers and your budget model.