merge: bring main into the computer-use worktree

main is 87 commits ahead and carries a large amount of fixed behaviour this
branch should not be re-deciding. The rule applied throughout: this worktree
owns Computer Use, main owns everything else.

Only 12 files were touched on both sides, and Git merged all of them without
reporting a conflict — but two of those silent merges were wrong, and neither
was visible until the checks ran.

`desktop/src/api/client.ts` ended up with two `apiGetBlob` implementations.
Both sides had independently hit the same problem (an `<img src>` pointed at an
API endpoint is a cross-origin subresource, so it carries no Authorization
header and the server's fetch-metadata policy refuses it) and both had written
the same fix. Git saw two additions in different places and kept both, which
does not even compile. main's version survives: it builds its headers through
the shared `buildHeaders()` rather than assembling them inline, so it inherits
whatever main adds there later.

`src/server/api/computer-use.ts` still imported `runtime/mac_helper.py` and
`runtime/requirements.txt` as compile-time text, both deleted on this branch.
Nothing at runtime referenced them, which is why the deletion looked clean; the
bundler resolves those imports when the server module is loaded, so the failure
surfaced only when the tests actually imported it. That path is now Windows-only
in the same sense the rest of the Python bridge is, and it also ships
`win_cursor_badge.py`, which the badge needs because it runs as its own process.

`computer-use-requirements.test.ts` drops its darwin half for the same reason —
the pins it guards still matter, but only one requirements file is left.

Verified: server 3869 tests / 331 files, desktop 4612 tests / 319 files
(lint + tsc + build), Swift 272 XCTest + 14 Swift Testing, Python 25.

Claude-Session: https://claude.ai/code/session_015j1yxxaoonyAS2iZ7qGnTS
This commit is contained in:
程序员阿江(Relakkes)
2026-08-23 18:39:47 +08:00
513 changed files with 73008 additions and 4148 deletions
+24 -1
View File
@@ -51,6 +51,29 @@ order: 3
点任意一条进详情页,能看到它的模型、思考强度、工具范围和完整系统提示词。内置和插件来源是只读的,详情页右上角会有一个「只读」标记。
鼠标移到列表里的某一行上,右侧会出现操作按钮:用户和项目 Agent 是「编辑」和「删除」,内置 Agent 是「调整模型」。详情页右上角也有同样的入口。
## 调整内置 Agent 的模型
内置 Agent 各自钉了默认模型——`Explore` 和 `claude-code-guide` 走 Haiku,`statusline-setup` 走 Sonnet——图的是快和省。如果你更在意它们的结果质量,可以单独换掉。
在列表里点内置 Agent 那一行的「调整模型」,或者进详情页点右上角的同名按钮。能改的只有两项:
- **模型** — 「内置默认」「继承主会话」、Haiku / Sonnet / Opus / Fable 别名,以及当前 Provider 已配置的模型。
- **思考强度** — 「内置默认」或低 / 中 / 高 / 极高 / 最大。
系统提示词、工具范围和颜色不能改,仍由 Claude Code 固定。
:::tip
「内置默认」和「继承主会话」是两回事。以 `Explore` 为例,前者是它出厂就钉着的 Haiku,后者是跟着你主对话当前用的模型走。想恢复出厂设置就选「内置默认」,或者直接点「恢复内置默认」。
:::
覆盖写进 `~/.claude/settings.json` 的 `builtInAgentOverrides`,对所有项目生效。恢复默认时这条记录会被整个删掉,不会在配置文件里留下空壳。
Agent 配置只保存模型 ID,不绑定 Provider。选择器会列出当前 Provider 的可用模型;如果以后切换 Provider,别名会按新 Provider 的映射解析,完整模型 ID 则需要新 Provider 也支持。
如果你自己建了一个同名的用户 Agent(比如手写一个 `name: Explore` 的 md 文件),它会完全盖住内置的那个,此时改内置的模型不会有任何效果——弹窗里会提示这一点。
## 捏一个自己的
![「创建 Agent」弹窗:作用域、模型、思考强度、工具、系统提示词](../images/app/zh-CN/agent-create.webp)
@@ -61,7 +84,7 @@ order: 3
2. **名称** — 1–64 位小写字母、数字、连字符或下划线,比如 `code-reviewer`。这是主 Agent 调用它时用的名字。
3. **描述** — 说明主 Agent 应该在什么场景下委派给它。**这一条最重要**:主 Agent 就是靠它决定要不要派这个 Agent,写含糊了就永远不会被叫到。
4. **系统提示词** — 定义这个 Agent 的职责、边界和预期输出。
5. **模型** — 继承主 Agent,或指定 Haiku / Sonnet / Opus / Fable,也可以填自定义模型 ID。简单重复的活给 Haiku 更快更省。
5. **模型** — 继承主 Agent,选择 Haiku / Sonnet / Opus / Fable 别名,或选择当前 Provider 已配置的模型。简单重复的活给 Haiku 更快更省。
6. **思考强度** — 继承,或单独指定低 / 中 / 高 / 极高 / 最大。模型不支持某档时会自动降级或忽略。
7. **工具** — 三选一:全部工具、不允许使用工具、自定义列表。选自定义时按读取与搜索 / 修改文件 / 执行命令 / 工作流分类勾选,下面还有一个自由输入框,用来填 MCP 工具名或者 `Bash(git:*)` 这样的权限规则。
8. **颜色** — 用来在界面上区分,可选。
+2 -1
View File
@@ -87,7 +87,8 @@ H5 默认关闭,它也不是公开服务。开启前先确认你在自己信
### 其他设置
- **默认项目** — 新 IM 会话用哪个工作目录。留空则用当前用户工作目录。
- **默认项目** — 新 IM 会话用哪个工作目录。留空则用当前用户工作目录。它只是个起点,不限制机器人能访问哪些项目。
- **允许访问的项目目录** — 机器人的访问边界,`/projects` 只会列出这些目录里的项目。留空则默认为你的主目录(外加主目录之外的「默认项目」)。
- **流式卡片模式** — 实时更新消息内容,读起来更像在看它打字。
- **权限请求** — 钉钉可以配互动卡片模板 ID,用卡片按钮授权;不配的话所有平台都用 `/allow`、`/always`、`/deny` 文本命令。
+5 -1
View File
@@ -69,7 +69,11 @@ Claude 每完成一轮,对话里会出现一张「{n} 个文件已更改」的
- **撤销当前轮次** — 回滚最近一次回复,并把这一轮改过的文件恢复回去。
- **回滚到这一轮之前** — 对历史轮次用,把会话和文件一起退回那个检查点。
点了会先弹确认框。有些轮次没有可用的文件检查点,这时只回滚对话,不动文件——提示语里会说清楚。
点了会先弹确认框,里面可以选**代码和对话一起回滚**,还是**只回滚对话**(保留磁盘上的文件不动)。
检查点记录的是 Claude 通过编辑工具(Read/Edit/Write 那一类)改过的文件。**Shell 命令写出去的文件不在检查点里**:`npm install`、`rm`、重定向到文件的命令,撤销都还原不了。遇到这种轮次,卡片和确认框会点名是哪些工具没被记录,撤销照常可用,但只还原它列出的那些文件。需要兜底就用 git。
如果某一轮的文件检查点本身残缺(会话记录损坏、路径不安全等),代码就还原不了了,确认框里只剩「只回滚对话」——对话永远能退回去。
## 活动面板:它现在在忙什么
+24 -1
View File
@@ -51,6 +51,29 @@ When two agents share a name, the higher source wins and the shadowed one is tag
Click any row for its detail page: model, effort, tool scope, and the full system prompt. Built-in and plugin agents are read-only and show a lock pill instead of edit controls.
Hover a row in the list and its actions appear on the right: **Edit** and **Delete** for user and project agents, **Adjust model** for built-in ones. The same controls sit in the top-right of the detail page.
## Adjusting a Built-in Agent's Model
Built-in agents each pin a default model — `Explore` and `claude-code-guide` run on Haiku, `statusline-setup` on Sonnet — chosen for speed and cost. If you care more about their output quality, you can swap that out.
Click **Adjust model** on the built-in agent's row, or the same button in the top-right of its detail page. Only two things are editable:
- **Model** — Built-in default, Inherit from parent, the Haiku / Sonnet / Opus / Fable aliases, or a model configured for the current provider.
- **Reasoning effort** — Built-in default, or low / medium / high / xhigh / max.
The system prompt, tool scope, and color stay fixed by Claude Code.
:::tip
"Built-in default" and "Inherit from parent" are not the same thing. For `Explore`, the first is the Haiku it ships pinned to; the second follows whatever model your main conversation is using. To go back to how it shipped, pick "Built-in default" or click **Reset to built-in default**.
:::
The override is written to `builtInAgentOverrides` in `~/.claude/settings.json` and applies to every project. Resetting removes the entry entirely rather than leaving an empty shell behind in your config.
Agent configuration stores a model ID, not a provider. The picker lists models from the current provider. If you switch providers later, aliases resolve through the new provider's mapping, while a full model ID must also be supported by the new provider.
If you create a user agent with the same name (a hand-written file with `name: Explore`, say), it shadows the built-in one completely — changing the built-in's model then has no effect, and the dialog says so.
## Writing your own
![The Create Agent dialog: scope, model, effort, tools, system prompt](../../images/app/en/agent-create.webp)
@@ -61,7 +84,7 @@ Click **Create Agent** in the top right. The fields:
2. **Name** — 1–64 lowercase letters, digits, hyphens, or underscores, e.g. `code-reviewer`. This is what the main agent calls it by.
3. **Description** — when the main agent should delegate to it. **This is the field that matters most**: it's what the main agent reads to decide whether to call this agent at all. Write it vaguely and the agent will never be used.
4. **System prompt** — its responsibilities, boundaries, and expected output.
5. **Model** — inherit from the main agent, or pick Haiku / Sonnet / Opus / Fable, or enter a custom model ID. Simple repetitive work is faster and cheaper on Haiku.
5. **Model** — inherit from the main agent, choose a Haiku / Sonnet / Opus / Fable alias, or choose a model configured for the current provider. Simple repetitive work is faster and cheaper on Haiku.
6. **Effort** — inherit, or set low / medium / high / xhigh / max. Models that don't support a level downgrade or ignore it.
7. **Tools** — all tools, no tools, or a custom list. The custom picker groups built-in tools by read and search, modify files, execute commands, and workflow, with a free-text field below for MCP tool names or permission rules like `Bash(git:*)`.
8. **Color** — optional, purely for telling agents apart in the UI.
+5 -1
View File
@@ -69,7 +69,11 @@ After each turn, a card appears in the conversation reading "**{n} files changed
- **Undo current turn** — roll back the latest reply and restore the files it changed.
- **Roll back to before this turn** — for older turns: rewind both the conversation and the files to that checkpoint.
Both ask for confirmation first. Some turns have no file checkpoint; in that case only the conversation rolls back, and the message says so.
Both ask for confirmation first, where you choose between rolling back **code and conversation together** or **the conversation only** (leaving the files on disk untouched).
Checkpoints capture the files Claude changed through its editing tools. **Files written by shell commands are not checkpointed** — `npm install`, `rm`, or a command redirecting into a file cannot be undone. On such a turn the card and the confirmation name the tools that went unrecorded; undo still works, but it only restores the files it lists. Use git for anything you need a guaranteed way back from.
When a turn's file checkpoint is itself incomplete (a damaged session log, an unsafe path), the code cannot be restored and the confirmation offers only **Roll back conversation only** — the conversation can always be rewound.
## The Activity panel
+29 -4
View File
@@ -350,7 +350,7 @@ In the desktop app, open **Settings → Agents**. The desktop app and CLI use th
| **User** | `~/.claude/agents/*.md` | Available in every project |
| **Project** | `<project-directory>/.claude/agents/*.md` | Available only in the current project; overrides a user Agent with the same name |
User and project Agents can be created, edited, and deleted from the desktop app, and saving writes directly to the corresponding Markdown file. Other sources, including built-in Agents, plugins, managed policy, and CLI arguments, also appear in the list but are read-only because the desktop app does not own their source files.
User and project Agents can be created, edited, and deleted from the desktop app, and saving writes directly to the corresponding Markdown file. Other sources, including built-in Agents, plugins, managed policy, and CLI arguments, also appear in the list but are read-only because the desktop app does not own their source files. Built-in Agents are one exception: their model and reasoning effort can be overridden individually, but the override lives in settings.json rather than in a source file and `source` stays `built-in`. See "Overriding a Built-in Agent's Model and Effort" below.
When the desktop app is connected to the active session, creating, editing, or deleting an Agent hot-reloads that session in place, so the next spawn uses the new definition immediately. If no runtime is available or the reload fails, the file is still saved; the desktop app shows a non-blocking warning, and the saved definition is loaded on the next launch.
@@ -410,14 +410,39 @@ Model resolution uses this precedence, from highest to lowest:
1. A concrete model in `CLAUDE_CODE_SUBAGENT_MODEL` (`inherit` does not pin the model)
2. The model supplied to this `Agent({ ..., model: "..." })` call
3. `model` in the Agent Markdown frontmatter
4. The primary conversation model
4. `model` from `builtInAgentOverrides` in settings.json (built-in Agents only)
5. The primary conversation model
Reasoning effort resolution uses this precedence, from highest to lowest:
1. `CLAUDE_CODE_EFFORT_LEVEL`
2. `effort` in the Agent Markdown frontmatter
3. The current session effort
4. The model default
3. `effort` from `builtInAgentOverrides` in settings.json (built-in Agents only)
4. The current session effort
5. The model default
### Overriding a Built-in Agent's Model and Effort
Built-in Agents have no Markdown file, so their `model` and `effort` are adjusted through `builtInAgentOverrides` in settings.json. Keys are the agentType used to spawn them, and are case-sensitive:
```json
{
"builtInAgentOverrides": {
"Explore": { "model": "sonnet", "effort": "low" },
"general-purpose": { "effort": "high" }
}
}
```
A few rules that are easy to get wrong:
- **Only these two fields are writable.** The system prompt, tool scope, and color still come from the built-in definition, and the override does not change `source` — so a built-in Agent keeps its built-in tool privileges.
- **Clearing an override means deleting the field**, not writing `inherit`. Built-in defaults differ per agent (`Explore` defaults to `haiku`, `Plan` to `inherit`, and `general-purpose` omits `model`), so `model: "inherit"` is a normal value meaning "follow the primary session" — distinct from "restore the default".
- **Unknown agentTypes are ignored but never pruned.** The built-in set varies with feature flags and entrypoint, so automatic cleanup would destroy a valid configuration whenever a flag flipped.
- When the managed `strictPluginOnlyCustomization` policy includes `agents`, user- and project-level overrides are ignored **at load time**, and only managed sources apply.
- As with Agent Markdown files, editing settings.json does not affect an already-running session. The desktop app triggers a session reload when it saves; editing the file by hand requires restarting the session or `/reload-plugins`.
For the desktop entry point, see [Subagents and Task Splitting](../desktop/agents.md).
The `Agent` tool has no per-call `effort` parameter, so set it in the Agent definition or at the session level. Availability of `low`, `medium`, `high`, `xhigh`, and `max` depends on the resolved model and provider capabilities. Claude models fall back to a lower supported level, other providers normalize through their model catalogs, and models without effort support do not apply the field.
+3 -1
View File
@@ -67,6 +67,8 @@ bun run check:desktop-ui-smoke # real desktop UI + real permission dialog + mock
Neither needs a provider, credentials, or the public network. `check:agent-flow` covers session creation, runtime selection, first-turn streaming, tool execution, permission allow/deny, tool failure, API error, interrupt, reconnect permission replay, and session recovery. `check:desktop-ui-smoke` clicks the real Allow button in a real browser; it needs `agent-browser` and installed desktop dependencies and skips with a printed reason when either is missing.
`agent-browser` belongs to that committed lane (which runs headless on Linux CI) and to the maintainer-run `desktop/scripts/e2e-*-agent-browser.sh` scripts. For ad-hoc browser work (manual verification, screenshots, exploratory UI checks), use the `ego-browser` skill instead; do not treat `agent-browser` as a general-purpose browser tool just because it appears in the repository.
Every quality-gate lane that boots the real server runs against a sandbox config dir (`scripts/quality-gate/sandbox.ts`) and fails if it wrote to the developer's real `~/.claude`.
Run the selected focused commands while developing. Before claiming PR-ready, for a high-risk change, or when reproducing the full hosted CI locally, use the unified entrypoint:
@@ -125,7 +127,7 @@ Every feature, bugfix, and behavior change must ship with verifiable evidence. T
- Name the changed surface first: `desktop`, `server`, `adapter`, `native`, `docs`, `provider/runtime`, `agent-loop`, or `release`.
- Production changes under `desktop/src`, `src/server`, `src/tools`, `src/utils`, or `adapters` must include same-area tests in the same PR unless a maintainer explicitly applies `allow-missing-tests`.
- Pure logic needs unit tests. Server/API/provider/runtime behavior needs API or request-shape tests. Desktop UI/store/API behavior needs Vitest or Testing Library coverage. Cross-boundary user flows through UI, WebSocket, provider proxying, native sidecars, or release packaging need E2E or agent-browser smoke.
- Pure logic needs unit tests. Server/API/provider/runtime behavior needs API or request-shape tests. Desktop UI/store/API behavior needs Vitest or Testing Library coverage. Cross-boundary user flows through UI, WebSocket, provider proxying, native sidecars, or release packaging need E2E or desktop UI smoke.
- Agent loop, tool execution, provider routing, model selection, file editing, permissions, session resume, and desktop chat changes need mock/fixture tests in PR, plus live smoke or baseline evidence when provider access is available.
- Coverage is part of the feature. This project follows a Google/Microsoft-style policy: generated/build output is not counted as product coverage, maintained product areas should move toward 75-80%+, and new or changed executable production lines must pass the changed-line coverage threshold in `coverage-thresholds.json`.
- Do not lower `coverage-baseline.json` or `coverage-thresholds.json` just to pass the gate; real baseline/threshold changes require `allow-coverage-baseline-change` and a reason. Legacy low-coverage areas are debt; new PRs must leave touched areas better than they found them.
+56
View File
@@ -0,0 +1,56 @@
---
title: Code signing policy
nav_title: Signing policy
description: Signing scope, responsible roles, approval, verification, and revocation rules for official Claude Code Haha releases.
order: 5
---
# Code signing policy
This policy applies to official Windows releases of Claude Code Haha. The project is applying for free code signing through the SignPath Foundation. Until onboarding is complete, the Windows download page will continue to identify installers as unsigned. After onboarding, only artifacts that comply with this policy will be submitted for signing.
Free code signing provided by SignPath.io, certificate by SignPath Foundation.
The service is provided by [SignPath.io](https://about.signpath.io) and the [SignPath Foundation](https://signpath.org).
## Signing scope
Signing is limited to the Windows desktop application, project-owned sidecars, and final x64 and ARM64 NSIS installers built from source owned by this project in [NanmiCoder/cc-haha](https://github.com/NanmiCoder/cc-haha).
Release packages may include third-party or upstream open-source components distributed under their respective licenses. Those components may be bundled unchanged, but they will not be signed as binaries owned by Claude Code Haha. The certificate will not be used for other projects, personal builds, debug builds, or files of unknown origin.
## Trusted source and build
- The only trusted source is a protected release commit or tag in the public GitHub repository.
- Official Windows artifacts are built by version-controlled GitHub Actions workflows on GitHub-hosted runners.
- Every signing request must be traceable to a specific commit, release tag, workflow run, and build artifact.
- An artifact must not be published if signing fails, its origin is unclear, or its metadata does not match the release.
## Responsible roles
- **Authors / Committers:** [@NanmiCoder](https://github.com/NanmiCoder), plus external contributors whose changes have been reviewed and accepted.
- **Reviewers:** [@NanmiCoder](https://github.com/NanmiCoder); external contributions require maintainer review before entering an official release commit.
- **Approvers:** [@NanmiCoder](https://github.com/NanmiCoder).
Team members must enable multi-factor authentication for their GitHub and SignPath accounts. This page will be updated when roles or members change.
## Approval and release
Every signing request for an official release requires manual approval by an Approver. Automatic approval and approval bypasses are not permitted. Before approval, the commit or tag, build workflow, target architecture, file name, product name, version, and release notes must be checked. An artifact may be uploaded to GitHub Releases only after approval and signature verification.
## User verification
After onboarding is complete, a Windows installer can be inspected in PowerShell:
```powershell
Get-AuthenticodeSignature ".\Claude-Code-Haha-<version>-win-x64.exe" |
Format-List Status, StatusMessage, SignerCertificate, TimeStamperCertificate
```
Continue with installation only when `Status` is `Valid`, the product and version are expected, and the file came from this project's [GitHub Releases](https://github.com/NanmiCoder/cc-haha/releases).
## Security incidents and revocation
Report suspected misuse of the certificate, signing accounts, build process, or release artifacts through a [private GitHub security advisory](https://github.com/NanmiCoder/cc-haha/security/advisories/new) or by email to [relakkes@gmail.com](mailto:relakkes@gmail.com). The maintainer will pause affected releases and signing requests, remove affected downloads, investigate the source, and ask the SignPath Foundation to revoke the certificate or signature when necessary.
See [Privacy and network access](./privacy.md) for the software's network and local-data behavior.
+4
View File
@@ -114,6 +114,10 @@ If the download stalls, you probably can't reach GitHub. The same panel has an "
The installer's data protection is not a backup. Keep your own copy of anything you can't afford to lose.
:::
## Code signing policy
See the [Code signing policy](./code-signing.md) for the Windows signing scope, manual approval, responsible roles, and verification steps. Until SignPath Foundation onboarding is complete, Windows releases remain explicitly identified as unsigned. See [Privacy and network access](./privacy.md) for network and local-data behavior.
## Next
Go to [Connect a model](./models.md). Until a model is connected, the app opens but can't send a single message.
+1 -1
View File
@@ -44,7 +44,7 @@ With an API key in hand, this is the fastest route. Click "Add Provider", pick s
The built-in presets, as they appear in the dialog:
- **DeepSeek** · **Zhipu GLM** · **Kimi** · **MiniMax** — major Chinese model vendors; the base URLs point at each one's Anthropic-compatible endpoint.
- **TeamoRouter** · **XuanShu API** · **FennoAI** — routing services that give you access to official Claude models through their own gateways.
- **XuanShu API** · **FennoAI** — routing services that give you access to official Claude models through their own gateways.
- **Qiniu Cloud AI** — an aggregator MaaS platform: one key for DeepSeek, GLM, Kimi, Qwen, and more.
- **LM Studio** · **Ollama** — local models; see the next section.
- **Custom** — anything not listed above.
+41
View File
@@ -0,0 +1,41 @@
---
title: Privacy and network access
nav_title: Privacy
description: What Claude Code Haha stores locally, when it uses the network, and how to remove its data.
order: 6
---
# Privacy and network access
Claude Code Haha is a local-first, open-source development tool. The project itself does not operate a cloud backend that receives session content. The application is not fully offline: when you choose a model provider, MCP server, messaging integration, or update feature, relevant data is sent to the third-party service you selected or configured.
## Data stored locally
The application stores sessions, workspace records, provider configuration, skills, agents, memory, UI settings, and logs on your device. Primary user data lives under `~/.claude`; some desktop state is managed in the operating system's application-data directory. Authentication tokens and API keys are kept locally, but are sent to the selected service when needed to authenticate a request.
## When the application uses the network
Depending on the features you enable, the application may send the following information:
- **Model and OAuth services:** Prompts, attachments, selected code context, tool results, model parameters, and authentication information are sent to the model or account provider you choose.
- **MCP servers and external tools:** Configured MCP servers, search, image generation, and other tools receive the input required to perform the requested operation.
- **Messaging and remote access:** If you enable Telegram, Feishu, WeChat, DingTalk, WhatsApp, or remote H5 access, selected session content, messages, and connection metadata pass through the relevant platform or a relay you configure.
- **Updates:** The application contacts GitHub Releases to check versions and, when requested, download installers.
- **Web links:** Opening documentation, login pages, or other links causes the browser to connect directly to the destination site.
- **Upstream runtime traffic:** The bundled upstream agent runtime may contact diagnostic, analytics, or feature-flag services depending on the provider and configuration. Set `DISABLE_TELEMETRY=1` and `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` to reduce or disable nonessential traffic.
Each third-party service processes the data it receives under its own privacy policy. Review the provider's terms before use, and do not send secrets, personal information, or private code to a service you do not trust.
## What the project maintainers do not do
The project maintainers do not sell user data or place advertising based on personal data in the application. The maintainers do not receive locally stored sessions or configuration unless you choose to include them in an issue, discussion, log, or security report.
## Removing data
Uninstalling the application does not automatically delete sessions and configuration under `~/.claude`. To remove local data completely, first back up anything you want to keep, then manually delete `~/.claude` and the Claude Code Haha data in your operating system's application-data directory. To remove data already sent to a third-party service, follow that provider's process.
## Contact
For privacy or security questions, contact the maintainer through a [private GitHub security advisory](https://github.com/NanmiCoder/cc-haha/security/advisories/new) or at [relakkes@gmail.com](mailto:relakkes@gmail.com).
Last updated: August 5, 2026.
+27
View File
@@ -60,6 +60,33 @@ order: 0
同一个 IM 聊天窗口后续的消息会复用同一条会话,桌面端重启后也能接回去。想换目录发 `/new`,想清空上下文但保留项目发 `/clear`。
## 允许访问的项目目录决定它能碰哪些项目
「默认项目」只决定新会话开在哪,**不是**访问边界。真正的边界是「允许访问的项目目录」:机器人只能列出、打开并在这些目录内的项目里开会话,`/projects`、`/sessions` 和按名字、绝对路径选项目都受它约束。
留空就是默认值——你的主目录(如果「默认项目」是主目录之外的某个具体项目目录,也一并包含)。绝大多数人不需要动它。想收紧到某几个目录,就在设置里把它们加进列表。
配置写在 `~/.claude/adapters.json`,也可以按平台单独收紧:
```json
{
"allowedProjectRoots": ["~/work", "~/side"],
"whatsapp": { "allowedProjectRoots": ["~/work/sandbox"] }
}
```
平台级配置**替换**(不是叠加)全局配置:上面这份配置里 WhatsApp 只能碰 `~/work/sandbox`,其余平台是 `~/work` 和 `~/side`。桌面端设置界面改的是全局那一份,某个平台单独配过之后,界面上的改动就不会影响它了。
独立运行 adapter(不走桌面端)时也可以用 `ADAPTER_ALLOWED_PROJECT_ROOTS` 环境变量,多个目录用路径分隔符隔开(macOS / Linux 是 `:`,Windows 是 `;`)。这个环境变量比配置文件里的两层都优先。
几条边界规则:
- 目录必须是已存在的绝对路径(`~` 会展开)。写不存在的路径会被忽略并打日志;一个都解析不出来时回退到默认值,而不是把机器人锁死。
- 默认值不会自动继承 `/` 或 `/Users` 这类目录。桌面端以 GUI 方式启动时 sidecar 的工作目录是 `/`,直接拿来当边界等于没有边界。
- 「默认项目」如果落在允许范围之外,新会话会开在列表里第一个允许的目录,并打一条日志——这样 `/new` 不会因为两处配置不一致而失败。
配对仍然是第一道关:没配对的人根本发不了命令,这份目录列表是在此之上的第二道防线。注意主目录里也包含 `~/.claude`、`~/.ssh` 这些敏感目录,需要更强隔离就显式收紧到具体的项目目录。
## 通用命令
各平台的入口略有差异(飞书可以把命令配成机器人菜单),但这几条到处都能用:
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 450 105">
<image width="450" height="105" xlink:href="data:image/png;base64,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"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

+29 -4
View File
@@ -350,7 +350,7 @@ Agent Teams 支持两种执行后端:
| **用户** | `~/.claude/agents/*.md` | 在所有项目中可用 |
| **项目** | `<项目目录>/.claude/agents/*.md` | 只在当前项目中可用;同名时覆盖用户 Agent |
用户和项目 Agent 可以在桌面端创建、编辑和删除,保存结果会直接写回对应的 Markdown 文件。内置、插件、托管策略和 CLI 参数等其他来源也会显示在列表中,但只能查看,不能从桌面端改写其来源文件。
用户和项目 Agent 可以在桌面端创建、编辑和删除,保存结果会直接写回对应的 Markdown 文件。内置、插件、托管策略和 CLI 参数等其他来源也会显示在列表中,但只能查看,不能从桌面端改写其来源文件。内置 Agent 是一个例外:它的模型和推理强度可以单独覆盖,但覆盖写在 settings.json 而不是来源文件里,`source` 仍然是 `built-in`,详见下文「覆盖内置 Agent 的模型与推理强度」。
当桌面端连接着当前运行会话时,创建、编辑或删除 Agent 会原地热重载该会话,下一次 spawn 立即使用新定义。如果没有可用的运行时,或热重载失败,文件保存仍然成功;桌面端会显示不阻塞操作的警告,并在下次启动时自动读取已保存的定义。
@@ -410,14 +410,39 @@ maxTurns: 10
1. `CLAUDE_CODE_SUBAGENT_MODEL` 的具体模型值(设为 `inherit` 时不锁定模型)
2. 本次 `Agent({ ..., model: "..." })` 调用指定的模型
3. Agent Markdown frontmatter 中的 `model`
4. 主会话模型
4. settings.json 中 `builtInAgentOverrides` 指定的 `model`(仅内置 Agent)
5. 主会话模型
推理强度的解析优先级从高到低为:
1. `CLAUDE_CODE_EFFORT_LEVEL`
2. Agent Markdown frontmatter 中的 `effort`
3. 当前会话的 effort
4. 模型默认值
3. settings.json 中 `builtInAgentOverrides` 指定的 `effort`(仅内置 Agent)
4. 当前会话的 effort
5. 模型默认值
### 覆盖内置 Agent 的模型与推理强度
内置 Agent 没有 Markdown 文件,因此它的 `model` / `effort` 通过 settings.json 的 `builtInAgentOverrides` 调整,key 是 spawn 时用的 agentType(大小写敏感):
```json
{
"builtInAgentOverrides": {
"Explore": { "model": "sonnet", "effort": "low" },
"general-purpose": { "effort": "high" }
}
}
```
几条容易踩的规则:
- **只有这两个字段可改。** 系统提示词、工具范围和颜色仍由内置定义决定,覆盖不会改变 `source`,因此内置 Agent 的工具特权保持不变。
- **清除覆盖 = 删掉字段**,不是写 `inherit`。各内置 Agent 的默认值互不相同(`Explore` 默认 `haiku`、`Plan` 默认 `inherit`、`general-purpose` 不写 `model`),所以 `model: "inherit"` 是一个正常取值,含义是跟随主会话,与"恢复默认"不同。
- **未知的 agentType 会被忽略但不会被清理。** 内置 Agent 集合随 feature flag 和 entrypoint 变化,自动清理会在开关翻转时销毁有效配置。
- 组织策略 `strictPluginOnlyCustomization` 包含 `agents` 时,用户级和项目级的覆盖在**解析阶段**就会被忽略,只有 managed 来源生效。
- 与 Agent Markdown 文件一样,改完 settings.json 不会自动作用于已经在跑的会话;桌面端保存时会触发一次会话重载,手工改文件则需要重启会话或 `/reload-plugins`。
对应的桌面端入口见[子 Agent 与任务拆分](../desktop/agents.md)。
`Agent` 工具没有单次调用的 `effort` 参数,因此应在 Agent 定义或会话层设置。`low`、`medium`、`high`、`xhigh`、`max` 是否可用取决于解析后的真实模型及提供商能力;Claude 模型会向下回退到可用档位,其他提供商按各自的模型目录规范化,不支持 effort 的模型不会应用该字段。
+3 -1
View File
@@ -67,6 +67,8 @@ bun run check:desktop-ui-smoke # 真实桌面 UI + 真实权限对话框 + mock
两条通道都不需要 provider、凭据或公网。`check:agent-flow` 覆盖新建 Session → 选运行时 → 首轮流式 → 工具调用 → 权限批准/拒绝 → 工具失败 → API 错误 → 中断 → 断线重连权限重放 → 会话恢复。`check:desktop-ui-smoke` 在真实浏览器里点真实的 Allow 按钮,需要 `agent-browser` 与已安装的 desktop 依赖,缺失时会打印原因并跳过。
`agent-browser` 只属于这条已提交的 lane(在 Linux CI 上以 headless 方式运行)以及维护者手动执行的 `desktop/scripts/e2e-*-agent-browser.sh`。临时的浏览器操作(手动验证、截图、探索性 UI 检查)请走 `ego-browser` skill,不要因为仓库里出现 `agent-browser` 就把它当通用浏览器工具。
所有会启动真实 server 的 quality-gate lane 都跑在沙箱配置目录里(`scripts/quality-gate/sandbox.ts`),并在结束时校验没有写过开发者真实的 `~/.claude`;写了就判定 lane 失败。
开发时运行 impact report 选中的窄命令即可。准备声明 PR-ready、改动风险较高,或需要完整复现托管 CI 时,再运行统一入口:
@@ -125,7 +127,7 @@ Agent 应按这个顺序处理失败:
- 先声明变更面:`desktop`、`server`、`adapter`、`native`、`docs`、`provider/runtime`、`agent-loop` 或 `release`。
- `desktop/src`、`src/server`、`src/tools`、`src/utils`、`adapters` 下的生产代码变更必须同 PR 带同区域测试;除非维护者显式加 `allow-missing-tests`。
- 纯逻辑写单元测试;server/API/provider/runtime 写 API 或 request-shape 测试;桌面 UI/store/API 写 Vitest/Testing Library;跨 UI、WebSocket、provider proxy、native sidecar、发布打包的用户流程要补 E2E 或 agent-browser smoke。
- 纯逻辑写单元测试;server/API/provider/runtime 写 API 或 request-shape 测试;桌面 UI/store/API 写 Vitest/Testing Library;跨 UI、WebSocket、provider proxy、native sidecar、发布打包的用户流程要补 E2E 或桌面 UI smoke。
- agent loop、工具调用、provider 路由、模型选择、文件编辑、权限、会话恢复、桌面聊天改动,PR 内必须有 mock/fixture 测试;有 provider 条件时还要给 live smoke 或 baseline 证据。
- 覆盖率是功能的一部分。本项目按 Google/Microsoft 风格执行:生成物/构建产物不计入产品覆盖率,维护中的产品区域要逐步达到 75-80%+,新增或变更的可执行生产代码行必须满足 `coverage-thresholds.json` 里的 changed-line coverage 门槛。
- 不要为了过门禁随便降低 `coverage-baseline.json` 或 `coverage-thresholds.json`;确实要改时必须有 `allow-coverage-baseline-change` 和原因。历史低覆盖区域是技术债,新 PR 至少要让触达区域更好。
+56
View File
@@ -0,0 +1,56 @@
---
title: Code signing policy
nav_title: 签名政策
description: Claude Code Haha 正式发布包的签名范围、责任角色、审批、验证与撤销规则。
order: 5
---
# Code signing policy
本政策适用于 Claude Code Haha 的正式 Windows 发布包。项目正在申请 SignPath Foundation 免费代码签名;接入完成前,Windows 下载页会继续明确标注安装包尚未签名。接入完成后,只有符合本政策的构建产物才会提交签名。
Free code signing provided by SignPath.io, certificate by SignPath Foundation.
服务由 [SignPath.io](https://about.signpath.io) 和 [SignPath Foundation](https://signpath.org) 提供。
## 签名范围
签名仅用于本项目拥有并从 [NanmiCoder/cc-haha](https://github.com/NanmiCoder/cc-haha) 源码构建的 Windows 桌面程序、项目自有 sidecar,以及最终的 x64 和 ARM64 NSIS 安装包。
发布包可能包含在各自许可证下分发的第三方或上游开源组件。这些组件可以原样打包,但不会以 Claude Code Haha 自有二进制的身份签名。证书不会用于其他项目、个人构建、调试构建或来源不明的文件。
## 可信来源与构建
- 唯一可信源码来源是公开 GitHub 仓库的受保护发布提交或标签。
- 正式 Windows 产物由仓库内受版本控制的 GitHub Actions 工作流在 GitHub 托管的运行器上构建。
- 签名请求必须能追溯到具体提交、发布标签、工作流运行和构建产物。
- 签名失败、来源不明或元数据不一致的产物不得发布。
## 责任角色
- **Authors / Committers:** [@NanmiCoder](https://github.com/NanmiCoder),以及提交经审核贡献的外部贡献者。
- **Reviewers:** [@NanmiCoder](https://github.com/NanmiCoder);外部贡献必须经过维护者审核后才能进入正式发布提交。
- **Approvers:** [@NanmiCoder](https://github.com/NanmiCoder)。
团队成员必须为 GitHub 和 SignPath 账户启用多因素认证。角色或成员发生变化时,本页会同步更新。
## 审批与发布
每一次正式发布的签名请求都必须由 Approver 手动审批,不允许自动批准或绕过审批。批准前需要核对提交或标签、构建工作流、目标架构、文件名、产品名称、版本和发布说明。审批完成并验证签名后,产物才可以上传到 GitHub Releases。
## 用户验证
接入完成后,可以在 PowerShell 中检查 Windows 安装包:
```powershell
Get-AuthenticodeSignature ".\Claude-Code-Haha-<version>-win-x64.exe" |
Format-List Status, StatusMessage, SignerCertificate, TimeStamperCertificate
```
只在 `Status` 为 `Valid`、产品与版本符合预期且文件来自本项目 [GitHub Releases](https://github.com/NanmiCoder/cc-haha/releases) 时继续安装。
## 安全事件与撤销
如发现证书、签名账户、构建流程或发布产物可能被滥用,请通过 [GitHub 私密安全报告](https://github.com/NanmiCoder/cc-haha/security/advisories/new) 或发送邮件至 [relakkes@gmail.com](mailto:relakkes@gmail.com) 报告。维护者会暂停相关发布和签名请求、移除受影响的下载、调查来源,并在需要时联系 SignPath Foundation 撤销证书或签名。
软件联网与本地数据处理方式见[隐私与联网说明](./privacy.md)。
+4
View File
@@ -114,6 +114,10 @@ cp .env.example .env
安装器的数据保护不等于备份。真正重要的东西请自己另存一份。
:::
## Code signing policy
Windows 安装包的签名范围、人工审批、责任角色和验证方法见 [Code signing policy](./code-signing.md)。在 SignPath Foundation 接入完成前,Windows Release 仍会明确标注为未签名;软件联网和本地数据处理方式见[隐私与联网说明](./privacy.md)。
## 装完之后
去 [连接模型服务](./models.md)。没接模型之前,应用能打开,但发不出任何一条消息。
+1 -1
View File
@@ -44,7 +44,7 @@ Claude Code Haha 自己不带模型,它只是那个替你干活的壳。装完
内置预设(按弹窗里的排列):
- **DeepSeek** · **Zhipu GLM** · **Kimi** · **MiniMax** — 国内主流模型厂商,接口地址是各家的 Anthropic 兼容端点。
- **TeamoRouter** · **玄枢API** · **FennoAI** — 中转类服务商,用它们的通道调 Claude 官方模型。
- **玄枢API** · **FennoAI** — 中转类服务商,用它们的通道调 Claude 官方模型。
- **七牛云 AI** — 聚合类 MaaS 平台,一个密钥调 DeepSeek、GLM、Kimi、通义等多家模型。
- **LM Studio** · **Ollama** — 本地模型,见下一节。
- **Custom** — 上面都没有,自己填。
+41
View File
@@ -0,0 +1,41 @@
---
title: 隐私与联网说明
nav_title: 隐私与联网
description: Claude Code Haha 在本机保存什么、何时访问网络,以及如何清理数据。
order: 6
---
# 隐私与联网说明
Claude Code Haha 是本地优先的开源开发工具,项目本身不运营用于接收会话内容的云端后端。应用并非完全离线:当你选择模型服务、MCP、IM 或更新功能时,相关数据会发送到你选择或配置的第三方服务。
## 本地保存的数据
应用会在本机保存会话、工作区记录、服务商配置、技能、Agent、记忆、界面设置和日志。主要用户数据位于 `~/.claude`,部分桌面端状态由操作系统的应用数据目录管理。认证令牌和 API Key 会保存在本机,但在调用你选择的服务时会发送给对应服务完成认证。
## 何时访问网络
根据你启用的功能,应用可能发送以下信息:
- **模型与 OAuth 服务:** 你提交的提示词、附件、所选代码上下文、工具结果、模型参数和认证信息会发送给你选择的模型或账号服务商。
- **MCP 与外部工具:** 配置的 MCP 服务器、搜索、图像生成及其他工具会收到完成相应操作所需的输入。
- **IM 与远程访问:** 启用 Telegram、飞书、微信、钉钉、WhatsApp 或远程 H5 后,所选会话内容、消息和连接元数据会经过对应平台或你配置的中继服务。
- **更新:** 应用会访问 GitHub Releases 检查版本并按你的操作下载安装包。
- **网页链接:** 打开文档、登录页或其他网页时,浏览器会直接连接目标站点。
- **上游运行时流量:** 随应用提供的上游 Agent 运行时可能根据服务商和配置请求诊断、分析或功能开关服务。可以设置 `DISABLE_TELEMETRY=1` 和 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`,减少或关闭非必要流量。
每个第三方服务都按其自己的隐私政策处理收到的数据。使用前请检查对应服务商的条款,不要向未受信任的服务发送密钥、个人信息或私有代码。
## 项目维护者不会做的事
本项目维护者不会出售用户数据,也不会在应用中投放基于个人数据的广告。除非你主动在 Issue、讨论、日志或安全报告中提交,否则维护者不会收到你本机保存的会话和配置。
## 删除数据
卸载应用不会自动删除 `~/.claude` 中的会话与配置。需要彻底清理时,请先备份要保留的内容,再手动删除 `~/.claude` 以及操作系统应用数据目录中的 Claude Code Haha 数据。删除已发送给第三方服务的数据,需要按该服务商提供的流程操作。
## 联系方式
隐私或安全问题可以通过 [GitHub 私密安全报告](https://github.com/NanmiCoder/cc-haha/security/advisories/new) 或 [relakkes@gmail.com](mailto:relakkes@gmail.com) 联系维护者。
本说明最近更新于 2026 年 8 月 5 日。