# StateClaudeTextEditorMiddleware

> **Class** in `langchain_anthropic`

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

State-based text editor tool middleware.

Provides Anthropic's `text_editor` tool using LangGraph state for storage.
Files persist for the conversation thread.

## Signature

```python
StateClaudeTextEditorMiddleware(
    self,
    *,
    allowed_path_prefixes: Sequence[str] | None = None,
)
```

## Description

**Example:**

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

agent = create_agent(
    model=model,
    tools=[],
    middleware=[StateTextEditorToolMiddleware()],
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `allowed_path_prefixes` | `Sequence[str] \| None` | No | Optional list of allowed path prefixes.  If specified, only paths starting with these prefixes are allowed. (default: `None`) |

## Extends

- `_StateClaudeFileToolMiddleware`

## Constructors

```python
__init__(
    self,
    *,
    allowed_path_prefixes: Sequence[str] | None = None,
) -> None
```

| Name | Type |
|------|------|
| `allowed_path_prefixes` | `Sequence[str] \| None` |


---

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