# Claude Code 101



---

# Lección: What is Claude Code?  (What is Claude Code?)
## What is Claude Code?

[VIDEO — transcripción]
Claude Code is [music] an agentic coding tool that understands your code base, edits your files, run commands, and integrates with your existing developer tools to help you get things done faster. It's available in your terminal, Visual Studio Code, the Claude desktop app, on the web, and JetBrains IDEs. >> [music] >> But, we'll be using it in the terminal for this video. If you've ever used Claude AI, you're probably wondering what the difference is between the two. Unlike Claude AI, Claude Code has direct access to your files in your terminal and your entire code base. So, instead of copying and pasting code back and forth, it can go in and do all the work itself. The easiest differentiator is that Claude Code works as an AI agent. An AI agent is a software that can interact with its environment and perform actions to complete a defined goal. The most basic way this can be done is by having a large language model in a loop in real time. AI agents have access to things like tools, external services, or other AI agents to help it reach its predefined goals. So, what does that actually look like? Well, here's a couple of examples. It can read and understand your code base. You can ask Claude Code to explain a feature or trace a bug throughout your code. Claude Code can execute your build script, run your tests, install packages, and use the output to decide what to do next. Claude Code can search the web. If it needs documentation on the latest API references, for example, it can do that for you. To use Claude Code effectively, it's important to know these concepts. First is the context window. Think of this as Claude's working memory. It can hold a lot, but not everything at once. This is where the agentic aspect of it comes in. Finding strategic ways to find the answers within your code base without storing your entire code base into context. Second is that it asks for permission. By default, Claude Code will ask you before running commands or making changes to your code base. You're always in control, whether that's being more hands-on or passive. Third, it can make mistakes. Just like any tool, Claude Code isn't perfect. It might misunderstand your intent, introduce a new bug, or over-engineer a solution. Quick recap. Claude Code is an agentic coding tool. It reads your code base, edits your files, runs commands, [music] and connects to external tools to help you ship faster. You can download it today in your terminal, VS Code, JetBrains, [music] and the Claude desktop app.

Claude Code is an agentic coding tool that understands your codebase, edits your files, runs commands, and integrates with your existing developer tools to help you get things done faster. It's available in your terminal, Visual Studio Code, the Claude Desktop app, on the web, and in JetBrains IDEs.

## What Separates Claude Code from Claude?

If you've used Claude.ai before, you might be wondering what makes Claude Code different. Unlike Claude.ai, Claude Code has direct access to your files, your terminal, and your entire codebase. Instead of copying and pasting code back and forth, it goes in and does the work itself.

The key differentiator is that Claude Code works as an AI Agent.

## What is an Agent?

An AI Agent is software that can interact with its environment and perform actions to complete a defined goal. At its core, this works by having a large language model operating in a loop in real time. AI Agents can have access to tools, external services, or even other AI Agents to help reach their goals.

## What Can Claude Code Actually Do?

Here's what that looks like in practice:

- Read and understand your codebase. You can ask Claude Code to explain a feature or trace a bug throughout your code.
 
- Edit files across your project. Claude Code can refactor a function and update every file that references it.
 
- Run terminal commands. It can execute your build script, run your tests, install packages, and use the output to decide what to do next.
 
- Search the web. If it needs documentation or the latest API references, it can look that up for you.

## Using Claude Code Effectively

To use Claude Code effectively, keep these three concepts in mind:

The context window. Think of this as Claude's working memory. It can hold a lot, but not everything at once. This is where the "agentic" aspect comes in — Claude finds strategic ways to locate answers within your codebase without loading the entire thing into context.

It asks for permission. By default, Claude Code will ask you before running commands or making changes. You're always in control, whether you prefer a hands-on or hands-off approach.

It can make mistakes. Just like any tool, Claude Code isn't perfect. It might misunderstand your intent, introduce a bug, or over-engineer a solution. Staying in the loop helps you catch these early.

## Recap

Claude Code is an agentic coding tool. It reads your codebase, edits your files, runs commands, and connects to external tools to help you ship faster. You can use it today in your terminal, VS Code, JetBrains, and the Claude Desktop app.


---

# Lección: How Claude Code works  (What is Claude Code?)
## How Claude Code works

[VIDEO — transcripción]
We know that Claude code is different from usual chat applications, but how does it work? Claude code is best explained through the agentic loop. You enter a prompt into Claude code. Claude code will then gather contacts required to complete your prompt. It does so by interacting with the model which will return text or a tool call that Claude code can execute. Then it takes action. For example, editing a file or running a command. Finally, it verifies those results and determines if they achieve what your prompt set out to do in the first place. If they do, then Claude finishes and waits for the next prompt. And if they don't, Claude goes back and runs the loop again until the results are complete and verifiable. Throughout this loop, you're able to add contacts, interrupt it, or steer the model to help guide it towards your end goal. Claude has a context window, which determines how much of your conversation, file contents, command outputs, and more it can store and look back on. Once you reach that limit, Claude code compacts your conversation, which automatically determines what it can take out of the context window and what it can summarize in order to bring the context window back down. Tools are the backbone of how agents work. Currently, most AI assistants are simply input text and output text. Nothing in between. Tools let Claude code and other agents determine when to execute code to get closer to a task. This could be read file tool or search web tool, for example. Claude code uses semantic searching to determine when to call a tool and get the output of it. Claude code also has permission modes. Default behavior is that it has to ask explicit permission before editing a file or running a shell command. You can use shift and tab to toggle between different modes. Auto accept edits files without asking, but still ask for commands. Plan mode uses read-only tools to help compile a plan of action before starting. It's worth being cautious when skipping permissions. Giving Claude code free reign to run commands means a mistake could be harder to catch before even happens. Claude code works by combining different agentic concepts, an agentic loop, a managed context window, tools, and configurable permissions into your terminal. It can read your code base, take action, and verify its own work, and that makes it fundamentally different from a chat window.

