---
id: api/commands/debug
title: debug | Cypress Documentation
description: Set a `debugger` in Cypress and log what the previous command yields.
section: api
source_path: docs/api/commands/debug.mdx
version: fa8f60eba6ec9a949b75fe9f9f5f6591719cd01f
updated_at: '2026-05-05T21:21:10.048Z'
---
# debug

Set a `debugger` and log what the previous command yields.

You need to have your Developer Tools open for `.debug()` to hit the breakpoint.

## Syntax

```
.debug().debug(options)// ---or---cy.debug()cy.debug(options)
```

### Usage

**Correct Usage**

```
cy.debug().getCookie('app') // Pause to debug at beginning of commandscy.get('nav').debug() // Debug the `get` command's yield
```

### Arguments

**options _(Object)_**

Pass in an options object to change the default behavior of `.debug()`.

| Option | Default | Description |
| --- | --- | --- |
| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

*   `.debug()` yields the same subject it was given from the previous command.
*   `.debug()` is a query, and it is _safe_ to chain further commands.

## Examples

### Debug

#### Pause with debugger after `.get()`

```
cy.get('a').debug().should('have.attr', 'href')
```

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

*   `.debug()` can be chained off of `cy` or off another command.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

*   `.debug()` is a utility command.
*   `.debug()` will not run assertions. Assertions will pass through as if this command did not exist.

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

*   `.debug()` cannot time out.

## Command Log

**_Log out the current subject for debugging_**

```
cy.get('.ls-btn').click({ force: true }).debug()
```

The commands above will display in the Command Log as:

When clicking on the `debug` command within the command log, the console outputs the following:

## See also

*   [Cypress Cloud](https://on.cypress.io/cloud)
*   [`.pause()`](/llm/markdown/api/commands/pause.md)
*   [`cy.log()`](/llm/markdown/api/commands/log.md)
*   [`cy.screenshot()`](/llm/markdown/api/commands/screenshot.md)
