Ways to Use Claude
Chat, the API, Claude Code, and IDE integrations — four ways to put Claude to work.
There is more than one door into Claude. As a web developer you will use several of them.
The four main ways
- Chat — talk to Claude in a browser or app. Great for asking questions, planning, and pasting code for review.
- The Messages API — call Claude from your own server to build AI features into your product. This is how end users get AI in your app.
- Claude Code — Anthropic's agentic coding tool. It reads and writes your repo, runs commands, and builds features from plain-English tasks.
- IDE / desktop / web — Claude Code also runs inside editors and other surfaces so it lives where you already work.
A simple rule of thumb
- Use chat or Claude Code to build your app faster.
- Use the API to give your app's users AI features.
Example
{
"chat": "Ask, plan, review code",
"messages_api": "Ship AI features to users",
"claude_code": "Build & refactor your repo",
"ide_integration": "Claude where you already code"
}When to use it
- Use claude.ai chat to prototype a prompt before wiring it into your app's backend.
- Call the Messages API from your Express server to power an AI writing assistant feature.
- Run Claude Code in your local repo to scaffold a new Next.js page with routing and tests in one command.
More examples
Installing Claude Code CLI
Installs Claude Code globally so you can run it from any project directory.
npm install -g @anthropic-ai/claude-code
# Verify install
claude --versionMessages API call from Node
Demonstrates a direct API call — the typical starting point for web feature development.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const res = await client.messages.create({
model: "claude-haiku-4-5",
max_tokens: 128,
messages: [{ role: "user", content: "Summarise this page in one sentence." }],
});Claude Code task in the terminal
Launches Claude Code with a plain-English task; it edits files and creates the page.
cd my-next-app
# Give Claude Code a scoped task
claude "Add a /about page with a heading and a two-paragraph placeholder bio"
Discussion