# HistoryManager

> **Class** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/widgets/history/HistoryManager)

Manages command history with file persistence.

Uses append-only writes for concurrent safety. Multiple agents can
safely write to the same history file without corruption.

## Signature

```python
HistoryManager(
    self,
    history_file: Path,
    max_entries: int = 100,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `history_file` | `Path` | Yes | Path to the JSON-lines history file |
| `max_entries` | `int` | No | Maximum number of entries to keep (default: `100`) |

## Constructors

```python
__init__(
    self,
    history_file: Path,
    max_entries: int = 100,
) -> None
```

| Name | Type |
|------|------|
| `history_file` | `Path` |
| `max_entries` | `int` |


## Properties

- `history_file`
- `max_entries`
- `in_history`

## Methods

- [`add()`](https://reference.langchain.com/python/deepagents-cli/widgets/history/HistoryManager/add)
- [`get_previous()`](https://reference.langchain.com/python/deepagents-cli/widgets/history/HistoryManager/get_previous)
- [`get_next()`](https://reference.langchain.com/python/deepagents-cli/widgets/history/HistoryManager/get_next)
- [`reset_navigation()`](https://reference.langchain.com/python/deepagents-cli/widgets/history/HistoryManager/reset_navigation)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a827cddf72d72e4b17921b8eb445a3bfb0511cb4/libs/cli/deepagents_cli/widgets/history.py#L15)