Home › Claude Code › Tutorial
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automationvs Cursorvs Codex & OpenCodeSubagentsHooksMCPEcosystemVS CodeOpenRouterRate limits中文指南
Last updated: November 06, 2026

Claude Code tutorial: your first real session

This is the session to run once, deliberately, so that every session after it is fast. Thirty minutes, a real repository, and you will have the habits that separate people who love Claude Code from people who find it expensive and erratic.

TLDR

  • Start with /init — a good CLAUDE.md is the highest-leverage file in the repo.
  • Plan before edit: ask for a plan, approve it, then let it execute.
  • Keep permissions tight, compact often, and use the cheapest model that does the job.

1. Open the project and write the memory file

cd your-project
claude
/init

/init inspects the repository and drafts CLAUDE.md: how to build, how to test, conventions, what not to touch. Edit it. Every future session reads it first, which is why it pays for itself in one day — the agent stops rediscovering your project each time.

2. Plan mode (planning mode): ask for a plan, not a change

Claude Code has a plan mode built in: press Shift+Tab to cycle the permission mode until it reads plan, or start with claude --permission-mode plan, and the agent can read and think but not edit or run anything until you switch back. It is the safest way to explore an unfamiliar codebase and the cheapest way to start a big change.

> Plan how to add rate limiting to the /api/upload route. Don't edit anything yet.

Read the plan. Correct it in plain language. Then: go ahead. Plan-then-execute produces better changes and cheaper sessions than letting the agent explore by editing.

3. Let it run the tests

Tell it how tests run (or let CLAUDE.md say so) and ask it to run them after the change. The loop — edit, test, read the failure, fix — is where the agent is strongest. Watch the permission prompts: each one is a chance to fence what it may do.

4. Permissions

/permissions

Allow read and edit freely, allow specific safe commands (Bash(npm test), Bash(git diff *)), and keep anything destructive on ask. In scripts, encode the same set with --allowedTools.

5. Compact when the topic changes

/compact focus on the rate limiter; drop the earlier exploration

Context is cost. Every turn resends everything so far. Compact at each change of direction and /clear between unrelated tasks — this single habit halves most people's bills.

6. Pick the model per step

Stay on the Sonnet tier by default. For the one genuinely hard decision, /model to Opus, make the decision, switch back. The models guide covers the tiers and how to pin them.

7. Commit and review

> Commit this as a single change with a message that explains the rate limit values.

Have it commit, then read the diff yourself. The agent is a fast, tireless junior engineer with an excellent memory of your CLAUDE.md — treat its output with the same review you would give one.

Where to go next

  • Skills — teach it your team's procedures once.
  • Subagents (/agents) — split large tasks across specialised workers.
  • MCP servers (/mcp) — give it your database, browser, ticket tracker.
  • The GitHub Action — the same loop on every pull request.
  • Pricing — and how to stop watching the meter with a flat-rate plan.

Frequently asked questions

What is CLAUDE.md?

The project memory file Claude Code reads at the start of every session: build and test commands, conventions, boundaries. /init drafts it; you keep it current.

What is plan mode in Claude Code?

Asking for a plan without edits, approving it, then executing. It produces better changes and shorter, cheaper sessions than exploratory editing.

How do I stop Claude Code from asking permission every time?

Use /permissions to pre-approve safe tools and commands, or --allowedTools in scripts. Keep destructive commands on ask.

Run Claude Code on the gateway

Same models, two environment variables, credits at 7.69231× face value — or a flat-rate unlimited plan.

Get an API key See unlimited plans

AI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.

More Claude Code guides

Claude Code: the complete guideHow to install Claude CodeClaude Code CLI documentation: commands and flagsClaude Code pricing and limits, explainedThe Claude Code SDK, now the Claude Agent SDKClaude Code skills and pluginsClaude Code in GitHub: the App, the Action and @claudeDoes Claude Code have a web interface? Web, desktop and IDE explainedWhich model Claude Code uses, and how to change itClaude Code errors and how to fix themIs Claude Code open source?Claude for students: Claude Code, the API and what education actually gets youHow to use Claude Code for QA automationClaude Code vs Cursor: which one, when — and how to run bothClaude Code vs Codex vs OpenCode: the terminal agents comparedClaude Code subagents: how they work, how to define them, and agent teamsClaude Code hooks: deterministic control over what the agent doesClaude Code MCP: connecting servers, scopes, remote MCP and real examplesThe Claude Code ecosystem: routers, frameworks, plugins and the lists that track themClaude Code in VS Code: the extension, the terminal route, and the errorsHow to use OpenRouter in Claude Code (and when not to)Claude rate limit error: what "API error: rate limit reached" means and how to fix itClaude Code 怎么用:从安装到日常使用