- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- AI
Introduction to Claude Code
Claude Code is an agentic AI-based coding assistant that can be used to audit, troubleshoot, and even write code. In this lab, you will get hands-on experience with using Claude Code by observing the agentic loop, using modes, managing manual and auto-approvals, setting up Claude to use existing test suites while coding, exploring Claude Code’s working memory and context both with and without the CLAUDE.md file, and using Skills.
Lab Info
Table of Contents
-
Challenge
Introduction
Claude Code lets you review, troubleshoot, and create coding projects using AI tooling. In this lab, you will get hands-on experience with Claude Code, observing how it works to understand and make changes to a code base, and practicing prompting for these tasks and changes. You will discover the agentic loop, leverage different approval modes, prep Claude Code to use test suites, experience Claude's context and working memory functions, and see how to use a Claude Skill to perform specific, rote tasks.
A small Python service that tracks inventory has been provided for use in this lab. If desired, review the service under the
inventorydirectory now ... or wait until it's time to prompt Claude to do it! -
Challenge
The agentic loop
When you ask Claude to perform a task, Claude enters the agentic loop: this is a cycle of behaviors where Claude reviews the given task, determines next steps, and then performs actions to resolve the task presented. These actions can involve running commands, code, and tests; querying for more information; observing application behavior; and a variety of other acts that let Claude "learn" what it needs to know to effectively complete the prompted action, including repeating and stopping actions.
-
Challenge
Approvals and approval modes
Notice the bottom of your Claude Code prompt: Claude should currently be in
manual mode. This means Claude will ask your permission to perform any actions that will affect change on your application. When asked to approve changes, you will have the option to accept or deny the changes, or approve all changes for the current session.Should you approve all changes for the current session, Claude will be able to alter your code base without prompting until you exit the Claude session.
-
Challenge
Claude and test suites
To best set Claude up for success when using it to troubleshoot, implement features, or otherwise make changes to your code, you should have Claude leverage existing test suites. This can be done by including information about these suites in your prompt, or by providing instructions regarding a code implementation workflow in your
CLAUDE.mdfile, which will be covered later. -
Challenge
Claude's working memory
Claude remembers previous parts of your session via its context window, which functions as a temporary workspace for holding conversation history and the actions it performed in relation to that history, as well as system prompts, tool definitions, and file contents read by Claude. You can view your active context usage via the
/contextcommand, which breaks down how the context is being used.Performance can drop and token-spend increase as the context for a session grows longer, wherein Claude begins to miss information stored in its context and otherwise degrade. To resolve this, you can run the
/compactcommand, which has Claude create a summary of the previous context that it can reference, ensuring your Claude session remains within the context window and working smoothly.Alternatively, if you wish to proceed in your session but have no need for the previous context, such as when you are working on a completely new feature or bug, you can clear the existing context via the
/clearcommand. -
Challenge
Creating standing context with a CLAUDE.md file
Every time you exit your Claude session, your working memory is lost. To ensure Claude can orient itself in your project every time you start a Claude session, you can leverage a
CLAUDE.mdfile within your project root to provide Claude standing context.The
CLAUDE.mdfile should instruct Claude on the project itself, including how it's built and expected coding styles and standards. It can also include workflow information about how Claude should interact with the project, such as telling it to create new git branches and always run the test suite when changing code.You can create the
CLAUDE.mdfile yourself, or have Claude generate one via the/initcommand. -
Challenge
Claude skills
Claude skills are folders that contain instructions, scripts, and resources for Claude to use when encountering or performing repetitive tasks. These can be found in the
.claude/skillsdirectory of your project. The skill itself is defined in aSKILL.mdmarkdown file -- much like how theCLAUDE.mdfile defines important information regarding your project to Claude's standing context.Creating a Claude skill for common tasks will improve Claude's consistency and performance when performing that task. You can view the current skills for your project via the
/skillscommand.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.