Claude Code is different from typical chat applications. Understanding how it works under the hood will help you use it more effectively.

## The Agentic Loop

Claude Code is best explained through the agentic loop:

- You enter a prompt into Claude Code.

- Claude gathers the context it needs by interacting with the model, which returns text or a tool call that Claude Code can execute.

- It takes action — for example, editing a file or running a command.

- It verifies the results and determines whether they achieve what your prompt set out to do.

- If they do, Claude finishes and waits for the next prompt. If they don't, it loops back and tries again until the results are complete and verifiable.

Throughout this loop, you can add context, interrupt, or steer the model to help guide it toward your goal.

## Context

Claude has a context window that determines how much of your conversation, file contents, command outputs, and more it can store and reference. Once you reach that limit, Claude Code compacts your conversation — automatically determining what it can remove or summarize to bring the context window back down to a usable size.

## Tools

Tools are the backbone of how agents work. Most AI assistants simply take text in and return text out. Tools let Claude Code determine when to execute code to get closer to completing a task. This could be a file-reading tool, a web search tool, or any number of other capabilities. Claude Code uses semantic understanding to determine when to call a tool and how to use the output.

## Permissions

Claude Code has several permission modes:

- Default behavior: Claude asks for explicit permission before editing a file or running a shell command.

- Auto-accept: Files are edited without asking, but commands still require approval.

- Plan mode: Uses read-only tools to compile a plan of action before starting any work.

All of this can be configured in your settings file. Be cautious when skipping permissions — giving Claude Code free rein to run commands means a mistake could be harder to catch before it happens.

## Recap

Claude Code combines several agentic concepts: an agentic loop, a managed context window, tools, and configurable permissions — all inside your terminal. It can read your codebase, take action, and verify its own work. That's what makes it fundamentally different from a chat window.


---

# Lección: Installing Claude Code  (Your first prompt)
## Installing Claude Code

[VIDEO — transcripción]
Cloud Code is simple to install whether you want to use it in your terminal, the web, or your IDE. If you're on macOS, Linux, or WSL, use this curl command to install it in one go. If you prefer to use Homebrew, you can also use brew install to install it, but note that this doesn't have auto-update capabilities. For Windows, there's also a couple ways. In PowerShell, use the Invoke-RestMethod command. If you're on CMD, you can also use this curl command. We also have a winget command as well if you prefer, but just like Homebrew, it won't auto-update. Now, go to your project directory and run Cloud. You will go through some initial instructions like choosing your color theme and signing in with your Cloud account, which could be the Pro, Max, or Enterprise. Or you can use an API key. If your organization has a Cloud Enterprise account, be sure to select that option. Whatever directory you decide to run Cloud in, it will have access to that directory and all of its subfolders. In Visual Studio Code, open up your extensions panel and search for Cloud Code. You will see the extension by Anthropic. Make sure it has the blue check and hit install. After installation, you might need to restart VS Code. After that, you can open up the control palette with control or command and shift and P and search Cloud Code. Open a new tab. You can also click on the Cloud logo if you see it when a file is open. You can also opt out of the UI and just use the terminal experience directly in your settings file. For JetBrains IDEs, you can install the Cloud Code plugin from the JetBrains Marketplace. Once you install, restart your IDE. And when you reopen, you'll see the Cloud logo. This will open up a pane where you can see the terminal experience. And this will work alongside you. On Cloud Desktop, you can also run Cloud Code. After you install Cloud Desktop and signed in, you will see a toggle at the top that says code. The look and feel is similar to Claude chat side of things, but allows you to work in a specific folder, change permissions, and even work in a cloud environment. On the web, you can access Claude code by going to claude.ai/code. This works very similar to the desktop app. However, you're restricted to GitHub repositories only. If you want to constantly keep up to date with everything, the terminal is the best bet. Features ship there the fastest. For the most part, you'll have extremely similar experiences with the IDE integrations if you like Claude code to feel more intertwined with your favorite code editor. Desktop is great for letting Claude run in the background while you run other tasks. Claude code on the web is a great option if you want to remotely work on a project through a GitHub repository or have multiple sessions work in parallel. However, you want to use Claude code, it's up to you.

Claude Code is simple to install whether you want to use it in your terminal, on the web, or in your IDE.

## Terminal

On macOS, Linux, or WSL, use the curl command to install it in one go. If you prefer Homebrew, you can also use brew install, but note that this method doesn't support auto-updates.

On Windows, there are a few options. In PowerShell, use the Invoke-RestMethod command. In CMD, use the curl command. There's also a winget command available, though like Homebrew, it won't auto-update.

After installation, you should be able to run the claude command. If not, restart your terminal. Navigate to your project directory and run:

claude

You'll go through some initial setup steps like choosing your color theme and signing in with your Claude account (Pro, Max, or Enterprise) or using an API key. If your organization has a Claude Enterprise account, be sure to select that option. 

Whatever directory you run claude in, it will have access to that directory and all of its subfolders.

## Visual Studio Code

Open your Extensions panel and search for "Claude Code." Look for the extension by Anthropic with the blue verification check. Hit install.

After installation, you may need to restart VS Code. Once it's running, open the command palette with Ctrl/Cmd + Shift + P and search for "Claude Code Open in New Tab." You can also click the Claude logo if it's visible in your sidebar.

The VS Code extension provides a very similar experience to the terminal. You can also opt out of the UI and use the terminal experience directly in your settings.

## JetBrains

Install the Claude Code plugin from the JetBrains Marketplace. After installation, restart your IDE. When you reopen it, you'll see the Claude logo. Clicking it opens a pane with the terminal experience that works alongside your editor.

## Desktop

After installing and signing into Claude Desktop, you'll see a toggle at the top labeled "Code." The look and feel is similar to the chat side of things, but it lets you work in a specific folder, change permissions, and even work in a cloud environment. 

## Web

