# 如何在一个桌面应用中运行多个 Claude Code 和 Codex 会话

> 在一个桌面应用中运行多个 Claude Code 和 Codex 会话。在 HB Code 中添加项目文件夹，为每项任务启动一个会话。

在 HB Code 中，每个会话在一个项目文件夹中运行一个代理。侧边栏列出项目及其会话，并标出正在运行的会话。

HB Code 是 Mac 和 Windows 桌面应用，使用你自己的 Claude 和 ChatGPT 套餐，在你的电脑上运行 Claude Code 和 Codex。

## 步骤

1. 点击侧边栏中的“添加项目”，选择电脑上的项目文件夹。
2. 点击项目上的“新建会话”，在对话框中选择 Codex 或 Claude 代理。
3. 点击“开始 Codex 会话”或“开始 Claude 会话”。该会话会一直使用所选代理。
4. 要继续代理已保存的对话，请在同一对话框中选择它，然后点击“继续对话”。
5. 为下一项任务启动另一个会话。侧边栏标记会显示哪些会话正在运行。
6. 选择会话即可打开其对话。你也可以在独立窗口中打开会话。

## 说明

- 代理在你的电脑上运行，并在本地项目文件夹中工作。
- Codex 使用你的 ChatGPT 账户，Claude Code 使用你的 Claude 账户。HB Code 不包含这两个套餐。
- 运行期间发送的消息会加入当前执行轮次。你也可以将消息放入会话队列。
- 会话的子代理显示为该会话下的对话。

## 查看手册详情

- [You choose the agent when you create the session](https://www.hbcode.ai/docs/agents.md#agent-choice): How Codex and Claude share one chat layer
- [Projects, worktrees, and sessions](https://www.hbcode.ai/docs/architecture.md#sessions): Process boundaries
- [Find and continue a saved conversation](https://www.hbcode.ai/docs/claude-agent-sdk.md#continue-conversation): The Claude Agent SDK integration
- [Message delivery: outbox, turn, history](https://www.hbcode.ai/docs/message-delivery.md)

## 指南

- [如何查看使用限额并使用多个账户](https://www.hbcode.ai/zh-Hans/claude-code-usage-limits.md)
- [如何查看 Claude Code 或 Codex 的工作结果](https://www.hbcode.ai/zh-Hans/claude-code-ui.md)
- [如何在手机上使用 Claude Code 或 Codex](https://www.hbcode.ai/zh-Hans/claude-code-mobile.md)
- [如何查看 Claude Code 子代理的工作内容](https://www.hbcode.ai/zh-Hans/claude-code-subagents.md)
- [如何让 Claude Code 和 Codex 尝试同一项任务](https://www.hbcode.ai/zh-Hans/claude-code-vs-codex.md)
- [如何在 Mac 和 Windows 桌面应用中运行 Codex](https://www.hbcode.ai/zh-Hans/codex-desktop-app.md)
- [下载 HB Code](https://www.hbcode.ai/zh-Hans/downloads)
