nikkie-ftnextの日記

イベントレポートや読書メモを発信

遅れること3週間、ようやく「Mastering Claude Code in 30 minutes」を見ました 〜前編:そんなことまでプロンプトで頼めるの!?〜

はじめに

七尾百合子さん、お誕生日 90日目 おめでとうございます! nikkieです。

Twitterを見ていると、みんなClaude Codeに行ってしまったようです。
Claude CodeはClaude 3.7 Sonnetで少し使いましたが、ここ最近の世間の反応ほどいいものなのか、確信を持てずにいました。
そこで1次情報の「Mastering Claude Code in 30 minutes」を視聴しました。

エッホエッホ みんなに見てって伝えなきゃ

目次

Anthropicが開発者向けカンファレンス「Code with Claude」を開催

完全にスルーしておりました
(OpenAIがよくやる、突然気まぐれライブストリームだと思っていた)

www.anthropic.com

Introducing Anthropic's first developer conference: Code with Claude

プレイリストはこちら:
https://www.youtube.com/playlist?list=PLf2m23nhTg1P5BsOHUOXyQz5RhfUSSVUi

その中から「Mastering Claude Code in 30 minutes」を視聴します。

まとめ

時間を捻出してご自身で見るのをおすすめします。

  • Claude Codeを使っていないユーザ向けに段階的に使う方法が紹介された
  • 紹介されたプロンプトから、Claude Codeとの開発は私が思っていたよりも多くのことができそうと衝撃を受けた

私にとって辛かったのは、字幕がなかったことです(※NotebookLMに入れても微妙かも)。
再生速度を落として英語を聞きました(誤解があったら教えてください)。
ドキュメントを見たり、プロンプトを写経したりしながら1時間くらいかけて視聴しました(1.5周した)

Mastering Claude Code in 30 minutes

7つのtipsが紹介されました。
前編では前半4つを紹介します

「Codebase Q&A」から2つ

Tip #1: use codebase Q&A as a way to dip your feet into Claude Code

Tip #2: practice prompting, and start to understand what Claude Code "gets" immediately vs. what needs more specific instructions

「Editing Code」から2つ

Tip #3: teach Claude to use your tools

Tip #4: tailor the workflow to the task

※以下のタイムスタンプは厳密なものではありません

冒頭:インストール

npm install -g @anthropic-ai/claude-code
ref: https://docs.anthropic.com/ja/docs/claude-code/overview

setup (3:00)

claudeで起動して

  • /allowed-tools
  • /terminal-setup
  • /install-github-app
  • /theme
  • /config

日本語:スラッシュコマンド
英語:https://docs.anthropic.com/en/docs/claude-code/slash-commands#built-in-slash-commands

macOSディクテーションも有効にするとよいらしいです。へ〜

Codebase Q&A

Claude Codeをまず触るなら、コードベースへの質問をしましょうとのこと。
いきなりコード編集するわけじゃないんです!
質問だけなら後述のsetup(メモリなどのconfigureと理解。後編参照)は不要で始められ、データはローカルのまま(リモートにインデックスはしない)

質問例(5:30)に、「そんなことまで聞けるの!?」と衝撃を受けました

  • How is @RoutingController.py used?
  • How do I make a new @app/services/ValidationTemplateFactory?
  • Why does recoverFromException take so many arguments? Look through git history to answer
  • Why did we fix issue #18363 by adding the if/else in @src/index.ts API?
  • In which version did we release the new @api/ext/PreHooks.php API?
  • Look at PR #9383, then carefully verify which app versions were impacted
  • What did I ship last week?

@ファイルの指定
issueやPRを#番号で指定できるんですね(4例目・6例目)。
git historyを使わせて調べさせるなんてことも(3例目)

Editing Code

ビルトインのツール(ref: Claudeが利用できるツール

  • bash
  • file search
  • file listing
  • file read and write
  • web fetch and search (とっても助かる)
  • TODOs
  • sub-agents (なにこれ!?)

ツールを使ったプロンプトの例(8:40)

  • Propose a few fixes for issue #8732, then implement the one I pick
  • Identify edge cases that are not covered in @app/tests/signupTest.ts, then update the tests to cover these. think hard
    • Twitterで話題になってた think hard だ〜)
  • commit, push, pr
    • (3単語だけ!?)
  • Use 3 parallel agents to brainstorm ideas for how to clean up @services/aggregator/feed_service.cpp
    • (sub-agentでブレストってこと!?)

チームで作ったツールをプラグインもできるそうです

  • CLIを使ってもらう
    • Use the barley CLI to check for error logs in the last training run. Use -h to check how to use it.

  • または、MCP serverとして渡す
    • claude mcp add barley_server -- node myserver
    • Use the barley MCP server to check for error logs in the last training run

Common workflows 3つ(11:00)

Explore > plan > confirm > code > commit
Figure out the root cause for issue #983, then propose a few fixes. Let me choose an approach before you code. ultrathink

Write tests > commit > code > iterate > commit
Write tests for @utils/markdown.ts to make sure links render properly (note the tests won't pass yet, since links aren't yet implemented). Then commit. Then update the code to make the tests pass.

Write code > screenshot result > iterate
Implement [mock.png]. Then screenshot it with Puppeteer and iterate till it looks like the mock.

[]画像を見せられるのか〜。ブラウザ操作もできるみたい。え!?Devin相当では)

ここまでの感想

いろいろなコーディングエージェントを触ってきましたが、今回知ったプロンプトから全部Claude Codeで済んでしまうかもしれないと思わされています。
Gemini + スプレッドシートの体験がいいのですが、同様に自然言語の指示だけでかなり多くをやってくれそうですね。
後編をお出ししつつ、触っていくぞ〜