Your First Conversation with Claude
You've got your account, you know where the buttons are. Let's actually talk to this thing.
A lot of beginners treat AI like a Google search bar. They type in three words, hit enter, and get annoyed when the answer isn't perfect. Don't do that. Treat Claude like a junior developer who just joined your team. They're smart, they have all the textbooks memorized, but they have zero context about what you actually want unless you tell them.
The Basic Prompt
Let's try a simple coding task. Instead of just typing "javascript array sort," let's give it some actual direction.
Try typing this into Claude:
Hey Claude. I have an array of user objects in JavaScript. Each object has a `name` and an `age`. I need to sort this array so the oldest users are at the top. Can you show me the cleanest way to do this using modern JS?
Notice what we did there? We didn't just ask a question; we gave it context (an array of user objects with name and age) and a specific goal (sort oldest to top, cleanly, modern JS).
Claude's response will likely use the sort() method and might look something like this:
const users = [
{ name: 'Alice', age: 25 },
{ name: 'Bob', age: 40 },
{ name: 'Charlie', age: 30 }
];
const sortedUsers = users.sort((a, b) => b.age - a.age);
The Power of the Follow-up
Here's where the magic actually happens. You don't have to get your prompt perfect on the first try. It's a conversation.
Let's say you look at that code and realize, "Oh wait, I don't want to mutate the original array." Just tell it that!
That works, but I forgot that `sort()` mutates the original array in place. I need to keep the original array intact. How do I fix that?
Claude will immediately understand the context and update the code, probably suggesting something like [...users].sort(...) or users.toSorted(...).
Keep it Natural
You don't need to learn a weird programming language to talk to Claude. Just talk to it like a normal person. If it makes a mistake, just say "Hey, that code threw a TypeError on line 4, here's the error message..." and paste the error. It's shockingly good at fixing its own bugs if you just point them out.
Go ahead and play around with it for a bit. Ask it to explain a concept you've always found confusing, or ask it to write a simple script for you. We'll dive into more advanced prompting tricks in the next few lessons.