explaingit

al3rez/zehn

15ZigAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A fast command-line tool that searches across all your past Claude Code, Codex, pi, and opencode conversations at once, letting you find and jump back into any previous AI coding session in under a second.

Mindmap

mindmap
  root((zehn))
    What it does
      Searches AI chat history
      Jumps to past sessions
      Resumes conversations
    Supported tools
      Claude Code
      Codex
      pi
      opencode
    Features
      Fuzzy search
      Favorites list
      Clipboard copy
      Cross-tool reuse
    Setup
      Zig 0.16+
      curl one-liner install
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Search through months of Claude Code and Codex sessions by keyword to find a specific prompt or solution you wrote earlier

USE CASE 2

Resume a past coding assistant session in the correct project directory with a single keypress

USE CASE 3

Copy a prompt from a Claude Code session and replay it in Codex to compare how different AI tools respond to the same question

Tech stack

Zig

Getting it running

Difficulty · moderate Time to first run · 5min

Requires Zig 0.16 or newer, commercial use requires a separate license agreement.

Free for personal non-commercial use, commercial use requires a separate agreement with the author.

In plain English

zehn is a small command-line tool that searches across all your past AI coding assistant conversations at once and lets you jump back into any of them. It works with four tools: Claude Code, Codex, pi, and opencode. If you have been switching between those assistants over days or weeks, finding a specific thing you asked for earlier means digging through separate history files in different formats. zehn reads all of them and presents the combined history in a single searchable list. The name comes from the Persian and Arabic word for "the mind" and is pronounced like "zen." The tool is written in Zig, a compiled systems programming language, which is what allows it to read and parse around 1,300 sessions in roughly 0.2 seconds on the author's machine. Using it is simple: run the command, start typing a few letters from the prompt you remember, use the arrow keys to move through results, and press Enter. zehn then changes into the project directory where that session lived and runs the appropriate resume command for whichever assistant owns it. If the project folder no longer exists, it falls back to your current directory. Each assistant's results appear in a distinct color so you can tell at a glance where a result came from. Beyond basic search, the tool has a few extra features. You can mark prompts as favorites so they float to the top of future searches. You can copy a prompt to the clipboard or send it to a different assistant than the one it originally came from, which lets you reuse a question you wrote in one tool with a different AI. There are also filter flags to show results from only one assistant, or to print output without the interactive interface. Installation uses a one-line curl command that downloads, builds, and installs the binary automatically. Zig 0.16 or newer is required. The license allows free noncommercial use, commercial use requires a separate agreement.

Copy-paste prompts

Prompt 1
Install zehn with the one-line curl command and walk me through searching for a past Claude Code session where I debugged a React rendering issue.
Prompt 2
How does zehn parse conversation history files from four different AI coding tools that each store sessions in different formats?
Prompt 3
I want to mark a frequently used prompt as a favorite in zehn so it floats to the top of my searches. How do I do that?
Prompt 4
Show me the zehn filter flags so I can list only my opencode sessions without seeing Claude Code or Codex results.
Open on GitHub → Explain another repo

← al3rez on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.