# Longhand

Longhand keeps Claude Code session history on your machine and retrieves it with natural-language queries. It is useful when an old fix or decision needs to be found without API calls.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 14
- Author: Wynelson94
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Wynelson94/longhand
- Updated: 2026-09-28
- HTML: https://affpapa.org/en/nevibecode/mcp/longhand

## What it does

Longhand records Claude Code activity locally, including tool calls, file edits, and reasoning records. It stores that history in SQLite, then lets you search across sessions with fuzzy natural-language queries. Previous context remains available after the original session files are rotated or deleted.

Run `longhand setup` to ingest existing history, install hooks, and configure MCP. The CLI also provides `longhand recall` and `longhand status`, while the server exposes session search and timeline access. Longhand targets Python 3.10+, so that requirement applies when you install it through `uvx`.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add longhand -- uvx longhand
```
uvx runs the command named after the package; if the README names another one, use uvx --from longhand <command>

### Codex

**Platform CLI**
```bash
codex mcp add longhand -- uvx longhand
```
uvx runs the command named after the package; if the README names another one, use uvx --from longhand <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "longhand": {
            "command": "uvx",
            "args": [
                "longhand"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from longhand <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "longhand": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "longhand"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from longhand <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add longhand uvx longhand
```
uvx runs the command named after the package; if the README names another one, use uvx --from longhand <command>

## When to use it
- find an old fix across Claude Code sessions
- recover context after a break
- inspect events from a previous session
- keep Claude Code history in local storage

## Example prompts
- Find the earlier fix for the Stripe webhook problem from last week.
- Show the latest events from the session where authentication changed.
- Summarize the recent sessions for this project.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74569
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899

From the same set: [wynelson94/longhand](https://affpapa.org/en/nevibecode/by/wynelson94/longhand.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
