Claude product-family mark

Anthropic · Coding assistant

Claude Code

Official website

Understanding a failure often means following it across several files: the code that sends a request, the code that catches the error and the test that claims to cover it. Claude Code can help trace that route. Anthropic’s coding assistant reads project files, edits code and runs development commands from a terminal, so you can ask a question and then work on the answer in the same session. It is a practical option when Claude access already fits your team and you want help moving between an explanation of the code and a change you can test.

Ready guideDocumentation checked
In this guide 7 sections

Is it for you?

When it helps

  • Tracing a bug across the files involved, rather than reading each file in isolation
  • Adding or improving a test once you know which behavior it needs to check

When to choose something else

  • Source code that your organization does not allow the selected model service to process
  • Treating an approved tool call or one passing test as enough to release a change. The project’s wider checks and review still apply

Before you start

  • A project you can inspect, a terminal and an internet connection
  • A supported operating system, including macOS 13+, supported Linux distributions or Windows 10 1809+. Check the setup guide for hardware and platform details
  • Claude Code access through an eligible Claude plan, a Console account or a supported provider

Cost and access

Installing the program does not by itself provide model access. Subscription and API-backed sessions have different allowances and billing, so check which account Claude Code is using. The cost guide explains the arrangements and how to keep track of usage.

Check current access and pricing

Set it up

  1. Use the installer for your terminal

    The command below is the official installer for macOS, Linux and Windows Subsystem for Linux, or WSL. Native Windows users should use the PowerShell or CMD instructions in the quickstart. As with any installer that downloads a script, review it before running it.

    Terminal command
    curl -fsSL https://claude.ai/install.sh | bash
  2. Check the installation

    Open a new terminal and run claude --version. If it prints a version number, your shell can find the program. Keep that number with any notes about your setup, especially if you later need to investigate a change after an update.

    Terminal command
    claude --version
  3. Sign in from your project

    Run claude in the project directory and complete sign-in. Before requesting an edit, open /permissions to see the active mode. Depending on the version and settings, some modes can approve actions automatically; the session’s actual configuration determines which actions will pause for you.

    Terminal command
    claude

What happens when this request fails?

An API client is the part of an application that talks to another service. Its normal path may be easy to understand, while timeouts, rejected requests and other failures take different routes through the code. If you are investigating one of those failures, ask Claude Code to follow it through a single client. This keeps the question close to an actual debugging job and gives you files you can read alongside its answer.

What to ask

Trace how this API client handles a failed request, from the response or exception through to what the caller receives. Point me to the source and tests for each part. Where is that behavior unclear or untested? Explain any test you would add, and wait before changing files.

  1. Choose the client involved in your question and work on a disposable branch. Give Claude Code the failure you are investigating, such as a timeout or a particular error response. Run the existing checks first so you know whether the project starts in a working state.
  2. Follow the explanation in the cited files. Pay particular attention to where an error is caught, changed or passed on to the caller. If the answer skips a step, ask about that step before moving to a fix; it may be the part that explains the bug.
  3. When there is a genuine gap, ask for a test that supplies the failing response and checks what the caller receives. Read the test and the rest of the diff, then run the relevant checks. A passing test should demonstrate the intended error handling, rather than avoiding the code path you wanted to examine.

Before you rely on the result

You can now explain what happens to the failure as it travels through the client. If you add a test, you also know which part of that route it exercises. That makes it easier to discuss the fix with a colleague or investigate the next client without starting from scratch.

Go deeper

Keep the instructions you find yourself repeating

After a few similar jobs, you may notice that the same context is missing each time: where the client tests live, how to run them or what the project expects callers to receive. Those details are useful candidates for reusable instructions. The operational-skills guide explains how to turn a recurring task into something another person can understand and the assistant can repeat.

Read the guidance

Taking a code investigation into incident work

A source-level explanation can identify a plausible failure, but an incident also raises questions about what happened in the running service and whether it has recovered. The evaluation guide shows how to compare an assistant’s account with separate checks you control. It includes the cases where the available information leaves recovery unresolved.

Read the guidance

Other options to consider

Codex
Try the same investigation with Codex if OpenAI access and tooling already suit the project
Pi
Consider Pi when you need a different provider or want to customize the tools and instructions the assistant uses

Sources and review

Based on official documentation reviewed September 30, 2026. The example is illustrative; this guide does not report an installation, benchmark or production test.

Documentation checked

Back to all tool guides