This guide introduces Claude Code, an AI coding agent that will be your primary partner as you work on the CS 124 independent project. Learning to collaborate effectively with Claude Code is a key skill you’ll develop this semester.
The most important thing to understand about Claude Code is that it’s a conversational tool, not a one-shot search engine. When you use internet search, you typically craft a single query, get results, and then maybe refine and search again. But each search is essentially independent.
Claude Code works differently. It’s designed for back-and-forth dialogue. You start a conversation, provide some context, ask a question or request a change, and Claude responds. Then you can provide feedback, ask follow-up questions, make corrections, or request refinements. The conversation builds on itself, with Claude maintaining context about what you’ve discussed and what you’re trying to accomplish.
This conversational nature means there’s a learning curve to finding the right level of detail to provide. Should you explain your entire project goal upfront, or just ask about the immediate problem? Should you provide extensive background, or let Claude ask for what it needs? The answer varies depending on the situation, and you’ll develop intuition for this as you work with Claude Code throughout the semester.
A good starting point is to be brief and iterate forward. Start with a concise explanation of what you’re trying to do or what problem you’re facing. Claude Code can ask clarifying questions if it needs more information. You can always provide additional context in follow-up messages. This iterative approach often works better than trying to craft the perfect, comprehensive initial prompt.
Don’t hesitate to provide feedback and corrections as you go. If Claude misunderstands something, correct it. If a solution doesn’t quite work, explain what’s wrong. If you want a different approach, say so. Claude Code learns from your feedback within the conversation and will adjust its responses accordingly.
If Claude starts doing something you don’t want, you can stop it immediately by pressing Escape. This is especially useful if Claude begins making changes to the wrong files or heading in the wrong direction. Just hit Escape to interrupt, then explain what you actually wanted.
Remember: you’re collaborating with Claude Code, not just issuing commands to it. The most effective way to work with an AI coding agent is through dialogue, iteration, and refinement.
Here’s an important truth about programming: all programmers make mistakes. This applies equally to human developers and AI coding agents. You’ll make mistakes. Claude will make mistakes. Even experienced professional programmers make mistakes constantly. Making mistakes is a normal, expected part of the programming process.
But here’s the equally important truth: all programmers can identify and fix their mistakes. Just because Claude Code writes code with a bug doesn’t mean it can’t identify and fix that same bug—very much like a human developer. In fact, one of Claude’s strengths is that it can quickly iterate on code to correct errors once they’re identified.
It’s also worth understanding that coding agents like Claude Code are stochastic, meaning they don’t produce identical outputs every time. If you ask Claude the same question twice, you might get slightly different responses, and different approaches to solving the same problem. This is by design—it’s part of what makes AI coding agents creative and flexible. But it also means that if Claude makes a mistake on one attempt, asking it to try again (or approaching the problem from a different angle) might produce better results.
This is where having a test suite becomes invaluable. When you run your tests and they fail, those test failures provide concrete information about what’s wrong. You can share that information with Claude Code, and it can use those test results to understand the problem and fix the code. The test failures act as a feedback loop: Claude makes an attempt, tests reveal what’s wrong, Claude corrects based on the feedback, and the cycle continues until the tests pass.
Don’t get discouraged when Claude makes mistakes. Instead, think of it as part of the collaborative debugging process. When code doesn’t work:
This iterative process of writing code, testing it, identifying problems, and fixing them is exactly how professional software development works. You’re not just learning to work with an AI coding agent—you’re learning the fundamental cycle of software development that all programmers use, whether they’re working alone, with other humans, or with AI assistants.
Some developers even set up workflows where one coding agent writes the code and a separate agent reviews it—very much like human code review processes. The reviewing agent can spot issues, suggest improvements, and verify that the code meets quality standards. This multi-agent approach mirrors how professional development teams work, where code written by one person is reviewed by another before being merged. While you’ll primarily work with a single Claude Code instance in this course, it’s useful to know that more complex AI-assisted workflows exist and are being used in industry.
Here’s one of the most important principles for working with AI coding agents: AI agents excel at code review, and you should use them to review your code regardless of who wrote it.
Whether you wrote the code yourself or had Claude help you write it, Claude should always be used to check your work before you submit it or consider it complete. AI agents are exceptionally good at:
While Claude Code is a powerful tool for writing code, there are times when you might choose to write code yourself:
Critical sections that must be correct: Sometimes a piece of code is so important that you want to write it yourself to ensure you fully understand every detail. This is perfectly valid—understanding the code you’re submitting is always important.
When explanation takes longer than implementation: If you know exactly what needs to be done and it would take longer to explain it to Claude than to just write it yourself, go ahead and write it. This is often true for small, straightforward changes.
Learning specific concepts: When you’re trying to learn a particular programming technique or pattern, writing the code yourself can help you internalize the concept better than having Claude write it for you.
Personal preference: Sometimes you just prefer to write code yourself! That’s completely fine—Claude Code is a tool to help you, not a requirement for every line of code.
Here’s the key point: regardless of who wrote the code, it should always be reviewed.
In professional software development, even the most experienced programmers have their code reviewed by others before it’s merged into the main codebase. Code review catches bugs, improves quality, and ensures that someone other than the author has verified the code works correctly.
AI agents are excellent code reviewers. They bring several advantages:
When you’re ready to check your work, here’s a simple workflow:
Remember: using Claude to review your code isn’t cheating—it’s following industry best practices. Professional developers use code review (both human and AI-assisted) as a standard part of their workflow. You’re learning to work the way professionals work.
The goal isn’t to write perfect code on the first try. The goal is to write code, review it, improve it, and learn from the process. Claude Code makes this cycle faster and more effective.