What is Claude Code? Introduction to the AI-Powered Coding Assistant
What Claude Code actually is, how it differs from a normal AI chatbot, and what it can do for developers.
Claude Code is for the terminal, but if you need AI capability inside your own app (a website, a backend service, a chatbot), you use the Anthropic API directly.
pip install anthropic
Generate an API key from the Anthropic Console and save it as an environment variable:
export ANTHROPIC_API_KEY="your-api-key-here"
import anthropic
client = anthropic.Anthropic() # picks up the API key from the env variable automatically
message = client.messages.create(
model="claude-sonnet-4-5", # check your Anthropic dashboard for the latest model ID
max_tokens=1024,
messages=[
{"role": "user", "content": "Write a 3-line poem about the mountains of Nepal."}
]
)
print(message.content[0].text)
The messages array is the conversation history — you have to send the full context every time, since the API is stateless (there's no built-in memory between requests).
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
system="You are a friendly customer support assistant who only replies in short, clear sentences.",
messages=[
{"role": "user", "content": "When will my order arrive?"}
]
)
The system parameter sets the model's "personality" and rules — it applies to every turn of the conversation.
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
const message = await client.messages.create({
model: 'claude-sonnet-4-5',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello Claude!' }],
});
console.log(message.content[0].text);
system parameter controls the model's behavior/personality.
What Claude Code actually is, how it differs from a normal AI chatbot, and what it can do for developers.
Install Claude Code on your machine, log in, and use it for the first time in a new project.
Navigate and understand an unfamiliar codebase with Claude Code, and get real bugs fixed.