mantus.ai

THE FUTURE BELONGS TO THE PREPARED MIND

How do you run your first Claude Code task?

Walking through a complete example from opening Claude Code to getting results, using a real coding problem.

You're ready to see Claude Code in action. Time to walk through a complete example that shows how it thinks, plans, and executes code changes.

Start Claude Code in any project directory. Open your terminal and navigate to a project you're working on, then type:

claude

Claude Code will ask you to log in on first use. After that, you'll see the familiar prompt ready for your task.

Give Claude Code a real problem to solve

Instead of asking for a simple "hello world" example, give it something meaningful. Here's a task that shows Claude Code's strengths:

Write a function that validates email addresses using regex, add comprehensive tests for it, and fix any edge cases the tests reveal

Watch what happens next. Claude Code doesn't just start writing code immediately. It thinks through the problem first, showing you its plan:

  • It will create the email validation function
  • Write test cases covering valid and invalid emails
  • Run the tests to see what breaks
  • Fix any issues the tests uncover

This planning step matters. Claude Code is showing you its approach before diving in. If the plan looks wrong, you can course-correct before it writes any code.

Follow Claude Code's execution

Claude Code works methodically. It creates the validation function first, typically in a new file or adding to an existing one. You'll see each file change as it happens, with clear diffs showing what's being added or modified.

When it writes the tests, Claude Code thinks about edge cases: empty strings, missing @ symbols, multiple @ symbols, international domains, very long addresses. Claude Code checks both sides: valid emails pass and invalid ones fail for the right reasons.

Then comes the interesting part. Claude Code runs the tests and discovers problems. Maybe the regex is too restrictive and rejects valid international domains. Maybe it allows obviously invalid formats through. Claude Code sees these failures, analyzes them, and fixes the underlying code.

Interact during execution

You don't have to sit silently while Claude Code works. If you see it heading in the wrong direction, interrupt with feedback:

Actually, make this more permissive - we want to allow plus signs in email addresses

Claude Code adjusts course immediately. It updates the regex, reruns the tests, and ensures the new requirement is met.

Review the final result

When Claude Code finishes, you get a complete solution. The email validation function handles edge cases properly. The tests are comprehensive and all passing. Any files that were modified are clearly marked.

Check the work yourself. Open the files Claude Code created or modified. Run the tests independently to verify they pass. Use Claude Code to get 80% of the way there, then apply your judgment to the result.

Common patterns to notice

Claude Code follows predictable patterns that make it reliable. It reads existing code to understand your project's style and conventions. It creates thorough tests before declaring something finished. When tests fail, it doesn't give up, it investigates and fixes the underlying issue.

It also shows its work. Every file change includes a clear explanation of what changed and why. This transparency lets you understand not just what Claude Code did, but its reasoning.

Your first task might take a few minutes, but you'll see Claude Code handle complexity that would take much longer manually. The combination of planning, execution, testing, and iteration is what makes it powerful for real development work.

Now you understand how Claude Code approaches problems. The next step is showing it more context about your specific project so it can work even more effectively.