Back to guides
how to use·September 5, 2026·Updated October 3, 2026·9 min read

How to use Claude Code — four things to do after beginner guides

Claude Code is an agent that lives inside your repository in the terminal. The stumbling blocks are not immediately after startup, but when you begin writing the same instructions every time, receive too many confirmations, or hit the usage limit.

Many articles explain how to use Claude Code, but most end at “install it and run it once.” The real difficulties start afterward: repeating the same instructions every time, dealing with too many confirmation dialogs, and hitting the 5-hour usage limit in the middle of a task. This page picks up where introductory guides end and addresses those three issues in turn.

First, understand that Claude Code is not “a tool for pasting code into a chat”; it’s an agent that lives in your repository and runs in the terminal. It reads and rewrites files, runs tests, and even commits changes. So the first thing to do is not learn how to use it, but give it your project rules.

The first three steps — start it, run /init, make a specific request

There are only three things worth doing right after installation. In particular, if you skip the second step, /init, you’ll have to repeat the same explanation in every subsequent session.

# 1. プロジェクトのディレクトリで起動する(ここが全ての前提)
cd ~/work/my-app
claude

# 2. 最初の一手は /init — リポジトリを読んで CLAUDE.md を書き出す
> /init

# 3. 以降は普通の日本語で頼む。ファイル名を添えるほど精度が上がる
> src/api/user.ts のバリデーションを zod に置き換えて、テストも直して

/init reads the repository and creates CLAUDE.md. The generated content is a draft, so be sure to edit it by hand. The next section explains what to put in it.

CLAUDE.md — write once what you explain every time

CLAUDE.md is a Markdown file in the project root that is loaded automatically at the start of every session. Include only “things you can’t find by reading the code.”

CLAUDE.md
# CLAUDE.md — プロジェクトのルート、git にコミットする

## コマンド
- テスト: npm test(1 ファイルだけなら npm test -- path/to/file)
- 型チェック: npx tsc --noEmit
- Lint: npm run lint

## 決めごと
- 日付は必ず date-fns。moment は使わない。
- API ハンドラは app/api/**/route.ts のみ。lib に書かない。
- コミットメッセージは日本語、prefix は feat / fix / docs。

## 触ってはいけない場所
- db/migrations/ — 生成物。手で編集しない。

It’s also clear what you shouldn’t include. Directory structures and function descriptions can be found by reading the code, so they’re unnecessary. CLAUDE.md is included in every request, so a longer file reliably uses more tokens—keep it short and include only conventions. Commit it to git to apply the same rules for the whole team.

Permissions — reduce prompts, but don’t skip too many

You’re prompted every time Claude Code rewrites a file or runs a command. This is a safety measure, so the practical middle ground is not to disable every prompt but to “allow reading and validation commands only.” Claude Code remembers your choice if you select “Always allow” during a session, and you can save it in .claude/settings.json to make it apply at the project level.

There’s also a flag that skips all prompts, but it allows deletions and pushes to remote repositories without confirmation too. Use it only inside containers or disposable worktrees that you can afford to lose. See When to use --dangerously-skip-permissions for decision criteria and safe usage.

Custom commands — stop repeating the same instructions

Tasks where you give almost the same instructions every time, such as reviews, pre-release checks, or formatting commit messages, can be turned into commands. Just add a Markdown file to .claude/commands/.

.claude/commands/review.md
# .claude/commands/review.md — 置くだけで /review として使える
指定されたファイルをレビューして、次の 3 点だけ指摘してください。

1. 実際に落ちる条件があるバグ(再現手順を添える)
2. 既存のユーティリティで置き換えられる重複
3. テストが無い分岐

スタイルの好みは指摘しないでください。

Then type /review src/api/user.ts to get a review with the same criteria every time. Commit it to git to share it with your team and keep your review standards in the repository. For practical command patterns, see the detailed English guide Claude Code workflows.

How to keep working when the 5-hour window closes

Subscription usage is measured in a rolling 5-hour window, which can close in the middle of a productive afternoon. Switching to a higher-tier plan won’t reopen it immediately. There are effectively three options.

