Introduction

Welcome back to Foundation — Getting Started with Claude Code! You have completed the first unit, in which we explored what Claude Code is and how it differs from traditional AI tools. Now, in this second unit, we are ready to actually use Claude Code for the first time.

This lesson focuses on the basics of interacting with Claude Code: how to launch it, send messages, and manage your sessions. These fundamentals might seem simple, but mastering them will make you comfortable and efficient when working on real development tasks. By the end of this unit, we will be confident in navigating the Claude Code interface and ready to tackle actual coding challenges.

Working in the Terminal

Before we launch Claude Code, let's take a moment to understand where we will be working. Claude Code operates entirely within the terminal, also called the command line or shell. This is the text-based interface where we type commands and see results.

If you are new to working in terminals, do not worry. Using Claude Code does not require advanced terminal skills. The terminal is simply where we start Claude Code and where it displays its messages. Think of it as opening an application, but instead of clicking an icon, we type a command.

For macOS and Linux users, the terminal application is typically called Terminal. Windows users can use Command Prompt, PowerShell, or Windows Subsystem for Linux (WSL). Once you have a window open, you are ready to begin.

Launching Claude Code

Starting Claude Code is straightforward: we simply type claude in our terminal and press Enter. This single command is all it takes to begin a session.

Note: The first time you launch Claude Code after installing it, you will be prompted to authenticate. Follow the on-screen instructions to log in with your Anthropic account. Once authenticated, you will not need to log in again unless you explicitly log out.

Let's see what happens when we launch it:

The welcome screen displays several pieces of information. We see the version number (v2.0.42), a greeting, and importantly, which model is being used (). The billing information tells us how our usage is being tracked. The symbol at the bottom is the prompt where we type our messages.

Sending Your First Message

Once Claude Code is running, we can start communicating with it. The interface works like a conversation: we type a message, press Enter, and Claude Code responds. Let's try sending a simple greeting:

Notice how Claude Code responds conversationally. The symbol indicates the response from Claude Code, distinguishing it from our messages (which appear after the > prompt). This simple exchange confirms that Claude Code is ready and listening.

While this example shows a greeting, in real development work, we will send messages describing what we want to build, asking for explanations of code, or requesting specific changes to our project.

Understanding Session Management

As we work with Claude Code, we will naturally accumulate conversation history: messages we have sent, responses from Claude Code, code that has been written, and commands that have been executed. This accumulated history forms a session.

Sessions are important because Claude Code uses the entire conversation history as context for understanding what we are trying to accomplish. If we are building a feature across multiple messages, Claude Code remembers previous decisions and stays consistent with earlier work.

However, there are times when we need to manage these sessions: starting fresh when switching tasks, closing Claude Code when we are finished, or returning to previous work. Claude Code provides commands for each of these scenarios.

Starting Fresh with Clear

Sometimes we want to wipe the slate clean and begin a new conversation within the same session. Perhaps we have finished one task and want to start a completely different one, or maybe the conversation has become cluttered with exploration that is no longer relevant.

The /clear command removes all conversation history and gives us a clean starting point:

After clearing, Claude Code shows ⎿ (no content), indicating that the conversation history has been removed. The prompt returns, ready for our next message. Importantly, /clear does not exit Claude Code; we are still in the same terminal session, just with an empty conversation history.

This is useful when we want to context-switch between unrelated tasks without leaving Claude Code entirely.

Exiting Claude Code

When we are done working and want to close Claude Code completely, we use the /exit command. This terminates the session and returns us to the regular terminal prompt:

Claude Code displays a friendly farewell message and then exits. Notice how the prompt changes from > (inside Claude Code) back to /$ (our regular terminal prompt). We are no longer in a Claude Code session.

Exiting is what we do at the end of a work session when we are truly finished and want to close the tool. Unlike /clear, which just resets the conversation, /exit closes Claude Code entirely.

Returning to Previous Work

One of the most practical features of Claude Code is its ability to save conversation history. When we exit, our session is not lost; it is stored and can be resumed later. This means we can pick up exactly where we left off, even after closing our terminal or restarting our computer.

To return to a previous conversation, we first launch Claude Code again, then use the /resume command:

The /resume command presents a list of our recent sessions. Each entry shows the session name (often based on the first message), how long ago we worked on it, how many messages are in the conversation, and the directory where we were working.

We can navigate this list and select which session to continue. This is incredibly helpful when we are juggling multiple projects or need to return to work we started yesterday.

Choosing the Right Command

Now that we have seen /clear, /exit, and /resume, let's clarify when to use each one. These commands serve different purposes, and choosing the right one makes our workflow smoother.

Use /clear when we want to start a new task but stay in Claude Code. The terminal session continues, but the conversation history is erased. This is like opening a new document in a word processor without closing the application.

Use /exit when we are completely finished working and want to close Claude Code. This returns us to the regular terminal. It is what we do at the end of our coding session when we are done for the day or moving to completely different work.

Use /resume after launching Claude Code when we want to return to a previous conversation. This lets us pick up an existing session with all its context intact, continuing the work we started earlier.

Understanding these distinctions helps us manage our workflow efficiently. We are not constantly starting fresh when we do not need to, and we are not keeping unnecessary history when we want a clean slate.

Conclusion and Next Steps

In this unit, we have taken our first real steps with Claude Code. We learned how to launch the tool with the claude command, send messages and receive responses, and manage our sessions using /clear for fresh starts, /exit for closing the tool, and /resume for returning to previous work.

These fundamentals form the foundation of every Claude Code session. Whether we are building a simple script or refactoring a complex application, we will always start by launching Claude Code, communicating through messages, and managing sessions with these commands.

Now that we are comfortable with the interface, it is time to put these skills into action! The upcoming practice exercises will give you hands-on experience with launching Claude Code, managing conversations, and navigating between sessions, building the confidence you will need as we move on to actual development tasks.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal