> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Snapshot Root • AI Agent SDK

> set_snapshot_root: Root filesystem change-tracking at ``project_path``.

# set\_snapshot\_root

Method

> This is a method of the [**Agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Agent.md) class in the [**agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/agent.md) module.

Root filesystem change-tracking at `project_path`.

Bots/gateway resolve file tools against a per-chat `Workspace` and
attach it *after* construction, but the FileSnapshot backing
:meth:`undo`/:meth:`redo`/:meth:`diff` was created at `__init__` time
rooted at `os.getcwd()`. Without this, `/undo` tracks the wrong
directory (never where the tools actually wrote). Call this once after
the workspace is known so change tracking follows the tools.

Rooting at a new directory clears the undo/redo stacks (they belong to
the previous root). A no-op when the root is unchanged. Returns `True`
when a snapshot manager is rooted at `project_path`.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def set_snapshot_root(project_path: str) -> bool
```

## Parameters

**project\_path** `str` *required*

No description available.

### Returns

**Returns** `bool`

The result of the operation.

## Uses

* `abspath`
* `FileSnapshot`
* `logger.debug`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/agent.py#L4411)
>
> `praisonaiagents/agent/agent.py` at line 4411


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.