On the web, access Claude Code by going to claude.ai/code, or by clicking the "Code" label in the sidebar of the chat app. This works similarly to the desktop app, but you're restricted to GitHub repositories.

## Which One Should I Use?

If you want to stay on the cutting edge, the terminal is your best bet — features ship there first. The IDE integrations offer a nearly identical experience if you prefer Claude Code to feel more intertwined with your code editor.

Desktop is great for letting Claude run in the background while you handle other tasks.

Claude Code on the web is a solid option if you want to remotely work on projects through a GitHub repository.

However you want to use Claude Code is up to you.


---

# Lección: Your first prompt  (Your first prompt)
## Your first prompt

[VIDEO — transcripción]
You talk to Claude Code like you would talk to any AI assistant. When entering your prompt, here are some things that you can consider that can both protect and make things easier for you. You can choose whether Claude auto accepts every file change it suggests or require it to ask you for explicit permission each time. With shift plus tab, you can cycle between both modes. In auto accept mode, it will automatically approve an edit or creation of a file, but ask your permission to run commands. There isn't a right or wrong way. It's just whatever you feel the most comfortable with. Within this shift tab menu is the plan mode. Plan mode takes your prompt and uses read-only tools to analyze your code base and do research on your suggested implementation. It will also ask you questions on items that it wants clarification on. It then returns to you a long detailed plan that it can execute on in more detail. Plan mode works great for planning complex changes or doing a safe code review. A lot of the time you're asking Claude to do multi-step implementations towards a feature and this is exactly what plan mode excels at. So, why don't we give it a try? I have an application here that desperately needs a dark mode toggle. So, I'm going to use Claude Code to implement this for me. So, I'm in the root directory of my project and I'm going to hit the shift tab a couple times to go into plan mode. Then, let's write out the prompt. My app needs a dark mode implemented across the entire app. Can you create a toggle switch on the header that allows user to toggle between light mode and dark mode? I need you to find a good contrast color that works based on my existing light theme. And let's let Claude plan this out. And after reviewing, I think it looks pretty good. At the end of all this, we can see explicitly what Claude did and how it came to its conclusion. And the dark mode is looking pretty good. Awesome. >> [music] >> When using Claude Code, try to be as descriptive as possible with your prompt. If you want to stay in the loop at every step, you can do that. Use plan mode to let Claude get a little bit more in the nitty-gritty with what you want to achieve before executing on that plan.

You talk to Claude Code like you would any AI assistant. When entering your prompt, here are some things to consider that can both protect you and make things easier.

## Auto-Accept vs. Approval

You can choose whether Claude auto-accepts every file change it suggests, or whether it asks for your explicit permission each time. Press Shift + Tab to cycle between modes.

- Approval mode: Claude asks permission each time it wants to edit a file or run a command.

- Auto-accept mode: File edits are automatically approved, but commands still require your permission.

There's no right or wrong answer — it's whatever you're comfortable with.

## Plan Mode

Within the Shift + Tab menu is Plan Mode. Plan mode takes your prompt and uses read-only tools to analyze your codebase and research your suggested implementation. It will ask clarifying questions along the way, then return a detailed plan it can execute.

Plan mode is great for planning complex changes or doing a safe code review. Many times you'll be asking Claude to handle multi-step implementations toward a feature, and this is exactly where Plan Mode excels.

## Example: Add a Dark Mode Toggle

Let's walk through an example. Say you have an application that needs a dark mode toggle. Open the root directory of your project and run claude. Press Shift + Tab a couple of times to enter Plan Mode, then write a prompt like:

My app needs a dark mode implemented across the entire app. Can you create a toggle switch on the header that allows a user to toggle between light mode and dark mode? I need you to find a good contrast color that works based on my existing light theme.

Let Claude plan it out. After reviewing the plan, if it looks good, accept it and let Claude ask you for approval at each step. At the end, you can see exactly what Claude did and how it reached its conclusions.

## Recap

When using Claude Code, try to be as descriptive as possible with your prompt. If you want to stay in the loop at every step, you can. Use Plan Mode to let Claude dig into the details of what you want to achieve before executing on any code.


---

# Lección: The explore → plan → code → commit workflow  (Daily workflows)
## The explore → plan → code → commit workflow

[VIDEO — transcripción]
If you take one thing away from Claude code, let it be this workflow: explore, plan, code, and commit. Without this, most people jump straight to pasting in Claude to write code, which means more course correcting later on. The fastest way to handle step one and two is with plan mode. With plan mode, Claude can't edit files. It just reads files to gather research on how to tackle this implementation. To enter plan mode, hit shift and tab until you see the plan mode under the text input. I need to add WebP conversion to our image upload pipeline. Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it. And Claude will read relevant files, do some web searches, and give you a plan of action. Make sure you review it and determine if it meets your criteria. Otherwise, I can ask it to add on or revise some areas. Perfect. And this right here is the best place to course correct because it's before any code is written. You can also use explore without being in plan mode by just asking Claude to explore your code base. Now, once the plan looks good, you can select approve to accept the plan and let Claude toggle all of the list items it provided. You can determine if you want Claude to auto accept the file edits or ask every single time. Claude will do its best to troubleshoot your code base before considering the plan finished. But at times, you'll need to course correct. This is the benefit of working with plan mode because after the plan is finished, we also have the context of how it got to the results to help it guide its next decision. In order for Claude to be confident in its results, it has to be clear on what it deems correct. When writing your plan, make this explicit. Adding tools that will help Claude complete its goals will remove a lot of back and forth. For example, if you're building web UIs, make sure you have the Claude and Chrome extension so that Claude code can control a tab and test out the UI before deeming it finished. In your project, include a test suite that Claude can continuously validate on. Claude can even write tests for you. Before passing this off to Claude, make sure that the tests are a source of truth for you and your team to avoid any false positives. Quick tip, if you find Claude keeps running into the same issues, ask Claude to save the solution to his Claude MD file. Now, once you have tested for yourself and are happy with the results, it's time to push your code. A tip before you commit, run a sub agent code reviewer to look at your code. Then you get Claude to generate a commit message for you in your style. Rinse and repeat. >> [music] >> If you want to be effective with Claude code, follow the explore, plan, code, and commit workflow. Exploration will give the relevant context Claude needs for your project. Plan will create a plan of action that Claude will use to determine if they are successful. Code is the back and forth that you and Claude do before settling on the final outcomes of the plan. Commit helps you review and push your code so you can start on your next feature.

