Skip to content
subcloakdocs

Debugging tools

Debugging tools

What Cloak Proxy's debugging tools do, how to open the Tools window, turn each tool on or off, and see which tools are active and which requests they changed.

Debugging tools change traffic while it passes through Cloak Proxy. You can pause a request and edit it, answer it from a local file, send it to another server, change its headers and bodies without code or with JavaScript, slow it down, block it, or replay recorded responses offline. Use them to test how your app handles errors, edge cases and bad networks without changing the app or the server.

Cloak Proxy has twelve tools. Each one has its own rules and its own on/off switch.

Tool What it does Default
Breakpoint Pauses matching requests or responses so you can edit them before they continue. On
Map Local Answers matching requests with a local file, folder, or a response you write. The server is never contacted. On
Map Remote Sends matching requests to a different scheme, host, port, path or query, such as staging instead of production, or /v1/* to a local server keeping the rest of the path (Swap the prefix). On
Rewrite Since 0.2.0 Changes headers, query parameters, the URL, body text or the status of matching requests and responses, without writing a script. On
Scripting Changes requests and responses with JavaScript: onRequest and onResponse. On
Block List Blocks matching requests with a 403 or by dropping the connection. On
Allow List Only records matching requests. Everything else still works but isn’t shown. Off
Network Conditions Slows matching requests down to test 3G, high latency or packet loss. Off
DNS Spoofing Connects a host name to a different IP address while keeping the URL and Host header. On
No Caching Strips caching headers so every request reaches the server with fresh data. Off
Mock Sets Replays recorded responses without the network, so you can demo, test or debug an app offline. On
Alerts Posts a macOS notification when matching traffic fails, slows down or returns something specific. On

A tool only does something when it’s on and has at least one enabled rule. No Caching has no rules: turning it on applies it to every request.

Since 0.4.0 Failure scenarios (Tools › Failure Scenarios…, ⌥ ⌘ F) have their own window: named groups of faults, such as a timeout or a reset connection, switched on and off together, with a log of what each did. See Failure scenarios.

All rules live in the Debugging Tools window.

  1. Choose Tools › Debugging Tools… or press ⌥ ⌘ 0.

    You can also click Tools (the wrench) in the main window’s toolbar and choose Debugging Tools….

  2. Pick a tool in the sidebar on the left.

  3. Add a rule with the + button at the bottom of the rule list, or with Add Rule when the list is empty.

  4. Fill in the rule on the right. Changes apply right away; there’s no Save button.

Seven tools also have their own shortcut in the Tools menu, which opens the window on that tool:

Menu item Shortcut
Edit Breakpoint Rules… ⌥ ⌘ B
Edit Map Local Rules… ⌥ ⌘ L
Edit Map Remote Rules… ⌥ ⌘ M
Edit Rewrite Rules… Since 0.2.0 ⌥ ⌘ R
Edit Scripting Rules… ⌥ ⌘ S
Edit Block List Rules… ⌥ ⌘ K
Edit Network Conditions Rules… ⌥ ⌘ T

The other tools have Edit … Rules… items in the same menu without a shortcut.

The Debugging Tools window: tools on the left, rules in the middle, the selected rule's editor on the right.

  1. Every tool. The icon is colored while the tool is on.
  2. How many rules the tool has.
  3. Green dot: the tool is on. Gray: off.
  4. The tool's On/Off switch.
  5. A rule. The checkbox turns just this rule on or off.
  6. Add, delete and duplicate rules, or add a folder. Rules run top to bottom; drag to reorder.
  7. Hide rules that are off
  8. Rule sets: switch groups of folders across tools
The Debugging Tools window with the Breakpoint tool selected, one rule for GET api.example.com/v1/users, and the rule editor on the right
Area What it shows
Sidebar (Debugging Tools) Every tool with its icon, the number of rules it has, and a green (on) or gray (off) dot. Below the tools, Rule Sets Since 0.4.0 lists your rule sets.
Header The tool’s name, a one-line summary of what it does, and the On/Off switch.
Rule list Each rule’s checkbox, name (or Untitled) and, under it, the method and URL it matches (or No URL yet). Right-click a rule for Duplicate and Delete.
Rule list buttons + adds a rule, − deletes the selected rule, and the third button duplicates it. Since 0.4.0 The fourth adds a folder, and the eye at the right hides rules that are off. Rules run top to bottom; drag to reorder.
Editor The selected rule’s settings. Every rule starts with a Rule section: a name and a matcher.

DNS Spoofing uses a table instead of a rule list, No Caching has only its switch, and Mock Sets lists recorded sets instead of rules. Their pages explain the differences.

Since 0.4.0 Rules can be grouped in folders, and the sidebar’s Rule Sets switch groups of folders across tools. The bottom bar’s tools popover has a Rule set picker. Any rule can also have conditions on headers, body values or GraphQL operations.

Each tool has one switch that turns all its rules on or off at once. Its rules stay saved while it’s off. You can flip the switch in several places:

  • The On/Off switch in the tool’s header in the Tools window.
  • Tools menu: a checkmark item for every tool.
  • The Tools toolbar button in the main window: the same list of toggles.
  • The N tools on button in the main window’s bottom bar: a popover with a switch for every tool. Since 0.2.2
  • Search Everything (⇧ ⌘ A): type the tool’s name and choose Turn On … or Turn Off ….

To pause a single rule, clear its checkbox in the rule list. A disabled rule is dimmed.

Rules and switches are saved and come back the next time you open Cloak Proxy.

Since 0.2.2

The bottom bar of the main window has one button for every debugging tool: N tools on counts the tools whose switch is on, in your accent color, or reads No tools on in gray.

  • Hover it to see the tools that are on and have at least one enabled rule (and No Caching while it’s on).
  • Click it for the Debugging tools popover: every tool with its icon, its name and an on/off switch. Click a tool’s name to open its rules in the Tools window, or Edit Rules… to open the Tools window.

While a request or response is paused at a breakpoint, the bottom bar also shows an orange N paused at breakpoint button that opens the Breakpoint window.

When a tool touches a request, the traffic list shows a colored badge before its path, with the tools separated by dots, for example Script · Map Remote. The labels are:

Badge Added when
Block List A Block List rule answered or dropped the request.
Rewrite Since 0.2.0 A Rewrite rule changed the request or its response.
Network Conditions A Network Conditions rule slowed or dropped it.
Script At least one script ran on the request or response.
Breakpoint The request or response paused at a breakpoint.
Map Local Map Local answered the request.
Mock A mock set answered it (with a recording or an offline 404).
Map Remote Map Remote rewrote the URL.
No Caching No Caching changed its headers.
DNS Spoofing The host was connected to a spoofed address.

The traffic list records the request as it was finally sent, after every change.

The quickest way to make a rule is from a request you already captured. Right-click a request in the traffic list and choose Tools, then a tool. Cloak Proxy creates a rule that matches that request, turns the tool on in most cases, and opens it in the Tools window. Rules and matching lists what each tool’s rule is prefilled with.

  • Tools › Export Rules… saves your rules to a JSON file, and Tools › Import Rules… adds rules from one. See Export and import rules.
  • cloakctl run --tools RULES.json loads an exported file for headless and CI runs.
  • The MCP server lets an AI assistant read and change rules with tools such as list_rules, upsert_rule, delete_rule, set_tool_enabled, rule_from_request, rule_folders, rule_sets and failure_scenarios, and resolve breakpoints with list_paused and resolve_paused. See the MCP tools reference.

When several tools match one request, they run in a fixed order: Block List first, then Rewrite’s request actions, then failure scenarios, then scripts and breakpoints, then Map Local, Mock Sets and Map Remote, then the server, then Rewrite’s response actions, then response scripts and breakpoints. The full order, and what each step can skip, is in Rule order and multiple tools.