> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getdecipher.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Integration

> Create, run, and fix AI-powered end-to-end tests from Claude Code.

## Overview

The Decipher QA CLI (`@decipher-sdk/decipher-qa`) connects Claude Code to Decipher so you can generate, run, and fix end-to-end tests without leaving your editor. Claude explores your codebase to understand pages, components, and routes, then generates step-by-step test instructions. Decipher's agent executes each step on a cloud-hosted browser, analyzes whether it ran correctly, captures screenshots, and returns detailed failure information when something goes wrong. When a test fails, Claude uses Decipher's analysis to diagnose the issue and fix the failing steps automatically.

After setup, use the `/decipher-qa` slash command in Claude Code to interact with Decipher.

## Quick Start

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm i -g @decipher-sdk/decipher-qa
    ```
  </Step>

  <Step title="Initialize your repository">
    Run `decipher-qa init` from anywhere inside your git repository:

    ```bash theme={null}
    decipher-qa init
    ```

    This sets up authentication, configures permissions, and installs the Claude Code skill.

    <Tip>
      Get your API token from [Settings > API Keys](https://app.getdecipher.com/settings?section=api-keys) in the Decipher dashboard.
    </Tip>
  </Step>

  <Step title="Launch Claude Code">
    Start Claude Code and use the `/decipher-qa` slash command:

    ```bash theme={null}
    claude
    ```

    Then type `/decipher-qa` followed by a test description — for example:

    ```
    /decipher-qa test CRUD operations for the todo creation page
    ```
  </Step>
</Steps>

## Capabilities

| Capability          | Description                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------- |
| AI test generation  | Claude explores your codebase and generates test steps from a natural-language description                          |
| Cloud execution     | Decipher's agent runs each step on a cloud-hosted browser — no local browser or driver setup needed                 |
| Step validation     | Decipher analyzes each step to verify it executed correctly, capturing screenshots and detailed diagnostics         |
| Auto-fix & resume   | When Decipher flags a failure, Claude uses the diagnostics to fix steps and resume without re-running the full test |
| Authenticated flows | Store login identities so tests can run behind authentication                                                       |
| Live test runs      | Trigger on-demand test runs from Claude Code                                                                        |

## Use Cases

| Use case                    | Example prompt                                                    |
| --------------------------- | ----------------------------------------------------------------- |
| Test a user flow end-to-end | `/decipher-qa test the signup flow through email verification`    |
| Test CRUD operations        | `/decipher-qa test creating, editing, and deleting a project`     |
| Test authenticated pages    | `/decipher-qa test the billing settings page as an admin user`    |
| Validate after a UI change  | `/decipher-qa run my checkout tests to make sure they still pass` |
| Set up login credentials    | `/decipher-qa create an identity for my test user on staging`     |

## Using the Slash Command

After setup, interact with Decipher through the `/decipher-qa` slash command in Claude Code.

### Creating a Test

<Steps>
  <Step title="Describe your test">
    Type `/decipher-qa` followed by a description — for example, "test CRUD operations on the settings page".
  </Step>

  <Step title="Claude generates steps">
    Claude explores your codebase, generates steps, and saves the test to Decipher.
  </Step>

  <Step title="Decipher validates">
    Decipher's agent executes each step on a cloud browser, analyzing whether it ran correctly.
  </Step>

  <Step title="Auto-fix failures">
    If Decipher flags a step failure, it returns diagnostics and screenshots. Claude uses that analysis to fix the failing steps and resumes validation.
  </Step>
</Steps>

<Tip>
  For authenticated flows, create an identity first: `/decipher-qa create an identity for my admin user`
</Tip>

### Managing Tests & Identities

| Prompt                                    | What it does                    |
| ----------------------------------------- | ------------------------------- |
| `/decipher-qa list my tests`              | Lists all tests                 |
| `/decipher-qa show test <name>`           | Displays test details and steps |
| `/decipher-qa delete test <name>`         | Removes a test                  |
| `/decipher-qa create an identity for ...` | Stores login credentials        |
| `/decipher-qa list identities`            | Shows saved identities          |
| `/decipher-qa run test <name>`            | Starts a test run               |

<Note>
  These are natural-language prompts. Claude interprets your intent and runs the appropriate CLI commands under the hood — you never need to run CLI commands directly.
</Note>

## Setup Reference

Running `decipher-qa init` performs the following actions in your repository:

* Creates skill files in `.claude/skills/decipher-qa/`
* Adds permission rules to `.claude/settings.json`
* Adds `.decipher/` to `.gitignore`
* Prompts for your API token (saved to `~/.decipher/qa-config.json`)

<Note>
  If skill files already exist, they are skipped. Use `decipher-qa init --force` to overwrite them.
</Note>

<Tip>
  You can re-authenticate at any time by running `decipher-qa login`.
</Tip>

## Updating the Package

To update to the latest version of the Decipher QA CLI:

```bash theme={null}
npm i -g @decipher-sdk/decipher-qa@latest
```

After updating the CLI, run init with the `--force` flag to update your skill files to the latest version:

```bash theme={null}
decipher-qa init --force
```

<Note>
  The `--force` flag ensures your skill files are always updated to match the latest CLI version.
</Note>

***

*Need help? [Contact our support team](mailto:team@getdecipher.com).*
