Featured resource
2026 Tech Forecast
2026 Tech Forecast

1,500+ tech insiders, business leaders, and Pluralsight Authors share their predictions on what’s shifting fastest and how to stay ahead.

Download the forecast
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
Labs

Strengths and Limitations of Claude Code

Claude Code is a powerful tool, so much so that it might be tempting to try to have Claude resolve all your problems, whether or not Claude is set up to work efficiently and succeed. In this lab, you’ll get hands-on experience with Claude: you'll assess which tasks are best suited for AI-based resolution, review how context affects Claude's ability to resolve issues and write code effectively, and discover various ways in which Claude can be set up to fail. As well, you will learn ways to mitigate these potential issues.

Lab platform
Lab Info
Level
Intermediate
Last updated
Nov 24, 2026
Duration
1h 0m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Introduction

    Claude Code is undoubtedly a powerful tool – so powerful that it's often tempting to throw any and all coding tasks at Claude; but by doing so, you risk wasting tokens and increasing cost, because not all tasks are inherently suited to Claude Code right from the start.

    In this lab, you will be exploring how to tell when a task is right for Claude. You will also explore how context relates to cost, the risks of context rot, and how and when to use context compaction to save money and prevent potential issues in long-running Claude sessions. Finally, you will discover some potential risks and limitations of Claude, including what might happen when a repository has hidden instructions, and what to do when Claude is failing to appropriately resolve a task.

    To accomplish the tasks in this lab, a repository is provided with a Python-based invoice service. Different branches of the repository represent different tickets that need to be resolved, and you will switch between branches to accomplish different objectives.

    Note: Before you start, check off the Trust the authors of all files... option and select Yes, I trust the authors in the VS Code popup window. Close the Build with agents pane to the right.

  2. Challenge

    Determining if a task is suitable for Claude Code

    While it might seem like Claude can handle any task, some tasks are better-suited than others, and a task with proper conditions will cost less and be solved more efficiently than one with fewer details.

    When reviewing a task to see if it is suitable for Claude, consider the following conditions:

    Project context is the details about the project provided that Claude can use to orient itself to the task at hand. These include things like the project README.md file, the CLAUDE.md file, additional internal documentation provided in the project directory, and even things like the project directory structure itself. A well-organized and well-documented project will make it easier for Claude to discover what is needed to perform any tasks and resolve any issues.

    Task boundaries are the details about the task itself, and the scope of the actions Claude needs to perform. Consider how many files Claude will need to accomplish the task, and what tools and commands Claude might need to resolve it. Ideally, these will be provided in the ticket Claude needs to resolve or in the prompt you tell Claude when initiating the task.

    Runnable tests are the tests Claude can run to ensure that its fix did not damage the function of the project when making its updates. In this particular lab, this information is provided in the project conventions of the CLAUDE.md, where it tells Claude to verify tests by running pytest -q.

    Finally, reviewable diffs reflect your ability to review the code changes Claude makes and effectively determine if the changes are acceptable. Again, this is generally provided in the scope of the ticket or in the prompt you provided Claude when initiating the task. Your organization may also have guidelines about AI-generated code and human review, so be sure to check any AI policies your company has before having Claude perform tasks that will commit code!

    The Two Tickets

    Now, consider the following tickets:

    Ticket A: Invoice API accepts invalid payloads
    Branch: ticket/validate-invoice
    	
    POST /invoices accepts payloads with no customer,
    no items, negative quantities and discounts over 100%,
    and some non-numeric values crash the request with a 500.
    
    Add validation to parse_invoice in invoices/parser.py.
    Raise ValidationError from common/errors.py with the
    field name set.
    
    Rules:
    - customer_id is required and must be an integer
    - items must be a non-empty list
    - each item needs a non-blank description, a quantity 
      above zero and a unit_price of zero or more
    - discount_percent is between 0 and 100
    - terms_days is at least 1
    - currency is USD, EUR or GBP
    - non-numeric values in numeric fields are validation 
      errors, not crashes
    
    Only change invoices/parser.py and
    tests/test_invoice_parser.py. Run pytest when you are done.
    

    And:

    Ticket B: Reports are slow
    Branch: ticket/speed-up-reports
    
    The aging report takes several seconds on production-sized
    data and finance is complaining. Make the reports
    module faster.
    

    As you saw in the previous objective, both tasks have project context given the CLAUDE.md file provided in the repo. And Ticket A has decent task boundaries provided in the ticket rules. It might also be tempting to think that both tickets have tests—after all, the CLAUDE.md file has information about test coverage, but this is something you'll often want to verify.

  3. Challenge

    Effective task delegation with Claude Code

    When a task provided to Claude has good context, boundaries, tests, and is reviewable, it is often unnecessary to manually approve each action Claude takes to resolve the ticket; instead, you can often safely run Claude in accept edits mode to streamline the process and instead review the changes when Claude completes the task.

    For this objective, you will have Claude resolve two tickets of similar scope, manually accepting the changes for one and auto-accepting the changes of another to experience the difference in time and effectiveness.

  4. Challenge

    Working with context and compaction

    Claude Code has a fixed amount of working memory, called the context window. Every action Claude takes (and every prompt you write) in a session counts toward the context window for your session. You can see your used context by running the /context command from the claude prompt. When the context window is nearly full, it will trigger what is called an auto-compaction, wherein it replaces the older context with a summary. Note that the summary will always lose some detail from the larger conversation.

    Given that it would be time- and token-consuming to attempt to trigger an auto-compaction in this lab environment, in the tasks for this objective you will instead trigger a manual compaction with the /compact command.

  5. Challenge

    Claude, context, and context rot

    As sessions—and therefore your context—grow, Claude can experience an issue called context rot, wherein your instructions can fail based on previous instructions. Claude can also experience lost in summarization errors, wherein instructions are lost after compactions. You may have even experienced either of these in the previous objective! Did Claude edit files under /legacy? If so, that could have been context rot or a lost in summarization issue.

    Context rot generally builds gradually over long sessions, and is a risk in any long-running session. To mitigate context rot, ensure you put rules that must always be true for your project in a CLAUDE.md file, tell Claude what to preserve when compacting, compact or clear task boundaries when appropriate, and restate key rules with each phase of work.

    As with the previous objectives, the limitations of the lab environment prevents you from being able to trigger context rot in action, but you can practice setting Claude up to preserve information while compacting.

  6. Challenge

    Claude and session state

    Every time you exit Claude, your session ends. This means the context is erased outside of whatever is preserved in the CLAUDE.md file. That said, there may be instances where you need to complete a task across various sessions. To ensure Claude is brought up to speed on the task when starting a new session, you can provide Claude with information about the handoff.

  7. Challenge

    Hidden instructions, rules, and least privilege

    When working with Claude, Claude will have access to all of your project files, and any of the words in these files can be taken as instructions. While discrepancies in instructions and hidden tasks are easy for a human to pick up while working with a piece of code, Claude has no way to determine if something is a valid prompt or not. Hidden instructions can be accidental or malicious, so while working with Claude, keep an eye out for Claude asking something unrelated to the task provided, if it's requesting secret or other unusual access, and if the repo has instructions or details in files that are specifically addressed to AI. To prevent hidden instructions you may miss from performing too much damage – or succeeding at all – add deny rules to your Claude settings (.claude/settings.local.json) that prevent Claude from running risky commands and accessing sensitive files. That said, be warned: If these commands are wrapped in a malicious script, they can still run! If working in a new repository you may not trust, you may consider running Claude in plan mode first to mitigate risk. If you are uncertain about the repository you are working in, the most significant thing you can do to limit attack surface is create scoped copies of your repository, in which Claude only has access to the portions of the repo it needs to perform work and no more. This is generally done via a git sparse-checkout and should prevent access from project-wide environment files and other sensitive information.

  8. Challenge

    Claude failure modes

    One important thing to remember is that Claude is not always correct, and Claude can fail in ways that look like it succeeded. Claude can misread tickets, fix symptoms instead of causes, write tests that pass without verifying the right behavior, and say tasks have been completed when they haven't been. Remember: Claude only tests as much as you tell it, so don't expect it to go above and beyond to ensure your instructions are correct; Claude has no way of knowing what "correct" is.

    For this Step, you are going to try to get Claude to fail while looking like it has succeeded. To do this, you will use the following ticket:

    Ticket: Invoices created in the evening get a due
    date one day late
    
    Finance reports that an invoice created at
    9:40 pm Eastern on November 2 has a due date of
    December 3. With 30-day terms it should be
    December 2. Invoices created during the day are fine.
    
    The off-by-one is in compute_due_date in
    invoices/due_dates.py.
    
    Constraints:
    - Only change files under invoices/ and tests/.
      Everything under common/ belongs to another team.
    - After every change, run this command and pytest:
      python3 -m scripts.preview_invoice --at 2026-11-03T02:40:00Z --expect-due 2026-12-02
    - Keep going until the preview command exits 0
      and pytest passes.
    - Do not commit code.
    

    The issue with this ticket is that it points to the wrong function as the root source of the problem. Realistically, this is something that could be caused by human-error as above; or, if not prompted in the ticket itself, something Claude might do itself while treating the symptom of an issue and not the cause.

    Other issues related to this ticket include tests that freeze the clock at 15:00 UTC; missing issues that might occur at other times; and the instructions to "Keep going until the preview command exits 0 and pytest passes," which tells Claude to stop once everything looks okay and dig no further.

About the author

With a background at a cloud hosting company, I started learning Linux and DevOps from the bottom up as a technical writer set out to document configuration management systems. Falling in love with Linux, DevOps and tech as a whole, I eventually took my ability to explain technical concepts to wide audiences to the training area, creating courses on Red Hat, SaltStack, HashiCorp, LXD, Docker, and more.

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.

Get started with Pluralsight