If you take one thing away from this course, let it be this workflow: Explore, Plan, Code, and Commit. Without it, most people jump straight to asking Claude to write code — which means more course-correcting later on.

## Explore and Plan

The fastest way to handle these first two steps is with Plan Mode. In plan mode, Claude can't edit files — it just reads files to gather information about how it will tackle the implementation.

To enter plan mode, press Shift + Tab until you see "Plan Mode" under the text input. Then write a prompt like:

I need to add WebP conversion to our image upload pipeline. Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it.

Claude will read relevant files, run some web searches, and give you a plan of action. Review it and decide if it meets your criteria. If not, ask it to revise specific areas.

This is the best place to course-correct because it's before any code is written. You can also run the explore subagent without being in plan mode if you just want a general summary of your codebase without intending to make changes afterward.

## Code

Once the plan looks good, select "approve" to accept it and let Claude work through the list items. You can choose whether Claude auto-accepts file edits or asks you each time.

Claude will do its best to troubleshoot before considering the plan "finished," but at times you'll need to step in. This is the benefit of working with Plan Mode — after execution, you also have the context of how you got to the results, which helps guide Claude's next decisions.

A few tips to make the coding phase smoother:

- Define a success criteria. For Claude to be confident in its results, it needs to be clear on what "correct" looks like. Make this explicit when writing your plan.

- Add tools. Tools that help Claude complete its goals remove a lot of back and forth. For example, if you're building web UIs, install the Claude in Chrome extension so Claude Code can control a browser tab and test the UI directly. 

- Include a test suite. Give Claude a test suite it can continuously validate against. Claude can even write tests for you. Before handing this off, make sure the tests are a reliable source of truth to avoid false positives.

Quick tip: If you find Claude keeps running into the same issues, ask it to save the solution to its CLAUDE.md file.

## Commit

Once you've tested the changes yourself and are happy with the results, it's time to push your code. Before you commit, run a subagent code reviewer to look at your work. A subagent gets a fresh pair of eyes on the codebase — it doesn't carry the bias the main agent might have from the session.

Then get Claude to generate a commit message in your style. Rinse and repeat.

## Recap

To be effective with Claude Code, follow the Explore, Plan, Code, and Commit workflow:

- Explore gives Claude the relevant context it needs for your project.

- Plan creates a plan of action that Claude uses to measure success.

- Code is the back and forth between you and Claude before settling on the final outcome.

- Commit helps you review and push your code so you can start on your next feature.


---

# Lección: Context management  (Daily workflows)
## Context management

[VIDEO — transcripción]
Context is Claude's working memory. Every file it reads, every command it runs, every message you send, it all takes up space in the context window. Think of the context window as the amount of space that Claude can hold in its memory. Whenever you enter a prompt, Claude reads a file, runs a tool call, gets a tool call result. This is added onto the context window. And since there's only a finite amount you can can put in the context window, it becomes extremely important to optimize this as much as possible. Now, when you approach this limit, the context window is automatically compacted. Compaction will summarize important details and remove the unnecessary tool call results and free up a lot of space in your context window. Do note though that this could potentially lose details in your previous conversation. You can run the compaction manually as well with the {slash} compact command. This will compact everything that you've done up to that point, which could be handy if you want to clear up context space, but also have a memory of what you previously worked on. If you want to completely start from scratch without memory of what was previously worked on, you can also run {slash} clear and that will remove everything, starting from scratch. To check the state of your context, run the {slash} context command. Here, you'll get a big picture of how large your context size is, the different categories that are taking up the most context, and a graphic showing you all of this. A general rule of thumb is when you're working on a specific feature and are going over the context window, but need to continue, then compact. Keeping the context relevant for this feature is important when continuing development. If you have finished the plan and want to start on a new feature, then clear. You don't want the previous conversation to present bias in anything new that you want to create. For things that you do want Claude to remember in other sessions, put it in the Claude.md file. That way, it doesn't have to rediscover things from scratch all over again. Be specific. The irony behind writing a smaller prompt is that it in the long run, it will take up more context. Without being explicit, Claude is forced to look around your code base more and do his own thinking, which takes up a lot more context window space than if you were just a little bit more clear with a sentence or two. MCP servers load all of the tools available into context by default. So, if you have a lot of MCP servers for things that are unrelated to the project, it might be worth turning them off. You can also try out skills, which works similarly to MCP servers, but doesn't put the entire thing into context, saving you space. Sub agents run in parallel with your main agent, but has a complete separate context window. So, for tasks that require an answer without the journey, like where is the authentication endpoints located, you can have the sub agent do the work and return just a summary to your main agent. Managing context within Claude code is crucial. Use /compact to summarize long sessions and /clear to start fresh. To use your context window effectively, be specific with what you want. >> [music] >> Check what's using your current context window and use sub agents to delegate tasks you only need the answer for.

Context is Claude's working memory. Every file it reads, every command it runs, every message you send — it all takes up space in the context window.

## What is the Context Window?

Think of the context window as the amount of space Claude can hold in its memory. Whenever you enter a prompt, Claude reads a file, runs a tool call, or receives a tool call result, it's all adding to the context window. Since there's a finite amount of space, it becomes important to optimize how you use it.

## What Happens When Context Fills Up

When you approach the limit, the context window is automatically compacted. Compaction summarizes important details and removes unnecessary tool call results to free up space. Note that this process can potentially lose details.

