{"id":46771563,"url":"https://github.com/pmarreck/chatscan","last_synced_at":"2026-03-13T02:01:43.638Z","repository":{"id":342689036,"uuid":"1174791326","full_name":"pmarreck/chatscan","owner":"pmarreck","description":"Search Claude Code conversation history with semantic + lexical search","archived":false,"fork":false,"pushed_at":"2026-03-07T23:59:32.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"yolo","last_synced_at":"2026-03-10T03:57:00.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmarreck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T21:05:08.000Z","updated_at":"2026-03-07T23:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pmarreck/chatscan","commit_stats":null,"previous_names":["pmarreck/chatscan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pmarreck/chatscan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmarreck%2Fchatscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmarreck%2Fchatscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmarreck%2Fchatscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmarreck%2Fchatscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmarreck","download_url":"https://codeload.github.com/pmarreck/chatscan/tar.gz/refs/heads/yolo","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmarreck%2Fchatscan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30362672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-09T23:37:31.340Z","updated_at":"2026-03-11T00:00:29.021Z","avatar_url":"https://github.com/pmarreck.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chatscan\n\n[![built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fpmarreck%2Fchatscan%3Fbranch%3Dyolo)](https://garnix.io)\n[![Build](https://github.com/pmarreck/chatscan/actions/workflows/build.yml/badge.svg?branch=yolo)](https://github.com/pmarreck/chatscan/actions/workflows/build.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nSearch your AI coding conversation history with semantic + lexical + recency search.\n\nSupports **Claude Code**, **Codex**, and **Gemini CLI** conversations. Indexes them into SQLite (with FTS5 + optional vector embeddings via Ollama) and provides fast hybrid search with recency weighting.\n\n## Quick start\n\n```bash\n# Index your conversations (auto-detects Claude, Codex, or Gemini)\nchatscan index\n\n# Search (scoped to current project by default)\nchatscan \"SIMD optimization\"\n\n# Search all projects\nchatscan \"error handling\" --all\n\n# Search across all LLM sources\nchatscan \"error handling\" --all-llms\n\n# Regex search via ripgrep\nchatscan --regex \"indexOfIgnoreCase\"\n\n# JSON output\nchatscan \"config\" --json\n```\n\n## Features\n\n- **Multi-LLM support** — indexes Claude (`~/.claude/projects/`), Codex (`~/.codex/sessions/`), and Gemini (`~/.gemini/tmp/`) conversations\n- **Hybrid search** — equally weighted semantic (vector), lexical (FTS5), and recency scoring\n- **Recency weighting** — recent conversations rank higher (exponential decay, 30-day half-life)\n- **Sandwich display** — matched message shown bold, with previous/next messages dimmed for context\n- **Auto-scoping** — searches are scoped to the current project by default (falls back to all if no conversations exist for cwd)\n- **Incremental indexing** — only re-indexes changed files based on mtime\n- **Project rename** — rename a project directory and update all conversation logs in one command\n- **Regex fallback** — `--regex` shells out to ripgrep against raw JSONL files\n- **Graceful degradation** — works without Ollama (lexical-only), warns and falls back automatically\n\n## Installation\n\n### With Nix (recommended)\n\n```bash\nnix run github:pmarreck/chatscan -- \"your query\"\n\n# Or install into your profile\nnix profile install github:pmarreck/chatscan\n```\n\n### From source\n\nRequires Zig 0.15+ and SQLite amalgamation:\n\n```bash\ngit clone https://github.com/pmarreck/chatscan.git\ncd chatscan\nnix develop  # sets up all dependencies\nzig build -Doptimize=ReleaseFast\n./zig-out/bin/chatscan help\n```\n\n## Usage\n\n```\nchatscan \u003cquery\u003e              Search conversations (implicit)\nchatscan search \u003cquery\u003e       Search conversations\nchatscan index                Index/update conversation database\nchatscan rename \u003cold\u003e \u003cnew\u003e   Rename project dir + update all logs\nchatscan config               Show configuration\nchatscan help                 Show this help\n\nSearch options:\n  --top \u003cn\u003e                     Number of results (default 10)\n  --all                         Search all projects\n  --project \u003cname\u003e              Search specific project\n  --role \u003cuser|assistant\u003e       Filter by message role\n  --regex                       Use ripgrep for regex search\n  --mode \u003cvector|lexical|hybrid\u003e Search mode (default hybrid)\n  --context-lines \u003cn\u003e           Lines to show per message (default 4)\n  --json                        JSON output\n\nLLM source options:\n  --llm \u003cclaude|codex|gemini\u003e   Select LLM source (default: auto-detect)\n  --all-llms                    Search across all available LLM sources\n  CHATSCAN_LLM=\u003cvalue\u003e          Env var alternative (claude|codex|gemini|all)\n\nIndex options:\n  --reindex                     Force full re-index\n\nGlobal options:\n  --db \u003cpath\u003e                   SQLite database path\n  --conversation-dir \u003cpath\u003e     Conversation files directory\n  --ollama-url \u003curl\u003e            Ollama server URL\n  --ollama-model \u003cname\u003e         Embedding model name\n  --embedding-dim \u003cn\u003e           Embedding dimension\n```\n\n## Multi-LLM support\n\nchatscan auto-detects which LLM sources are available on your system:\n\n| LLM | Conversation directory | Format |\n|-----|----------------------|--------|\n| Claude Code | `~/.claude/projects/` | JSONL per session |\n| Codex | `~/.codex/sessions/YYYY/MM/DD/` | JSONL with event_msg wrappers |\n| Gemini CLI | `~/.gemini/tmp/*/chats/` | JSON with messages array |\n\n```bash\n# Index only Codex conversations\nchatscan --llm codex index\n\n# Search only Gemini conversations\nchatscan --llm gemini \"build system\"\n\n# Index and search across all LLMs\nchatscan --all-llms index\nchatscan --all-llms \"error handling\" --all\n\n# Or set via environment variable\nexport CHATSCAN_LLM=all\nchatscan index\nchatscan \"your query\"\n```\n\n## Project rename\n\nRename a project directory and update all LLM conversation logs to match:\n\n```bash\n# Full paths\nchatscan rename /path/to/old-name /path/to/new-name\n\n# Basename shortcut (stays in same parent directory)\nchatscan rename /path/to/old-name new-name\n\n# Relative paths work too\nchatscan rename ./old-name ./new-name\n\n# From inside the project directory\nchatscan rename ../old-name ../new-name\n\n# Skip confirmation prompt\nchatscan rename old-name new-name --force\n```\n\nBefore making any changes, chatscan shows a detailed plan:\n\n```\nchatscan rename: the following changes will be made:\n\n  Project directory:\n    mv /Users/you/projects/old-name\n     → /Users/you/projects/new-name\n\n  Claude conversations:\n    rename ~/.claude/projects/-Users-you-projects-old-name/\n         → ~/.claude/projects/-Users-you-projects-new-name/\n    (47 files)\n\n  Codex sessions:\n    update cwd in 12 session files\n\n  Gemini:\n    update .project_root in 2 project dirs\n\n  chatscan index:\n    update 834 indexed messages\n\nProceed? [y/N]\n```\n\n## Configuration\n\nConfig file: `$XDG_CONFIG_HOME/chatscan/config` (default `~/.config/chatscan/config`)\n\n```\nconversation_dir = ~/.claude/projects\ndb_path = ~/.local/share/chatscan/index.sqlite3\nollama_url = http://localhost:11434\nollama_model = bge-large\nembedding_dim = 1024\n```\n\n## Optional: semantic search with Ollama\n\nFor vector-based semantic search, install and run [Ollama](https://ollama.ai) with an embedding model:\n\n```bash\nollama pull bge-large\nchatscan index    # will generate embeddings\nchatscan \"your query\" --mode hybrid\n```\n\nWithout Ollama, chatscan falls back to FTS5 lexical search automatically.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmarreck%2Fchatscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmarreck%2Fchatscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmarreck%2Fchatscan/lists"}