Idea · Aug 12, 2026
Terminal Historian
A Python CLI tool that silently records every terminal session into a local SQLite database and answers natural-language questions like 'How did I fix that PostgreSQL connection error last Tuesday?' using Claude API.
What it would do
Terminal Historian hooks into your shell via a tiny init-file addition and streams each command, its output, the working directory, exit code, and a timestamp into a local SQLite database. Nothing leaves your machine. After a session ends, a background job sends the session transcript to Claude to produce a compact AI-generated summary and a set of tags (languages, tools, topics, resolution status). A companion CLI — 'hist ask "how did I compile that Rust project last week"' — embeds the question and retrieves the most semantically relevant session chunks, then passes them to Claude for a precise conversational answer. A second subcommand, 'hist timeline', renders an ASCII weekly calendar of your terminal activity color-coded by topic. The key distinction from version control tools (Commit Narrator) or process monitors (Process Narrator) is the audience: this is retrospective search over raw shell work, not code-change explanations or live process explanations.
Key features
- Shell hook capturing commands, output, cwd, exit codes, and timestamps into local SQLite — no cloud sync
- Post-session AI summarization and tagging via Claude API (topics, tools, whether a problem was resolved)
- Natural-language query interface ('hist ask') using embedding-based retrieval over session chunks
- ASCII weekly timeline view color-coded by detected topic cluster
- Privacy-first: redacts lines matching secret patterns (API keys, passwords) before AI processing