## Commands

You can run compaction manually with the /compact command. This compacts everything up to that point. It's handy when you want to free up context space while keeping a memory of what you previously worked on.

If you want to completely start from scratch with no memory of the previous session, run /clear. This removes everything.

To check the state of your context, run the /context command. You'll get a high-level overview of your context size, the categories taking up the most space, and a visual graphic showing the breakdown.

## When to Use Which

A general rule of thumb:

- Use /compact when you're working on a specific feature and running up against the context limit but need to continue. Keeping the context relevant to your current feature is important.

- Use /clear when you want to start a new feature. You don't want the previous conversation to introduce bias into something new. For things you want Claude to remember across sessions, put them in your CLAUDE.md file so it doesn't have to rediscover things from scratch. 

## Tips for Saving Context Space

Be specific. A vague prompt might seem smaller, but it actually costs more context in the long run. Without clear instructions, Claude is forced to explore your codebase more and do its own reasoning — which takes up far more context space than a detailed prompt would.

Manage your MCP servers. MCP servers load all of their available tools into context by default, even when you're not using them. If you have servers configured for things unrelated to the current project, consider turning them off. You can also try "Skills," which work similarly to MCP servers but don't load everything into context upfront. 

Use subagents. Subagents run in parallel with your main agent but have a completely separate context window. For tasks where you only need the answer — like "where are the authentication endpoints located?" — a subagent does the work and returns just a summary to your main agent, keeping your primary context clean.

## Recap

Managing context within Claude Code is crucial. Use /compact to summarize long sessions and /clear to start fresh. To use your context window effectively: be specific with your prompts, check what's consuming your current context, and use subagents to delegate tasks where you only need the result.


---

# Lección: Code review  (Daily workflows)
## Code review

[VIDEO — transcripción]
[music] >> Mhm.

Claude Code has a few built-in features that make your git workflow faster. Let's go through them.

## Review with a Subagent

Before you push a PR, ask Claude to use a subagent to review your changes. The subagent runs in its own context window with fresh eyes — it doesn't carry the bias of the main agent that just spent the session writing the code.

When creating a code-reviewer subagent, restrict it to read-only tools. A reviewer should flag issues, not edit files. Check the subagent configuration into your repo so your whole team uses the same reviewer.

## The /commit-push-pr Skill

The /commit-push-pr skill handles the commit, push, and PR creation all in one step. Instead of doing each manually, just run the skill and Claude takes care of it.

If you have a Slack MCP server configured with channels listed in your CLAUDE.md, it will automatically post the PR link to your team's channel.

## Session Linking with --from-pr

When Claude creates a PR through gh pr create, the session gets linked to that PR automatically. If you need to come back to it later — maybe to address review comments or fix a failing build — run:

claude --from-pr <PR_NUMBER>

This picks up right where you left off.

## Recap

Use a subagent for an unbiased code review before pushing. Use /commit-push-pr to handle the full commit-to-PR flow in one step. And use --from-pr to resume work on a PR later. These are small features, but they remove a lot of friction from your daily workflow.


---

# Lección: The CLAUDE.md file  (Customizing Claude Code)
## The CLAUDE.md file

[VIDEO — transcripción]
One of the most useful parts of Claude Code is the claw.md file. >> [music] >> It gives Claude Code persistent memory about your project. >> [music] >> When you open up Claude Code without a claw.md file, it's like it has to start fresh every single time. It has to re-explore your code base, understand what dependencies are needed, and the features that are already implemented. Sometimes it has to make assumptions, which makes it harder for us to steer Claude in the right direction. But, that's where claw.md comes in. It's a markdown file that you add to the root of your project, and Claude Code reads it automatically every time you start a session. It's like an onboarding script for your code base. Simply put, the contents of claw.md file are appended to your own prompt. You can run the {slash} init command, which will make Claude generate one based off of your code base. So, let's have a look at one. This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM. Command, dev server, run tests, lint, code style, use two-space indentation, prefer named exports, all API routes go in app/{slash}api, use server actions instead of API routes where possible. And it's pretty straightforward. Now, if I ask Claude Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using. We can see that Claude does a better job at doing his job right off the bat versus having to understand where everything is at first. And before you ask, the answer is yes. You share this in your version control for your team to use, but there's actually a hierarchy of memory files depending on who it's for. So, first you have your project-level claw.md that lives in the root directory of your project. You have a user-level claw.md that lives in your configuration folder. This one is just for you and goes across all your projects. So, put your preferences here, like how you write code comments. First, if you have to correct Claude to do something like always use server actions instead of API routes, then explicitly ask Claude to save this to memory, so that when you come back to this project, it will know every single time. Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path. And third is we recommend you start off a project without a Claude.md file, you can see where you have to constantly course correct the model. This keeps your Claude.md file compact and contain only the necessary information that Claude can work with. The difference between a frustrating Claude code session and a productive one comes down to the context and the Claude.md file is how you provide that context. Start with your stack, your preferences, and then commands, and >> [music] >> just build from there as you go.

One of the most useful features in Claude Code is the CLAUDE.md file. It gives Claude Code persistent memory about your project.

## The Problem It Solves

When you open Claude Code without a CLAUDE.md file, it starts fresh every time. It has to re-explore your codebase, figure out what dependencies are needed, and understand what features are already implemented. Sometimes it makes assumptions, which makes it harder to steer Claude in the right direction.

CLAUDE.md solves this. It's a Markdown file you add to the root of your project, and Claude Code reads it automatically every time you start a session. Think of it as an onboarding script for your codebase. The contents of the CLAUDE.md file are appended to your prompt.

## An Example

Here's what a typical CLAUDE.md file looks like:

# Project

This is a Next.js 15 app using the App Router, Tailwind, and Drizzle ORM.

# Commands
- Dev server: `pnpm dev`
- Run tests: `pnpm test`
- Lint: `pnpm lint`

