> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/advanced-basic/agent-workspace/workspaces-tasks-files.md).

# 工作目录、任务与文件

Agent 的“记忆”和“文件”不是一回事。任务保存对话过程，工作目录保存本次任务可以直接处理的文件，Agent 记忆则在不同任务之间保留稳定事实和经验。

## 选择哪种工作目录

开始新任务时，工作目录选择器提供已有目录、【添加新工作目录】和【不使用工作目录】。

| 任务类型           | 建议选择         | 原因                   |
| -------------- | ------------ | -------------------- |
| 修改代码、整理资料、生成文档 | 只包含本次项目的目录   | 便于 Agent 找到文件并控制访问范围 |
| 临时问答或不需要本地文件   | 【不使用工作目录】    | 减少无关文件进入任务           |
| 需要临时产物但没有现成目录  | 使用应用创建的默认工作区 | 产物与个人目录分开            |

{% hint style="danger" %}
不要为了省事选择桌面根目录、用户主目录或包含大量私密资料的目录。工作目录决定 Agent 可以操作的文件范围，权限模式决定操作是否需要确认，两者要一起检查。
{% endhint %}

<figure><img src="/files/TasWLajyXW8HPnIMV4LR" alt="Agent 工作区中的任务列表、工作目录和主操作区"><figcaption><p>开始前先确认当前 Agent、任务和工作目录，避免把文件写到错误项目。</p></figcaption></figure>

## 管理任务

* 点击【新任务】开始新的上下文；
* 任务可以重命名、固定和按工作目录分组；
* 右键任务可选择【在新标签页中打开】或【从新窗口打开】；
* 一个 Agent 至少保留一个任务；
* 删除工作目录记录时，会删除其下的任务记录，但不会删除磁盘目录本身。

## 在右侧面板处理文件

Agent 生成或修改文件后，打开右侧【文件】即可浏览工作区。可编辑的 UTF-8 文本文件支持在预览与编辑之间切换，输入后自动保存，不需要另点保存按钮。

如果磁盘上的文件在编辑期间被其他程序修改，Cherry Studio 会提示重新加载。选择重新加载会放弃当前草稿；保留草稿时自动保存会暂停，直到冲突处理完成。

## 产物与任务状态

右侧【状态】会汇总 Agent 声明的产物、子智能体、工作流、后台命令和上下文用量。长任务运行时，可以先在这里判断它是在继续工作、等待权限，还是已经失败。

<figure><img src="/files/Nsb1dVVydwXKih32ewe5" alt="Agent 右侧状态面板中的产物、任务与后台执行信息"><figcaption><p>长任务先看【状态】判断是在运行、等待批准还是已经失败。</p></figcaption></figure>

## 做到什么算完成

* 任务顶部显示的是本次项目目录；
* 右侧【文件】能找到约定的交付文件；
* 右侧【状态】没有待批准或失败的步骤；
* 原始资料未被覆盖，交付文件可以独立打开。

## 用户案例：整理采访素材

为“采访整理”Agent 新建任务，工作目录只选择本次采访文件夹。要求 Agent 保留原始记录，新建 `summary.md` 和 `quotes.md`。任务完成后在右侧【文件】检查引用与文字，并直接修订少量错字；下一位受访者另开新任务，避免上下文混用。

<details>

<summary>右侧为什么没有【文件】？</summary>

当前任务没有可访问的工作目录，或目录已经不可访问。先在任务顶部重新选择工作目录，再发送一条消息让 Agent 读取文件。

</details>

<details>

<summary>哪些文件不能直接编辑？</summary>

二进制文件、非 UTF-8 文本和体积较大的文件只提供预览或外部打开。它们仍可由 Agent 工具处理，但不一定能在内置编辑器中修改。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/advanced-basic/agent-workspace/workspaces-tasks-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