OptionBest for
Wait for the window to reopenNo deadline; you can wait a few hours
Switch to a higher-tier planYou hit the limit every day and need more capacity continuously
Switch to an API key for that task onlyYou need to finish today and hit the limit only a few times a month

You can use the third option without canceling your subscription. Pay-as-you-go billing applies only while the following two lines are set; remove the variables to switch back to your original subscription.

~/.zshrc
# 5 時間ウィンドウが閉じても作業を続けるための 2 行。
# この変数が設定されている間だけ従量課金になり、消せば元のサブスクに戻る。
export ANTHROPIC_BASE_URL=https://api.kunavo.com
export ANTHROPIC_AUTH_TOKEN=sk-kn-...

# Claude Code の既定モデルと opus エイリアスは最新の Opus を、sonnet エイリアスは
# Kunavo が提供していない Sonnet 5.5 を指す。/model sonnet や opusplan の実行
# フェーズ、sonnet 指定のサブエージェントが 404 にならないようモデルを固定する。
# opus は Opus 5.5 に固定(Claude Code v2.1.280 以降が必要。古ければ claude update)。
export ANTHROPIC_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5

# 補助的な処理を一番安いモデルに逃がす 1 行(毎セッション効く)
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5

Rates are read directly from the catalog: Claude Sonnet 5 is $1.40 / $7.00 per 1M tokens, and Claude Haiku 4.5 is $0.70 / $3.50. Charges are deducted from your prepaid balance, so the bill for months with no usage is 0. See Claude Code pricing for a comparison of subscriptions and pay-as-you-go, including the actual cost per step and the break-even point. For details on how the window works, see Claude Pro limits; for choosing a default model, see Opus vs Sonnet.

How to phrase requests for better or worse results

This is where skill makes the biggest difference. Include file names and paths to reduce the tokens spent exploring and get faster, more accurate results: “Replace the validation in src/api/user.ts with zod” is more effective than “Fix the validation.”

Also, don’t submit a large request all at once. Break it into steps: make a change, test it, then make the next change. That makes it clear where to return if something fails. See the individual pages, such as Claude Code 401 errors, for troubleshooting errors.

If you want to try the same workflow with OpenAI’s agent, How to use Codex explains how to run it with an API key and no ChatGPT plan.

Frequently asked questions

What should I do first when using Claude Code?

Start Claude Code in your project directory and run /init first. /init reads the repository and creates CLAUDE.md. This file records project conventions (how to run tests, which libraries to use, which files not to touch) and is loaded automatically in every subsequent session. If you start using Claude Code without writing this file, you’ll have to repeat the same instructions every time.

What should I put in CLAUDE.md?

Include only what you find yourself explaining every time. Specifically: commands for running tests and type checks; project-specific conventions (use this date library, don’t put logic in this layer); and paths to generated files that must not be touched. Conversely, don’t include information that can be found by reading the code. A long CLAUDE.md is included in every request, so it reliably adds cost without improving accuracy.

What should I do if I hit the 5-hour usage limit?

There are three options: wait for the window to reopen, switch to a higher-tier plan, or use an API key for that task only. For the third option, just set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN; there’s no need to cancel your subscription. While the variables are set, you’re charged per token. Remove them to switch back. This is the fastest option when you don’t want to interrupt your work.

Can I reduce how often it asks, “May I run this?”

Yes. Claude Code remembers your choice if you select “Always allow” during a session, and you can save it in .claude/settings.json to make it apply at the project level. Allowing commands for reading and validation, such as npm test and git status, greatly reduces the number of prompts. There’s also a flag that skips all prompts, but don’t use it outside an isolated environment: it also allows deletions and pushes without confirmation.

How do I create custom commands?

Just put a Markdown file in .claude/commands/. If you add review.md, you can use it as /review. The contents can be a natural language prompt. Commit it to git so the whole team can use the same command, sharing workflows that require the same instructions every time, such as review criteria or release procedures.

What’s the most effective tip for learning how to use it?

Include specific file names and paths. “Fix the validation” is less effective than “Replace the validation in src/api/user.ts with zod”: it uses fewer tokens for exploration and produces faster, more accurate results. Another tip is to break a large request into smaller steps instead of submitting it all at once: make a change, test it, then make the next change. That makes it clear where to return if something fails.