# Code Style
- Use 2-space indentation
- Prefer named exports
- All API routes go in app/api/
- Use server actions instead of API routes where possible

It's straightforward. Now if you ask Claude Code to create a React component, it already knows to use Tailwind for styling and to follow your code conventions.

## CLAUDE.md is for Teams

You can (and should) commit your CLAUDE.md to version control so your team benefits from it. There's actually a hierarchy of memory files depending on who they're for:

- Project-level CLAUDE.md lives in the root directory of your project. Shared with the team.

- User-level CLAUDE.md lives in your configuration folder. This one is just for you and applies across all your projects. Put your personal preferences here.

## Tips

Save corrections to memory. If you find yourself correcting Claude repeatedly — like telling it to always use server actions instead of API routes — explicitly ask Claude to save that rule to memory. Next time you open the project, it'll know.

Reference project docs. If you have documentation in your project that you want Claude to reference, use the @ symbol with the file path:

## README.md

Please read if you need more info: @README.md

Start without one. We recommend starting a project without a CLAUDE.md file so you can see where you constantly have to course-correct the model. This keeps your CLAUDE.md compact and focused on only the necessary information. When you're ready, run /init to have Claude generate one for you.

## Recap

The difference between a frustrating Claude Code session and a productive one often comes down to context — and the CLAUDE.md file is how you provide that context. Start with your stack, your preferences, and your commands, then build from there as you go.


---

# Lección: Subagents  (Customizing Claude Code)
## Subagents

[VIDEO — transcripción]
Sub-agents are specialized assistants that Claude can delegate tasks to. Each sub-agent runs in its own conversation contacts window with a custom system prompt that you define. When finished, it returns a summary to the main thread while all the intermediate work stays isolated. One of the main advantages of sub-agents is that they help manage context window usage. When you chat with Claude Code, you're adding context to the main context window. Every tool call and its results get stored in this main context window. And so, when Claude uses a sub-agent, a separate window starts. The sub-agent receives two inputs, a custom system prompt from your configuration file, and a task description written by the parent or parent agent based on what you ask for. The sub-agent then works autonomously. When it reads files, edits files, or uses tools, none of these will appear in the main conversation. Just a summary is returned back. The entire sub-agent conversation then gets completely discarded. Consider a task like investigating how the payment system works in an unfamiliar code base. Maybe you're trying to use Claude Code to figure out which service handles refunds. Well, without a sub-agent, Claude might read 15 files, run several searches, and trace through multiple function calls. All of that context fills your context window, even if you only needed one single fact, which service handles refunds. With a sub-agent, you get the answer without the journey. The sub-agent explores, discovers the answer, and returns a focused summary, keeping your main context clean. But, the main window loses visibility into how the sub-agent reaches its conclusions and what it discovered along the way. Claude Code includes several built-in sub-agents that you can use immediately, like the general-purpose sub-agent, used for multi-step tasks that require both exploration and action. The explore sub-agent, used for fast searching of code bases. The plan sub-agent, used during plan mode for research and analysis of your code base before presenting a plan. And you can also create your own sub-agents with custom system prompts and tool access. Sub-agents like Claude Code break work into focused pieces, keep your main context window clean, and bring back just what you need, whether you're using the built-in ones or creating your own. They're a practical way to get more out of longer Claude Code sessions.

Claude can delegate tasks to subagents that break them down and run component tasks in parallel, improving your context management. Each subagent operates in its own isolated context window.

## How It Works

Managing context in Claude Code is important. A lot of the context window gets consumed by things like tool calls exploring your codebase or running web searches for research. What Claude discovers during that exploration isn't always relevant to the main feature you're developing.

This is where subagents come in. Claude spawns a subagent to handle a task like "explore this codebase for me." The subagent runs in parallel with its own context window, does all the exploration work, and once finished, summarizes its findings and returns that summary back to Claude.

The result: you get the answer you were looking for, without the entire journey it took to get there cluttering your main context.

## Creating Your Own Subagent

Subagents are defined in Markdown files with YAML frontmatter. The easiest way to get started is to let Claude generate one for you. Run:

/agents

Then select "Create new agent." You'll walk through steps including choosing the scope of the agent, defining its purpose, selecting the tools it has access to, and even picking a color for it.

Claude will generate a name, description, and prompt for the subagent. This also tells Claude when to call the subagent based on the prompts you give it.

## Further Customization

Subagents can be customized further. Here are some highlights:

- Persistent memory lets your subagent retain memory across conversations. This is great if you're using it consistently on the same projects.
 
- Preload skills into subagents by adding the skill key and listing skills by name. Note that unlike skills in your main conversation, the entire skill is loaded into context here.

## Recap

Keeping your context window clean is one of the best ways to stay productive with Claude Code. With subagents, you can run an agent in the background to handle the heavy lifting and return just the answer to your main context window.

Want to go deeper? Check out our dedicated course: Introduction to subagents


---

# Lección: Skills  (Customizing Claude Code)
## Skills

[VIDEO — transcripción]
Every time you explain your team's coding standards to Claude, you're repeating yourself. Every PR review, you redescribe how you want feedback [music] structured. Every commit message, you remind Claude of your preferred format. And skills fix this. A skill is a markdown file that teaches Claude how [music] to do something once, and Claude applies that knowledge automatically whenever it's relevant. Agent skills are folders of instructions, scripts, and resources that agents can discover and use to do things more accurately and efficiently. With Claude Code, we have the skill.md file. The description is how Claude decides whether to use the skill. When you ask Claude to review this PR, it matches your request against available skill descriptions and finds this one. Claude reads your request, compares it to all available skill descriptions, and activates the ones that match. You can store skills in a few places depending on who needs them. Personal skills go in the home directory .claude/skills and follow you across all your project. These are your preferences, your commit message style, your documentation format, how you like code explained. Project skills go in the .claude/skills inside of the root directory of your repository. Anyone who clones the repository gets these skills automatically. This is where team standards live, like your company's brand guidelines, preferred fonts, and colors that you use for web design. Claude Code has several ways to customize behavior. Skills are unique because they're automatic and task-specific. Claude.md files load into every conversation. If you want Claude to always use TypeScript strict mode, that goes in your claw.md file. Skills, on the other hand, load on demand when they match your request. It only loads in the name and description, so it doesn't fill up your entire context window. Your PR review checklist doesn't need to be in the context when you're debugging. It loads when you actually ask for a review. Slash commands require you to type them. Skills don't. Claude applies them when it recognizes the situation. Skills work best for specialized knowledge that applies to specific tasks. Code review standards your team follows, commit message formats that you prefer, brand guidelines of your organization. If you find yourself explaining the same thing [music] to Claude repeatedly, well, that's a skill waiting to be written.

