Claude Codeの使い方(Claude Pro 20ドルプラン)

覚書です。

Claude Codeの使い方(Claude Pro 20ドルプラン)

Windsurfで使えるようにしてみます。

Claude Codeのインストール

Node.jsが必要なようですが、個人的にインストール済みだったため割愛。

npm install -g @anthropic-ai/claude-code
claude --version(もしくはclaude -v)
claude

claudeだけでログインになるっぽいです。

Light mode (colorblind-friendly)

個人的な好みで色を選びます。

 Claude Code can now be used with your Claude subscription or billed based on API usage through your Console account.


 Select login method:

 ❯ 1. Claude account with subscription
      Starting at $20/mo for Pro, $100/mo for Max - Best value, predictable pricing

   2. Anthropic Console account
      API usage billing

定額で使いたいため20ドルプランを選びます。ブラウザが起動するため[承認する](Claudeにログイン済みでした。ログインしていないとGmailなどでログインする必要があります。)

Login successful. Press Enter to continue…

ターミナルに上記のメッセージが表示されます。[enter]を押します。

Security notes:

 1. Claude can make mistakes
    You should always review Claude's responses, especially when
    running code.

 2. Due to prompt injection risks, only use it with code you trust
    For more details see:
    https://docs.anthropic.com/s/claude-code-security

 Press Enter to continue…

セキュリティの説明がでるため[enter]

 Use Claude Code's terminal setup?

 For the optimal coding experience, enable the recommended settings
 for your terminal: Shift+Enter for newlines

 ❯ 1. Yes, use recommended settings
   2. No, maybe later with /terminal-setup

 Enter to confirm · Esc to skip

おすすめ設定にしておきます。

Claude Codeの起動

 Do you trust the files in this folder?                                                                                                      │
│                                                                                                                                             │
│ /Users/path                                                                               │
│                                                                                                                                             │
│ Claude Code may read files in this folder. Reading untrusted files may lead Claude Code to behave in an unexpected ways.                    │
│                                                                                                                                             │
│ With your permission Claude Code may execute files in this folder. Executing untrusted code is unsafe.                                      │
│                                                                                                                                             │
│ https://docs.anthropic.com/s/claude-code-security                                                                                           │
│                                                                                                                                             │
│ ❯ 1. Yes, proceed                                                                                                                           │
│   2. No, exit       

フォルダを読みにいっていいか聞かれます。そのフォルダが自分のプロジェクトで、中身を把握しているなら1. Yes, proceed を選んで問題ありません。Claude Code のアクセス範囲は、起動したフォルダとその配下に限定されます(プロジェクト直下で開くと安全境界が明確になります)。

Tips for getting started:

 1. Run /init to create a CLAUDE.md file with instructions for Claude
 2. Use Claude to help with file analysis, editing, bash commands and git
 3. Be as specific as you would with another engineer for the best results
 4. ✔ Run /terminal-setup to set up terminal integration

 ※ Tip: Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits


╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                             │
│ 🎉 Claude Code extension installed in Windsurf!                                                                                             │
│ Version: 1.0.17                                                                                                                             │
│                                                                                                                                             │
│ Quick start:                                                                                                                                │
│ • Press Cmd+Esc to launch Claude Code                                                                                                       │
│ • View and apply file diffs directly in your editor                                                                                         │
│ • Use Cmd+Option+K to insert @File references                                                                                               │
│                                                                                                                                             │
│ For more information, see https://docs.anthropic.com/s/claude-code-ide-integrations     
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Try "fix typecheck errors"                                                                                                                │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  ? for shortcuts  

上記の入力はサンプルのようです。入力されているメッセージを消して、適当に指令を送ります。

test.mdにはなんて入力されているか解説してください。

Claude Codeのアップデート

It looks like your version of Claude Code (1.0.21) needs an update.
A newer version (1.0.24 or higher) is required to continue.

To update, please run:
    claude update

This will ensure you have access to the latest features and improvements.

上記のメッセージがでたらアップデートします。

claude update

Claude Codeのエラー

  ⎿  API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please 
     obtain a new token or refresh your existing token."}}

claudeを起動した状態で、いつも命令にいれる場所に、/logoutと入力します。そのあと、ターミナルでclaudeと入力して再起動しましょう。

Claude Codeのクオリティ

Claude Codeを絶賛している人はプログラマ初心者か、少々大丈夫かなと思いますね。

次のような認識が普通という気がしています。僕レベルでそう思ってしまうので。。

でも、たしかに何かと役立つものなので、使いこなしていこうとは思います。

o3も併用しています。

ただ、1番大事なのはプログラミングの基礎力をあげることに尽きます。

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

コメント

コメントする