Follow Discord
Sweep 30 Oct 2026 · 01:02Z Build v2.1.314 532 read Stable v2.1.308 Latest v2.1.314 Next v2.1.314 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · claude-docs

One read of Claude Documentationclaude-docs-20261029T230705Z

4 pages moved out of 281 read.

Pages moved 4 significant first
Pages read 281 in this capture
Captured 23:07 UTC
Corpus hash 40593d0b879e corpus-hash

What this read moved

1-4 of 4

third-party/claude-desktop/gateway Changed · +49 / -0 lines

## Block requests at a spend limit ### Write the spend limit message ### Other status codes at a spend limit ### Warn users before the spend limit

from line 553
553553>
554554> Setting `toolSearchEnabled` causes sessions to send experimental request headers and fields to your gateway or provider. On gateway deployments running Claude Desktop 1.40609.0 or later this is only the tool-search request shape (the `tool-search-tool-2025-10-19` value in the `anthropic-beta` header, deferred tool loading, and `tool_reference` content blocks), and every other experimental Claude Code beta stays off. On earlier versions, on Microsoft Foundry, and on providers behind a custom base URL, the key instead lifts the experimental-beta suppression for these sessions, so requests also carry Claude Code's other experimental beta headers and fields for that provider. Enable it only if your gateway forwards and accepts what it will receive; when it does not, requests fail with HTTP 400. LiteLLM in passthrough mode and Cloudflare AI Gateway both forward `anthropic-beta` headers and `tool_reference` content blocks.
555555 
556## Block requests at a spend limit
557 
558To show users your own message when your gateway blocks them at a budget or spend limit, return HTTP `402` with the message in a [Messages API error body](https://platform.claude.com/docs/en/api/errors#error-shapes):
559 
560```json theme={null}
561{
562 "type": "error",
563 "error": {
564 "type": "billing_error",
565 "message": "You reached your monthly spend limit of $500. Ask your manager for an increase."
566 }
567}
568```
569 
570Claude Desktop doesn't retry a `402`. Once your gateway accepts requests again, the user's next message in the same session goes through.
571 
572Cowork, Chat, and Code show a **Billing issue** card, with your message below the app's own explanation.
573 
574![Cowork card titled Billing issue. The app's explanation reads: You won't be able to start tasks until your IT team adds credits or updates billing. Below it, in monospace, is the gateway's message: You reached your monthly spend limit of \$500. Ask your manager for an increase.](https://mintcdn.com/claude-ai/_XP3pgAHpW92TgGc/images/third-party/gateway-billing-issue-card.png?fit=max\&auto=format\&n=_XP3pgAHpW92TgGc\&q=85\&s=b54737876348e2fa4f53a0adc5d01a1d)
575 
576The Billing issue card in Cowork, with an example gateway message in monospace.
577 
578> [!NOTE]
579>
580> The **Billing issue** card in Cowork and Chat requires Claude Desktop 4.4212.0 or later. In earlier versions, both show your message in a **Something went wrong** card with a **Try again** button.
581 
582### Write the spend limit message
583 
584Keep `error.message` short and say who can raise the limit. The **Billing issue** card shows your message as plain text, so a URL or email address in it isn't clickable. To give users a clickable HTTPS link, set `linkUrl` on the [`banner`](https://claude.com/docs/third-party/claude-desktop/configuration#banner), the notice across the top of the app window.
585 
586Avoid phrases from the app's own error messages, such as "usage limit", "hit your limit", "hit your monthly limit", "out of usage", and "credit balance is too low". If your message contains one, the app can show its own card or text instead.
587 
588### Other status codes at a spend limit
589 
590With these status codes, users see a general error or a card about a different problem, and Code's card hides or drops your message.
591 
592* **`429`**: Claude Desktop can retry for about three minutes or longer before it shows an error, unless the response carries `x-should-retry: false`. Code then shows **Server is temporarily limiting requests**.
593* **`401` or `403`**: Code shows a card about credentials, sign-in, or permissions.
594* **`400`**: Code shows **Invalid request**.
595 
596### Warn users before the spend limit
597 
598To tell users where they stand before your gateway blocks them, show one line of text in one of these places:
599 
600* **Across the top of the app window**: set the [`banner`](https://claude.com/docs/third-party/claude-desktop/configuration#banner) configuration key to show a one-line notice. If you serve configuration per user, for example from a [bootstrap server](https://claude.com/docs/third-party/claude-desktop/bootstrap.md), each user's notice can show their own figure, such as "You have used 82% of your monthly budget." On a self-hosted install, set `banner` in [the document your session host reads](https://claude.com/docs/third-party/claude-desktop/configuration-format.md#configuration-on-a-self-hosted-install).
601* **Above the message box**: set up a [status line](https://claude.com/docs/third-party/claude-desktop/status-line.md). Claude Desktop runs a program that you install on the user's device and shows the line it prints.
602 
603Claude Desktop can also limit each user's tokens, separately from your gateway's budget, and warn users before they reach that limit. To set up the limit and check where it applies, see the [token limit keys](https://claude.com/docs/third-party/claude-desktop/configuration.md#inferencemaxtokensperwindow) in the configuration reference.
604 
556605## Troubleshoot
557606 
558607**`gateway SSO: server does not advertise device_authorization_endpoint`** — The app could not read your `inferenceGatewayOidc` value, so it fell back to treating the gateway itself as the sign-in server. Almost always this means the value is missing or not valid JSON, for example because it was written as separate dotted keys instead of one `inferenceGatewayOidc` value. Re-export from the in-app configuration window, or copy the `.mobileconfig` snippet above.

third-party/claude-desktop/status-line New page · 159 lines, new page

# Show a status line ## Turn on the status line ## Write the status line program ### Sample status line programs ## When the status line updates ## Troubleshoot a missing status line

A whole new page. There's nothing to diff it against, so here is what it says.

# Show a status line

> Show a status line above the message box in Claude Desktop on 3P: one line of your organization's own text, such as budget used, from a program you install

The status line is one line of your organization's own text, such as budget used or a data-handling label, above the message box in Cowork, Chat, and Code sessions. [Claude Desktop on third-party (3P)](https://claude.com/docs/third-party/claude-desktop/overview.md) runs a program that you install on the user's device and shows the first line the program prints.

![The Claude Desktop message box. Above it, right-aligned in small gray text, a ten-square bar and the words 82% of \$500 used this month. The first eight squares and the 82% are colored.](https://mintcdn.com/claude-ai/_XP3pgAHpW92TgGc/images/third-party/status-line-budget.png?fit=max\&auto=format\&n=_XP3pgAHpW92TgGc\&q=85\&s=1b85b3f879c80bb9cd03b7c192bf92fd)

A status line that shows budget use, with made-up data.

> [!NOTE]
>
> These cases are covered on other pages:
>
> * **A notice across the top of the app window, with no program to install**: set the [`banner`](https://claude.com/docs/third-party/claude-desktop/configuration#banner) key
> * **Your own message when your gateway blocks a user at a spend limit**: see [Block requests at a spend limit](https://claude.com/docs/third-party/claude-desktop/gateway.md#block-requests-at-a-spend-limit)

## Turn on the status line

The status line requires Claude Desktop 4.4212.0 or later and is off until you set the [`sessionStatusLine`](https://claude.com/docs/third-party/claude-desktop/configuration#sessionstatusline) key. The status line isn't available on a [self-hosted install](https://claude.com/docs/third-party/claude-desktop/configuration-format.md#configuration-on-a-self-hosted-install).

**1. Install the program**

Put the program where users can't change it. Claude Desktop runs it only from a location that meets these rules:

* **macOS and Linux**: root owns the file and every parent folder, with no write access for group or others
* **Windows**: the file is under `Program Files` or `Program Files (x86)` on the drive where Windows is installed

To try the [macOS and Linux sample](#sample-status-line-programs) on a test device, save it as `status-line` and run these commands in your terminal:

```bash theme={null}
sudo mkdir -p /opt/example/bin
sudo cp status-line /opt/example/bin/status-line
echo "410 500" | sudo tee /opt/example/budget.txt
sudo chown -R 0:0 /opt/example
sudo chmod 755 /opt/example /opt/example/bin /opt/example/bin/status-line
sudo chmod 644 /opt/example/budget.txt
```

**2. Set the key**

Set the key's `command` field to the program's full path, with no arguments or shell syntax:

```json theme={null}
{ "sessionStatusLine": { "command": "/opt/example/bin/status-line" } }
```

In JSON, double each backslash in a Windows path:

```json theme={null}
{ "sessionStatusLine": { "command": "C:\\Program Files\\Example\\status-line.ps1" } }
```

Add the key to the same [configuration source](https://claude.com/docs/third-party/claude-desktop/configuration-format.md#which-configuration-source-applies-on-a-device) as your other keys.

* **macOS profile or Windows registry**: write the value as a [JSON string](https://claude.com/docs/third-party/claude-desktop/configuration-format.md#value-types-in-a-profile-or-registry-policy)
* **Bootstrap server**: the key applies after the user approves it in a dialog, unless the device [trusts the server's values without prompting](https://claude.com/docs/third-party/claude-desktop/bootstrap.md#keys-that-require-user-consent)

**3. Restart Claude Desktop and check the line**

Quit and reopen Claude Desktop, then open an existing session, or start a new one and send a message. The line appears above the message box.

## Write the status line program

Claude Desktop starts the status line program with no arguments and no window, as the user who runs Claude Desktop.

* **File type**: on macOS and Linux, an executable file, such as a compiled program or a script that starts with `#!`. On Windows, an `.exe` file or a `.ps1`, `.cmd`, or `.bat` script. A `.ps1` script runs in Windows PowerShell, not PowerShell 7.

* **Input**: one line of JSON on standard input, with the session ID and the model. A field with no value is left out, so handle a missing `model`.

  ```json theme={null}
  {"session_id":"local_1f0c2a9e-7b3d-4c58-9a16-5e2d8b40c7f3","model":{"id":"claude-sonnet-4-5","display_name":"Claude Sonnet 4.5"}}
  ```

* **Output**: the first non-empty line of standard output, up to 200 characters. Markup and links show as plain text. A line wider than the message box ends in "…" and shows in full on hover.

* **Colors**: text is gray by default. ANSI codes `31` to `36` and `91` to `96` show red, green, yellow, blue, magenta, and cyan, in shades that fit the light or dark theme, and `0` or `39` returns to gray. Other colors show gray, and codes such as bold have no effect.

* **Paths**: the working directory is `/` (`System32` on Windows). `PATH` is `/usr/bin:/bin:/usr/sbin:/sbin`, or the System32, Windows, and Windows PowerShell folders on Windows, so call other tools by their full path.

* **Environment**: the app's variables, minus `ANTHROPIC_*`, `CLAUDE_*`, `ELECTRON_*`, and variables that make an interpreter load code, such as `PYTHONPATH`.

* **Time limit**: 10 seconds, after which Claude Desktop stops the program and anything it started. On Windows, the time PowerShell takes to start counts toward the limit.

### Sample status line programs

Both samples print a budget line, `■■■■■■■■□□ 82% of $500 used this month`. The macOS and Linux sample reads its numbers from a file that your own scheduled job keeps up to date. The Windows sample prints fixed numbers and shows how a PowerShell script prints UTF-8, reads the input, and writes the escape character.

**macOS and Linux**

```sh theme={null}
#!/bin/sh
# Prints, for example: ■■■■■■■■□□ 82% of $500 used this month
# Your own scheduled job keeps this file up to date. It holds dollars used and
# the limit as two whole numbers, for example: 410 500
BUDGET_FILE=/opt/example/budget.txt

# Unless the file holds two whole numbers, print nothing so no line shows.
[ -r "$BUDGET_FILE" ] || exit 0
read -r used limit < "$BUDGET_FILE"
case "$used" in ''|0?*|*[!0-9]*) exit 0 ;; esac
case "$limit" in ''|0*|*[!0-9]*) exit 0 ;; esac

percent=$((used * 100 / limit))
if [ "$percent" -ge 90 ]; then color=31      # red
elif [ "$percent" -ge 70 ]; then color=33    # yellow
else color=32                                # green
fi

full="" empty=""
for step in 10 20 30 40 50 60 70 80 90 100; do
  if [ "$percent" -ge "$step" ]; then full="${full}■"; else empty="${empty}□"; fi
done

printf '\033[%sm%s\033[0m%s \033[%sm%s%%\033[0m of $%s used this month\n' \
  "$color" "$full" "$empty" "$color" "$percent" "$limit"
```

**Windows**

```powershell theme={null}
# Print UTF-8, so that characters outside ASCII show correctly.
[Console]::OutputEncoding = New-Object Text.UTF8Encoding $false

# Read the session data, one line of JSON. Use fields such as $session.model.display_name.
$line = [Console]::In.ReadLine()
$session = $line | ConvertFrom-Json

# Fixed numbers keep the sample short. Replace them with your own budget data.
$esc = [char]27
$yellow = $esc + '[33m'
$reset = $esc + '[0m'
$full = ([string][char]0x25A0) * 8
$empty = ([string][char]0x25A1) * 2
$bar = $yellow + $full + $reset + $empty
Write-Output ($bar + ' ' + $yellow + '82%' + $reset + ' of $500 used this month')
```

## When the status line updates

Claude Desktop runs the status line program at these moments:

* A session opens
* Claude finishes a turn
* The user picks another model
* The app regains focus

There's no timer, so new data shows the next time one of these happens.

If the program fails, prints nothing, or takes longer than 10 seconds, the line disappears and the user sees no error. The next successful run brings the line back.

## Troubleshoot a missing status line

Search `main.log` in the [logs directory](https://claude.com/docs/third-party/claude-desktop/data-storage.md#where-data-lives) on the user's device for `sessionStatusLine`. One entry can stand for many failures of the same kind, and the entries don't include the program's output.

* **`was not run`**: fix the cause the entry gives, such as a folder that users can write to or a Windows path outside `Program Files`
* **`ended with exit code 127`**: a command that the script runs wasn't found, so call each tool by its full path
* **`was stopped after 10 seconds`**: the program hit the [time limit](#write-the-status-line-program). On Windows, a `.ps1` script can be slow to start in the first minutes after Claude Desktop first launches. If the line appears after a later turn ends or the app regains focus, nothing needs fixing.
* **No entry**: the program printed nothing, which isn't logged, or the key hasn't reached the app. Restart Claude Desktop and check [which configuration source applies](https://claude.com/docs/third-party/claude-desktop/configuration-format.md#which-configuration-source-applies-on-a-device).

third-party/claude-desktop/configuration Changed · +1 / -0 lines

from line 4028
40284028* [Unified Claude](https://claude.com/docs/third-party/claude-desktop/unified-claude.md#how-unified-claude-interacts-with-chat-and-cowork-settings): how `desktopHome` overrides the other keys under **Chat surface** and **Cowork surface**.
40294029* [Automatic deletion of idle sessions](https://claude.com/docs/third-party/claude-desktop/data-storage.md#automatic-deletion-of-idle-sessions): which key under **Session retention** covers a conversation started from the home screen.
40304030* [Skill scanning](https://claude.com/docs/third-party/claude-desktop/extensions.md#skill-scanning): what `skillScanningEnabled` turns on, which model runs a scan, and what users and your collector see.
4031* [Status line](https://claude.com/docs/third-party/claude-desktop/status-line.md): where to install the program that `sessionStatusLine` runs, what the program receives, and what it can print.
40314032 
40324033### Recommended security profiles
40334034 

third-party/claude-desktop/feature-matrix Changed · +1 / -0 lines

from line 64
6464> * [Endpoint or gateway configuration](https://claude.com/docs/third-party/claude-desktop/configuration.md#connection)
6565> * [Skills, hooks, and plugins distribution](https://claude.com/docs/third-party/claude-desktop/extensions.md#organization-plugins-admin)
6666> * [Skill scanning](https://claude.com/docs/third-party/claude-desktop/extensions.md#skill-scanning)
67> * [Status line](https://claude.com/docs/third-party/claude-desktop/status-line.md)
6768> * [MCP server allowlist](https://claude.com/docs/third-party/claude-desktop/extensions.md#controlling-user-extensions)
6869> * [Feature toggles](https://claude.com/docs/third-party/claude-desktop/configuration.md#capabilities)
6970> * [Auto-updates](https://claude.com/docs/third-party/claude-desktop/installation.md#updates)
Feedback