Want to go deeper? Check out our dedicated course: Introduction to agent skills


---

# Lección: MCP  (Customizing Claude Code)
## MCP

[VIDEO — transcripción]
Model contact protocol is an open standard that lets Claude code connect to external tools and data sources. >> [music] >> When you ask a question, Claude will automatically understand when it should use those tools to better understand your query. Context is one of the most important parts when working with Claude code. A lot of your context lives elsewhere like your databases, your productivity apps, or [music] in public repositories. This is where MCP comes [music] in. First, it's important to understand the concept of tools when talking about Agentic AI. Tools give agents like Claude code the ability to perform actions in order for them to better complete their tasks. This is different from other AI where you just get an output back directly in text usually. For example, if your team is using Linear as our project management software, you can add a Linear MCP server to bring in the details of your specific issues. If you want to get up-to-date documentation of a dependency that you're working with, then the Context 7 MCP server will provide Claude code with that. There are also hundreds of different connectors at claude.com/connectors. You can add MCP servers with the Claude MCP add command. There are two main types. HTTP servers are for remote services. These are hosted by the service provider and connect over the network. STDIO servers are for local processes that run on your machine. You can manage your servers with the /mcp inside a Claude code session to see what's connected, the status, and disable servers that you don't want to use. MCP servers can be scoped in three different ways. One, local means it's only available in the current project for you. Two, the user, which means it's available across all your projects. And three, project scope uses a .mcp.json file that you check into your version control, so anyone working on the code base gets the exact same servers automatically. Now, one thing to be aware of is that MCP servers add tool definitions to your context window, even when you're not using them. So, if you have a lot of servers configured, this eats into your available context. Run the {slash} MCP command to see what's connected and disable anything that you're not actively using or don't think that you're going to use. If a tool has a CLI equivalent like GH for GitHub or AWS for AWS, the CLI is more context efficient because it doesn't add persistent tool definitions. You also might benefit from using a skill in this scenario. A skill has a name and a description that is loaded into context. Similar to MCP, when Cloud thinks it needs to use that skill, it then decides to load it into the context window, which is where you could put the command line interface tools. If your MCP tools exceed 10% of your context window, Cloud code will automatically switch to tool search mode, which will discover the right tools on demand, but this might not work as well since it's just not in the context. >> [music] >> Now, a quick recap. MCP connects Cloud code to your external tools and data sources. >> [music] >> Add servers with Cloud MCP add, scope them to your project with .mcp.json so that your team gets them automatically, and keep an eye on the context usage by disabling servers [music] that you're not actively using.

Model Context Protocol (MCP) is an open standard that lets Claude Code connect to external tools and data sources. When you ask a question, Claude automatically understands when it should use those tools to better handle your query.

A lot of your context lives outside your codebase — in databases, productivity apps, or public repositories. MCP bridges that gap.

## What Can You Do With It?

First, it's important to understand the concept of "tools" in agentic AI. Tools give agents like Claude Code the ability to perform actions that help them complete tasks more effectively. This is different from typical AI, where you just get a text response back.

For example, if your team uses Linear for project management, you can add a Linear MCP server to bring in the details of your specific issues. If you need up-to-date documentation for a dependency, a docs MCP server like Context7 can provide that to Claude Code.

## Adding an MCP Server

You can add MCP servers with the claude mcp add command. There are two main types:

- HTTP servers are for remote services. These are hosted by the service provider and connect over the network.
 
- Stdio servers are for local processes that run on your machine.

You can manage your servers with /mcp inside a Claude Code session to see what's connected, check status, and disable servers you don't need.

## Scoping Servers

MCP servers can be scoped in three ways:

- Local — only available in the current project, just for you.
 
- User — available across all your projects.
 
- Project — uses a .mcp.json file that you check into version control so anyone on the codebase gets the exact same servers automatically.

## Context Costs

MCP servers add tool definitions to your context window — even when you're not actively using them. If you have a lot of servers configured, this eats into your available context. Run /mcp to see what's connected and disable anything you're not actively using.

If a tool has a CLI equivalent (like gh for GitHub or aws for AWS), the CLI is more context-efficient because it doesn't add persistent tool definitions.

You might also benefit from using a Skill instead. A Skill has a name and description loaded into context, and Claude only loads the full skill contents when it determines it needs to use it.

If your MCP tools exceed 10% of your context window, Claude Code automatically switches to tool search mode, which discovers the right tools on demand — though this may not work as reliably.

## Recap

MCP connects Claude Code to your external tools and data sources. Add servers with claude mcp add. Scope them to your project with .mcp.json so your team gets them automatically. And keep an eye on context usage by disabling servers you're not actively using.


---

# Lección: Hooks  (Customizing Claude Code)
## Hooks

