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

# 疑難排解 /ship 和 /steward

> 查詢 `/ship` 或 `/steward` 的訊息或症狀：找不到命令、沒有提交或推送任何內容、watch 沒有啟動，或 watch 已停止。

[`/ship`](https://code.claude.com/docs/zh-TW/ship-command) 是一個 Claude Code 命令，會為您的變更開啟 GitHub pull request，並讓 Claude 審查它。之後 Claude 會從您的工作階段持續處理該 pull request。這項持續進行的工作稱為 watch。`/steward` 則會在已開啟的 pull request 上啟動 watch。

請在第一欄中找出發生的情況，或搜尋 Claude Code 所印出訊息中的文字：

| 發生的情況 | 前往 |
| :- | :- |
| `/ship` 不在 `/` 選單中，或 Claude Code 無法辨識它 | [您的工作階段中沒有 /ship](#%2Fship-isn’t-available-in-your-session) |
| 您輸入了命令，它印出一則訊息但沒有啟動 | [/ship 或 /steward 印出訊息且未啟動](#%2Fship-or-%2Fsteward-printed-a-message-and-didn’t-start) |
| 命令已執行，但沒有提交或推送任何內容 | [/ship 沒有提交或推送任何內容](#%2Fship-committed-or-pushed-nothing) |
| pull request 已開啟，但 Claude 沒有跟進處理 | [沒有啟動 watch](#no-watch-started) |
| Claude 原本在跟進處理，後來停止了 | [watch 已停止](#a-watch-stopped) |
| Claude 跟進處理期間出現了一則訊息 | [watch 期間的訊息](#messages-during-a-watch) |
| pull request 與您預期的不同 | [出乎預期的 pull request 結果](#pull-request-results-that-you-didn’t-expect) |
| 自訂的 `/ship` 或 `/steward` 命令無法運作 | [自訂的 /ship 或 /steward 命令不再載入](#a-custom-%2Fship-or-%2Fsteward-command-stopped-loading) |

## /ship 或 /steward 不存在或無法啟動

當命令沒有出現在選項中，或命令印出訊息時，請從這裡開始。

### 您的工作階段中沒有 /ship

`/ship` 不在 `/` 選單中、輸入它會啟動 `/code-review`，或您看到 `Unknown command: /ship`。雲端工作階段沒有 `/ship`。

在您自己的電腦上，請執行以下步驟：

1. 在 shell 中執行 `claude update`，然後結束並重新啟動 `claude`。
2. 如果仍然沒有 `/ship`，請再結束並啟動 `claude` 一次，因為新功能[可能需要第二次啟動](https://code.claude.com/docs/zh-TW/env-vars.md#first-session-after-an-install-or-upgrade)才會顯示。
3. 在 Claude Code 提示字元中執行 `/status`。其中的 `Setting sources` 行會列出已載入的設定。在其中屬於您自己的每個[設定檔](https://code.claude.com/docs/zh-TW/settings.md#find-or-create-your-settings-files)中，移除 [`disableBundledSkills`](https://code.claude.com/docs/zh-TW/settings-reference#disablebundledskills)，以及 [`skillOverrides`](https://code.claude.com/docs/zh-TW/skills#override-skill-visibility-from-settings) 底下任何 `ship-local` 項目。若要變更受管設定，請詢問您的管理員。
4. 檢查您的工作階段是否[略過功能旗標擷取](https://code.claude.com/docs/zh-TW/env-vars.md#features-that-need-feature-flag-fetching)，例如因為設定了 `DISABLE_TELEMETRY`，或您使用第三方供應商。在這些工作階段中無法使用 `/ship`。

### skillOverrides 項目關閉了 /ship 或 /steward

`Skill "ship-local" is disabled via skillOverrides`，或針對 `steward` 的相同訊息，表示您設定中的某個 [`skillOverrides`](https://code.claude.com/docs/zh-TW/skills#override-skill-visibility-from-settings) 項目關閉了該命令。請移除該項目。若要變更受管設定中的項目，請詢問您的管理員。

### /ship 或 /steward 印出訊息且未啟動

找出訊息開頭的文字：

| 訊息 | 處理方式 |
| :- | :- |
| `This session was started by another session` | 在您自己啟動的工作階段中執行 |
| `Usage: /ship` 或 `Usage: /steward` | 對照[引數](https://code.claude.com/docs/zh-TW/ship-command.md#arguments-for-%2Fship-and-%2Fsteward)檢查您輸入的內容 |
| `Nothing started. /ship starts only from a line that you type`，或針對 `/steward` 的相同訊息 | 請在 Claude Code 提示字元中自行輸入命令。它不會從 `claude -p` 或程式啟動 |
| `/ship didn't start:` 或 `/steward didn't start:` | 訊息的其餘部分會說明需要檢查的項目 |
| `/ship is turned off right now`，或針對 `/steward` 的相同訊息 | 依訊息所示，在 Claude Code 提示字元中執行 `/login`，然後再次執行該命令 |
| `/ship can't start from a queued message` 或 `/steward can't start from a queued message` | 等待 Claude 完成後，再次執行 |

### GitHub CLI 尚未就緒

`/ship` 和 `/steward` 透過 GitHub CLI `gh` 存取 GitHub：

| 訊息 | 處理方式 |
| :- | :- |
| `GitHub CLI (gh) isn't installed` 或 `GitHub CLI (gh) isn't signed in` | 安裝它，在 shell 中執行 `gh auth login`，然後再次執行該命令 |
| `gh couldn't tell me about a pull request here` | 括號中的文字會說明失敗的原因。若要查看 `gh` 本身的錯誤，請在 shell 中執行 `gh pr view`。其中一個原因是您檢出目錄的所有 remote 都不在 `gh` 已登入的 GitHub 主機上。若使用 GitHub Enterprise，請在 shell 中執行 `gh auth login --hostname HOST` |

## /ship 沒有提交或推送任何內容

在某些情況下，`/ship` 會將提交或推送交由您處理，並說明原因。其訊息可能以 `Nothing committed or pushed`、`Nothing pushed`、`I didn't push anything`、`There is no pull request to watch` 或 `This branch has no open pull request` 開頭。

找出您的情況，執行該列中的步驟，然後再次執行 `/ship`。在這些情況下，如果沒有推送任何內容且分支沒有 pull request，Claude 會審查您的變更，且[不會啟動 watch](#no-watch-started)。

### 公開儲存庫以及 /ship 不會提交的檔案

`/ship` 在提交之前會檢查儲存庫以及每個已變更檔案的名稱：

| 情況 | 處理方式 |
| :- | :- |
| `For a public repository /ship doesn't commit anything for you` | 在預設分支以外的分支上，自行提交您的工作 |
| 針對 `.env` 或 `password.txt` 等已變更的檔案出現 `By its name, this file may hold secrets` 或 `By their names, these files may hold secrets` | 如果檔案不含任何機密，請在預設分支以外的分支上自行提交您的工作。否則，請將它擱置，例如在 shell 中使用 `git stash push -u -- <file>` |
| 訊息列出了並非您建立的空檔案，例如 `.bashrc` 或 `.gitconfig` | 在 Linux 和 WSL2 上，當沙箱化命令執行時，[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)會在您的檢出目錄中保留空檔案。沙箱在命令結束前都需要這些檔案，因此在那之前請勿 stash、提交或刪除它們。停止該命令（例如從 [`/tasks`](https://code.claude.com/docs/zh-TW/commands#all-commands)），或等待它結束，沙箱就會移除這些檔案。如果在沒有沙箱化命令執行時這些檔案仍然存在，請[移除殘留的檔案](https://code.claude.com/docs/zh-TW/errors.md#stale-sandbox-mask-files-left-by-a-killed-session) |
| 您變更了用於設定 git、CI 或程式設計 agent 的檔案，例如 `.gitignore`、`CLAUDE.md`，或 `.github/` 底下的任何檔案 | 在預設分支以外的分支上，自行提交您的工作 |

### /ship 無法提交或推送的分支

`/ship` 需要一個它可以提交並推送的分支：

| 情況 | 處理方式 |
| :- | :- |
| `there is nothing here to open one for`：您沒有未提交的變更，且分支上的每個提交都已存在於預設分支上 | 進行變更，或檢出包含您工作的分支 |
| 預設分支包含您的提交，且沒有未提交的內容 | 將這些提交移到新分支，例如在 shell 中使用 `git switch -c <branch>` |
| 您處於 detached HEAD 狀態，或正在進行 rebase | 檢出一個分支，或完成 rebase |

### 禁止提交或推送的拒絕規則

[拒絕規則](https://code.claude.com/docs/zh-TW/permissions.md#manage-permissions)（例如 `Bash(git push *)`）可能會禁止提交、推送或開啟 pull request。如果設定該規則的人同意，請自行執行這些步驟。

watch 也需要 `git commit` 和 `git push`。如果規則禁止其中之一，請在再次執行 `/ship` 之前[請人移除它](#a-tool-rule-or-hook-blocks-a-watch)。

### GitHub Enterprise 與 fork

`/ship` 不會在 GitHub Enterprise 上或從 fork 開啟 pull request。請推送分支並自行開啟 pull request，然後執行 `/ship`。從 fork 進行時，檢出目錄還需要一個指向 pull request 目標儲存庫的 remote，否則不會啟動 watch。

## 沒有啟動 watch

watch 是 Claude 對您的 pull request 所進行的持續性工作，會在 `/ship` 審查完成後或您輸入 `/steward` 時啟動。在某些情況下，watch 不會啟動，而 Claude 會說明原因。其訊息可能包含 `/steward didn't start.`、`I can't watch` 或 `is running on pull request`。

修正原因後，輸入 `/steward` 以啟動 watch 而不進行第二次審查；如果分支仍然沒有 pull request，則輸入 `/ship`。

### 您的 pull request 或分支尚未準備好進行 watch

請先檢查 pull request 和您的檢出目錄：

| 原因 | 處理方式 |
| :- | :- |
| 分支沒有 pull request，而 `/steward` 不會開啟 pull request | 請參閱 [/ship 沒有提交或推送任何內容](#%2Fship-committed-or-pushed-nothing) |
| 此工作階段中未檢出 pull request 的分支 | 檢出該分支 |
| pull request 帶有 [PR Steward](https://code.claude.com/docs/zh-TW/pr-steward.md) 的某個標籤，例如 `claude-pr-steward-watching` | 若要接手，請依 Claude 訊息所示，移除該標籤並 pull 該分支 |

### 工作階段設定阻止了 watch

工作階段的某些設定會使 watch 無法啟動：

| 原因 | 處理方式 |
| :- | :- |
| 工作階段處於 `bypassPermissions` 模式 | 按 `Shift+Tab` 切換到 plan mode 以外的權限模式 |
| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 已開啟 | 執行 `/rc`，然後選取 **Disconnect this session** |
| `your PATH has a relative or empty entry` | 未指定 pull request 編號的 `/ship` 會審查您的變更，但不會提交、推送或尋找 pull request。請將空白或相對路徑的項目從 `PATH` 中移除，例如結尾的 `:`，或在 Windows 上的 `;`。重新啟動 `claude`，然後執行 `/ship` |
| 您的 `PATH` 包含檢出目錄內的資料夾。例如，當您啟用位於檢出目錄中的 Python 虛擬環境，或透過 `npx` 或套件指令碼啟動 `claude` 時，就會發生這種情況 | 若要在不含該資料夾的情況下啟動工作階段，如果您使用虛擬環境，請在 shell 中執行 `deactivate`，然後直接啟動 `claude` |

### 工具、規則或 hook 阻止了 watch

watch 需要 `gh`、`git commit` 和 `git push`，而且在專案的 hook 可能核准命令的情況下不會啟動：

| 原因 | 處理方式 |
| :- | :- |
| `gh` 未安裝或未登入 | 請參閱 [GitHub CLI 尚未就緒](#the-github-cli-isn’t-ready) |
| 拒絕規則禁止了 watch 所需的命令，例如 `git push` | Claude 的訊息會列出該命令以及包含該規則的設定。如果設定該規則的人同意，請在那裡將其移除。若要變更受管設定中的規則，請詢問您的管理員 |
| 專案設定了可能核准命令的 hook，例如在檢出目錄的 `.claude/settings.json` 中，針對 shell 命令設定的 `PreToolUse` 或 `PermissionRequest` [hook](https://code.claude.com/docs/zh-TW/hooks.md) | 訊息會列出該檔案並說明需要變更的內容 |

### 無法啟動 watch 的情況

在以下情況中，`/ship` 仍然可以審查您的變更：

* 您使用的是原生 Windows
* pull request 是由其他人開啟的
* 您無法推送到 pull request 的目標儲存庫，且已有其他人留言或審查。如果在 watch 執行期間發生這種情況，watch 會結束

## watch 已停止

watch 是 Claude 對您的 pull request 所進行的持續性工作，會在 `/ship` 審查完成後或您輸入 `/steward` 時啟動。watch 結束後，請尋找以 `Stopped watching pull request` 開頭的行，其中會說明原因。

若要重新啟動 watch，如果該行提供了命令，請輸入該命令。若要檢查 watch 是否仍在執行，請在 Claude 閒置時於 Claude Code 提示字元中輸入 [`/tasks`](https://code.claude.com/docs/zh-TW/ship-command#check-whether-a-watch-is-running)。

在該行中找出「because」後面的文字：

| 原因 | 發生了什麼事 |
| :- | :- |
| `its check-in was cancelled` | 您在提示字元中或 Claude 工作期間按下了 `Esc` 或 `Ctrl+C`，或在 `/tasks` 中停止了該工作。Claude 的訊息將其對 pull request 的工作稱為 check-in。用於關閉 `/tasks` 清單的 `Esc` 不會停止 watch |
| `the watch couldn't go on` | Claude 的回覆可能會說明原因。其中一個原因是 pull request 的分支已不再處於檢出狀態。請在您啟動時所在的資料夾中檢出該分支，然後輸入 `/steward` |
| `a watch doesn't carry over when a session is resumed` | 執行 watch 的程序已經結束，例如因為您關閉了終端機。在 shell 中執行 `claude --continue` 會恢復對話，但不會恢復 watch |
| `you moved to another session` | `/clear`、`/resume` 或 `/branch` 可能造成這種情況 |
| `its check-ins were replaced` | 您啟動了 `/loop` |
| `your new command took over this session` | 您再次執行了 `/ship` 或 `/steward` |
| `a deny rule now forbids a command that the watch runs` | 在 Claude Code 提示字元中輸入 `/permissions` 以查看該規則。請參閱[工具、規則或 hook 阻止了 watch](#a-tool-rule-or-hook-blocks-a-watch) |
| `the watch reached its time limit` | 已經過了大約七天 |
| `no next check-in was set` | 拒絕權限提示、發生錯誤或達到用量上限都可能造成這種情況 |
| `a file that gh, git, or /steward relies on changed` | 請參閱 [watch 所依賴的檔案已變更](#a-file-that-the-watch-relies-on-changed) |

`No pull request is being watched in this session` 表示您輸入了 `/ship stop` 或 `/steward stop`，但當時沒有正在執行的 watch。請向上捲動尋找 `Stopped watching pull request` 行。

### watch 所依賴的檔案已變更

當某些操作變更了 `gh`、`git` 或 `/steward` 所依賴的檔案時，watch 就會結束。以下這類檔案都算在內：

* **Git 的設定**：`git push -u`、`git branch -u` 和 `git remote add` 會變更它們。VS Code 等編輯器在開啟儲存庫或您切換回該儲存庫時，也可能會在 `.git/config` 中新增設定
* **`.claude/settings.local.json`**：當您以「Yes, and don't ask again」回應權限提示時，Claude Code 會寫入此檔案

檢閱變更後，輸入 `/steward` 以重新啟動 watch。

如果您沒有變更任何檔案，在 Linux 和 WSL2 上的其中一個原因是在 watch 期間有[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令啟動或結束。請停止該命令或等待它結束。

## watch 期間的訊息

以下訊息會在 watch 期間出現在您的工作階段中：

| 訊息，或您看到的內容 | 處理方式 |
| :- | :- |
| `Claude Code did not run this` 或 `Not run · permission denied` | Claude 嘗試了某個步驟，但被 [watch 的限制](https://code.claude.com/docs/zh-TW/ship-command.md#what-claude-code-blocks-during-a-watch)或您的某個規則或 hook 拒絕了。當 watch 已經結束時，也會出現此訊息。Claude 的訊息將這些限制稱為「the fence」 |
| `In this session there's a way around my limits` | 您工作階段中的某個設定（例如規則、hook、外掛或沙箱）讓某些命令能夠繞過 [watch 的限制](https://code.claude.com/docs/zh-TW/ship-command.md#what-claude-code-blocks-during-a-watch)。訊息後面的文字會列出它。若要查看您的規則，請在 Claude Code 提示字元中輸入 `/permissions`。若要在您做決定期間結束 watch，請輸入 `/steward stop` |
| 類似 `1 comment not read (no write access, or a bot that you haven't named)` 的行 | Claude [略過了一則留言](https://code.claude.com/docs/zh-TW/ship-command.md#what-claude-does-during-a-watch)。開啟訊息中的連結即可閱讀。若希望 Claude 讀取某個 bot 的留言，請輸入 `/steward +botname`。若您同意某人的留言，請告訴 Claude 要變更的內容 |
| `gh couldn't say where the pull request's head and base stand` | 其中一個原因是 GitHub CLI 的版本早於 2.63。在 shell 中執行 `gh --version` 進行檢查。更新後，輸入 `/steward` 以重新啟動 watch |
| 工作階段中出現 `Claude resuming /loop wakeup` 或 `/steward --tend` | 當 Claude 在 watch 期間檢查 pull request 時，Claude Code 會輸入這些內容。您可以照常繼續工作 |

## 出乎預期的 pull request 結果

當 `/ship` 已執行，而 GitHub 上或您的儲存庫中出現令您意外的情況時，請從這裡開始：

| 您看到的內容 | 原因及處理方式 |
| :- | :- |
| pull request 的標題是類似 `Update greet.py and 1 more` 的內容 | 當 Claude 無法根據工作階段的對話撰寫標題時（例如在您未討論該變更的工作階段中），`/ship` 會改用這種標題。請在 GitHub 上編輯標題和說明。下次請在您進行變更的工作階段中執行 `/ship`，或先在預設分支以外的分支上自行提交您的工作 |
| Claude 在您看到之前就推送了提交或回覆了審查者 | 在自動模式下，或在您的規則或沙箱允許某個命令的情況下，watch 就會這樣運作。請參閱[讓 Claude 先與您確認](https://code.claude.com/docs/zh-TW/ship-command.md#ask-claude-to-check-with-you-first) |
| 新的未提交變更沒有進入已開啟的 pull request | pull request 開啟後，`/ship` 不會提交您的工作。請提交它，然後推送，例如在 shell 中執行 `git push origin <branch>` |
| `git pull` 或 `git push` 要求提供上游分支 | `/ship` 不會設定上游。請指定 remote 和分支，例如 `git push origin <branch>`。設定上游會變更 git 的設定，這會[結束正在執行的 watch](https://code.claude.com/docs/zh-TW/ship-command.md#keep-working-while-a-watch-runs) |

## 自訂的 /ship 或 /steward 命令不再載入

`Not loaded: a custom /ship` 或 `Not loaded: custom /ship, /steward` 通知與自訂 skill 或命令有關。其名稱是內建命令所保留的名稱，例如 `ship`、`ship-local` 或 `steward`。請將其重新命名，然後重新啟動 Claude Code。

請保留儲存庫中的 `.claude/skills/steward/SKILL.md` 原樣，因為 PR Steward 和 watch 會將其作為指令讀取。該通知不會將此檔案計算在內，因此提到 `/steward` 的通知是關於其他 skill 或命令。

## 相關資源

* [`/ship` 和 `/steward`](https://code.claude.com/docs/zh-TW/ship-command)：這些命令的作用、如何執行它們，以及 watch 期間對 Claude 的限制
* [權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md)：自動模式和其他權限模式
* [Hooks](https://code.claude.com/docs/zh-TW/hooks.md)：`PreToolUse` 和 `PermissionRequest` hook
