---
title: "yokoten"
description: "你的 agent 跑了 rm -rf。隔壁的專案還在。一個指令開啟 agent 的沙箱；沙箱起不來，agent 就停下：npx yokoten。"
canonical: https://yokoten.app/zh-tw/
lang: zh-Hant-TW
---

> For AI agents: the documentation index is at https://yokoten.app/llms.txt. To set up yokoten in a project, follow https://yokoten.app/agents.md.

# 你的 agent 跑了 rm -rf。隔壁的專案還在。

一個指令，開啟 agent 的沙箱；沙箱起不來，agent 就停下。

```sh
npx yokoten
```

- 適用於: Claude Code, Codex, Copilot, Antigravity, Muse Code, OpenCode, Grok, DeepSeek
- 系統: Linux, macOS, Windows（WSL）, 原生 Windows（測試版）

## 它擋什麼

**一條指令，清空你的家目錄。**

```text
$ rm -rf ~

yokoten stopped this: `rm` would wipe your home folder [wipe-home-or-system]

  Why       One command from an agent that lost its context can wipe the home
            folder or the system, and nothing brings the files back.

  Instead   Delete or change only files inside this project, and name each one.
            The guard refuses a wipe of home, of the system, or of a target it
            cannot read.

  More      https://github.com/yokoten-labs/yokoten/blob/main/docs/guide.md#the-safeguard
```

**強制推送，會把別人的工作沖掉。**

```text
$ git push -f origin main

yokoten stopped this: git push -f can overwrite the remote [force-push]

  Why       A plain force push can throw away work that someone else pushed.

  Instead   Use --force-with-lease, which stops when the remote has work you
            have not seen.

  More      https://github.com/yokoten-labs/yokoten/blob/main/docs/guide.md#the-core-rules
```

**發版這件事，只該由專案擁有者來做。**

```text
$ git push origin v1.2.0

yokoten stopped this: git push origin v1.2.0 pushes a release tag [release]

  Why       Only the owner decides when to release.

  Instead   Stop and tell the owner: only the owner releases, with the steps in
            How to release; do not look for another way.

  More      https://github.com/yokoten-labs/yokoten/blob/main/docs/guide.md#how-to-release
```

## `npx yokoten` 做了什麼

```text
$ npx yokoten

yokoten 0.2.1 · set up; stage 1 of 5, safety net

  ok           guard on for Claude Code on this computer
  ok           38 files written in this project, none of yours changed
  ok           sandbox on for Claude Code, Codex, Grok CLI in this project

  MISSING      ~/.config/yokoten/private-marks is missing or has no marks
               Type your name, your city or a domain; it is not shown.
               Fix: `npx yokoten marks add`

  done         12 of 26 steps
  next         Run your tests on every push
  to do        Put the project on GitHub or Gitea
  to do        Name the owner (CODEOWNERS)
  to do        Set up the bot account
  to do        Add a license and a security policy
  can't check  9 steps: they read the code host; doctor checks them after a push

  note         16 uncommitted files, the oldest changed 1 minute ago

Next: `git add -A && git commit -m "chore: add yokoten"`
More: `npx yokoten doctor --all` shows every check and 5 notes
```

1. 開啟守衛；agent 有沙箱的，也開啟沙箱。
2. 加上規則，不改你的檔案。
3. 告訴你下一條指令。

## 四個問題

### 適合我嗎？

如果有 coding agent 在你的電腦上跑指令，就適合你。裝一次，平時什麼都不用執行。如果你的 agent 本來就在自己的沙箱裡跑，也從不 push 或發版，你可能用不著它。

### 要收費嗎？

不收費。MIT 開源，不用註冊帳號。

### 會把我的程式碼傳出去嗎？

不會。只在你的電腦和 CI 上執行，沒有遙測。

### 怎麼移除它？

執行 `npx yokoten uninstall`。它會撤回自己在這台電腦上寫的東西，你自己的檔案和設定維持原樣。它加進專案的檔案都是一般檔案，想刪可以直接刪。