[VIDEO — transcripción]
Hooks let you run commands at different points in Claude code's life cycle. The key difference between hooks and everything else we covered is that hooks are deterministic. They always run. So, put it this way. You can tell Claude in your claude.md file to run prettier after every file edit and most of the time it will do that, but sometimes it won't. It's not perfect. But a hook makes it happen every single time with no exceptions. Common use cases could include auto formatting after file edits, logging all executed commands for compliance, blocking dangerous operations like modifying production files, and sending yourself notifications when Claude finishes a task. Hooks are configured in your settings.json file. You pick an event, optionally set a matcher for which tool it applies to, and provide a command to run. User prompt submit runs when you submit a prompt before Claude processes it. Pre-tool use which runs before a tool call. Post-tool use runs after a tool call completes. Notification runs when Claude sends a notification, and stop runs when Claude finishes responding. The most common hook. Auto formatting after edits. You set a post-tool use hook with a matcher of edit or multi-edit, right? So, it fires whenever Claude modifies a file. The command checks the file extension and runs the appropriate formatter. This could be prettier for TypeScript, Go format for Go, Ruff for Python, whatever your project uses. Pre-tool use hooks can block tool calls before they execute. So, your hook receives a tool name and input as JSON on stdin. If it exits with code two, the action is blocked and the stderr message gets fed back to Claude as feedback so Claude knows why it was blocked and can adjust. Exit code zero means proceed. Exit code two means block. This is how you enforce hard rules. Block writes to a production config directory, block bash commands that contain rm -rf, block commits to main, whatever your team needs to be guaranteed, not suggested. Hooks configured in .Claude/settings.json are project level and can be checked into your repo. This means that your entire team gets the same hooks automatically. Use the Claude project dir environment variable in your commands to reference scripts stored in your project so they work regardless of Claude's current working directory. >> [music] >> Hooks gives you deterministic control over Claude code's behavior. >> [music] >> Use post-tool-use for auto-formatting and logging. Use pre-tool-use to block dangerous operations. Configure them in the /hooks or in settings.json >> [music] >> and check them into your repository so your team gets them, too. If something needs to happen every time without fail, don't put it in a prompt. Put it in a hook. >> [music]

Hooks let you run commands at specific points in Claude Code's lifecycle. The key difference between hooks and everything else covered in this course is that hooks are deterministic — they always run.

## Why Use Hooks

You can tell Claude in your CLAUDE.md to run Prettier after every file edit. Most of the time it will. But sometimes it won't. A hook makes it happen every single time, no exceptions.

Common use cases include:

- Auto-formatting after file edits
 
- Logging all executed commands for compliance
 
- Blocking dangerous operations like modifying production files
 
- Sending yourself notifications when Claude finishes a task

## How They Work

Hooks are configured in your settings.json. You pick an event, optionally set a matcher for which tools it applies to, and provide a command to run. The available events are:

- PreToolUse — runs before a tool call
 
- PostToolUse — runs after a tool call completes
 
- UserPromptSubmit — runs when you submit a prompt, before Claude processes it
 
- Stop — runs when Claude finishes responding
 
- Notification — runs when Claude sends a notification

You configure them through the /hooks command inside Claude Code, or by editing settings.json directly.

## A Practical Example

The most common hook: auto-formatting after edits. Set a PostToolUse hook with a matcher of "Edit|MultiEdit|Write" so it fires whenever Claude modifies a file. The command checks the file extension and runs the appropriate formatter — Prettier for TypeScript, gofmt for Go, whatever your project uses.

## Blocking with PreToolUse

PreToolUse hooks can block tool calls before they execute. Your hook receives the tool name and input as JSON on stdin. The exit code determines the behavior:

- Exit code 0 — proceed normally.
 
- Exit code 2 — block the action. The stderr message gets fed back to Claude as feedback so it knows why it was blocked and can adjust.
 
- Any other exit code — a non-blocking error that gets shown to you but doesn't stop anything.

This is how you enforce hard rules. Block writes to a production config directory. Block bash commands that contain rm -rf. Block commits to main. Whatever your team needs to be guaranteed, not suggested.

## Sharing Hooks with Your Team

Hooks configured in .claude/settings.json are project-level and can be checked into your repo. This means your entire team gets the same hooks automatically. Use the CLAUDE_PROJECT_DIR environment variable in your commands to reference scripts stored in your project, so they work regardless of Claude's current working directory.

## Recap

Hooks give you deterministic control over Claude Code's behavior. Use PostToolUse for auto-formatting and logging. Use PreToolUse to block dangerous operations. Configure them with /hooks or in settings.json. And check them into your repo so your team gets them too.

If something needs to happen every time without fail, don't put it in a prompt. Put it in a hook.


---

# Lección: Course quiz  (Quiz)
## Course quiz
Tus respuestas del quiz (✔ = correcta).

Question 1: 
(acertaste)

Claude Code works as an AI agent. What is an AI agent?

A chatbot that responds to questions in real time

A code editor with built-in autocomplete features

A cloud service that hosts your development projects

✔ AI that takes action to complete goals

Question 2: 
(acertaste)

What happens when Claude Code reaches its context window limit?

It switches to a smaller, faster model to save memory

It removes your oldest files to make room for new ones

✔ It automatically compacts your conversation to free up space

It stops working and asks you to restart the session

Question 3: 
(acertaste)

What is the recommended workflow for using Claude Code effectively?

Code → Test → Deploy → Monitor

✔ Explore → Plan → Code → Commit

Write → Review → Merge → Ship

Prompt → Accept → Push → Repeat

Question 4: 
(acertaste)

How does Claude Code use the CLAUDE.md file?

It reads it only after you run the /init command

It reads it once when you first create the project

✔ It reads it automatically at the start of every session

It only reads it when you explicitly ask it to

Question 5: 

How satisfied are you with the content provided in this course?

Not at all satisfied

Not very satisfied

Unsure

Satisfied

Very satisfied

Question 6: 

How likely are you to recommend this course to a friend or coworker?

Very unlikely

Unlikely

Not sure

Likely

Very likely

Question 7: 
(acertaste)

Is there any feedback you'd like to provide based upon your experience with this course so far?

Your response:

Great course
