# FilesystemClaudeTextEditorMiddleware

> **Class** in `langchain_anthropic`

📖 [View in docs](https://reference.langchain.com/python/langchain-anthropic/middleware/anthropic_tools/FilesystemClaudeTextEditorMiddleware)

Filesystem-based text editor tool middleware.

Provides Anthropic's `text_editor` tool using local filesystem for storage.
User handles persistence via volumes, git, or other mechanisms.

## Signature

```python
FilesystemClaudeTextEditorMiddleware(
    self,
    *,
    root_path: str,
    allowed_prefixes: list[str] | None = None,
    max_file_size_mb: int = 10,
)
```

## Description

**Example:**

```python
from langchain.agents import create_agent
from langchain.agents.middleware import FilesystemTextEditorToolMiddleware

agent = create_agent(
    model=model,
    tools=[],
    middleware=[FilesystemTextEditorToolMiddleware(root_path="/workspace")],
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `root_path` | `str` | Yes | Root directory for file operations. |
| `allowed_prefixes` | `list[str] \| None` | No | Optional list of allowed virtual path prefixes.  Defaults to `['/']`. (default: `None`) |
| `max_file_size_mb` | `int` | No | Maximum file size in MB  Defaults to `10`. (default: `10`) |

## Extends

- `_FilesystemClaudeFileToolMiddleware`

## Constructors

```python
__init__(
    self,
    *,
    root_path: str,
    allowed_prefixes: list[str] | None = None,
    max_file_size_mb: int = 10,
) -> None
```

| Name | Type |
|------|------|
| `root_path` | `str` |
| `allowed_prefixes` | `list[str] \| None` |
| `max_file_size_mb` | `int` |


---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/6fb37dba71da807af60aa7b909f71f0625a666bf/libs/partners/anthropic/langchain_anthropic/middleware/anthropic_tools.py#L1064)