---
title: "yokoten"
description: "你的 agent 跑了 rm -rf。隔壁的项目还在。一条命令打开 agent 的沙箱；沙箱起不来，agent 就停下：npx yokoten。"
canonical: https://yokoten.app/zh/
lang: zh-CN
---

> 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`。它会撤回自己在这台电脑上写的东西，你自己的文件和设置保持原样。它加进项目的文件都是普通文件，想删可以直接删。
