{
  "doc": {
    "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": "/llm/markdown/api/commands/debug.md",
    "version": "3cf5b86b3403f604bdf7f3e35025c3bc3865e02c",
    "updated_at": "2026-05-07T17:44:31.931Z",
    "headings": [
      {
        "id": "api/commands/debug#debug",
        "text": "debug",
        "level": 1
      },
      {
        "id": "api/commands/debug#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/debug#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/debug#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/debug#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/debug#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/debug#debug",
        "text": "Debug",
        "level": 3
      },
      {
        "id": "api/commands/debug#pause-with-debugger-after-get",
        "text": "Pause with debugger after .get()",
        "level": 4
      },
      {
        "id": "api/commands/debug#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/debug#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/debug#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/debug#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/debug#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/debug#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/debug#syntax",
      "doc_id": "api/commands/debug",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.debug().debug(options)// ---or---cy.debug()cy.debug(options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.debug().getCookie('app') // Pause to debug at beginning of commandscy.get('nav').debug() // Debug the `get` command's yield\n```\n\n### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.debug()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.debug()` yields the same subject it was given from the previous command.\n*   `.debug()` is a query, and it is _safe_ to chain further commands.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/debug.json",
      "token_estimate": 136
    },
    {
      "id": "api/commands/debug#arguments",
      "doc_id": "api/commands/debug",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.debug()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/debug.json",
      "token_estimate": 57
    },
    {
      "id": "api/commands/debug#yields-learn-about-subject-management",
      "doc_id": "api/commands/debug",
      "heading": "Yields Learn about subject management",
      "heading_level": 3,
      "content_markdown": "### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.debug()` yields the same subject it was given from the previous command.\n*   `.debug()` is a query, and it is _safe_ to chain further commands.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/debug.json",
      "token_estimate": 43
    },
    {
      "id": "api/commands/debug#rules",
      "doc_id": "api/commands/debug",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `.debug()` can be chained off of `cy` or off another command.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `.debug()` is a utility command.\n*   `.debug()` will not run assertions. Assertions will pass through as if this command did not exist.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.debug()` cannot time out.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/debug.json",
      "token_estimate": 77
    },
    {
      "id": "api/commands/debug#command-log",
      "doc_id": "api/commands/debug",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Log out the current subject for debugging_**\n\n```\ncy.get('.ls-btn').click({ force: true }).debug()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on the `debug` command within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/debug.json",
      "token_estimate": 55
    }
  ]
}