aics (AI Chat Search) is a cross-platform Rust TUI for searching local Claude Code and Codex CLI chat session history.
It builds a local Tantivy index over your session JSONL files and gives you an interactive terminal UI with full-text search, live previews, filters, and a markdown-rendered session viewer. It can also emit JSONL results for scripting, delete unwanted sessions, resume sessions, attach an AI-generated (Claude Code or Codex CLI) summary to sessions, and more.
- Full-text search across Claude Code and Codex CLI sessions
- Incremental indexing — only new or changed sessions get re-indexed on startup
- Interactive TUI with session list, snippet preview, and scrollable full-session viewer
- Filter modal: scope, agent, date range, minimum length, session kind (original / trimmed / rollover / sub-agent), live sessions
- Sort by time or text relevance
- Markdown rendering with syntax highlighting and search-term highlighting in the viewer
- Multiple themes (lazygit, aics, sunset, late.sh), configurable via settings modal
- Configurable claude/codex launch commands so
aicscan hand off to resume a session --jsonmode for scripting- JavaScript rules for previewing or applying batch session cleanup actions
- Cross-platform: Linux, macOS, Windows (path matching handles symlinks and Windows case-insensitivity)
Pre-built binaries for Linux, macOS (Intel + Apple Silicon), and Windows are published on the releases page.
From source: cargo install --path .
# Search sessions for the current directory, open the TUI
aics
# Search across all indexed sessions
aics -g
# Emit JSONL instead of launching the TUI
aics --json -g "vector db"
# Preview JavaScript cleanup rules from ~/.config/aics/rules.js
aics --preview-rules -g
# Write TypeScript declarations for JavaScript cleanup rules
aics --write-rules-dts
# Delete or rebuild the index
aics <--rebuild-index|--delete-index>Run aics --help for the full flag list.
By default, searches are scoped to the current working directory. Use -g / --global to search everything, or --dir PATH[:BRANCH] to target a specific project (optionally filtered by branch).
--after and --before accept YYYY-MM-DD or RFC3339 timestamps.
Rules live at ~/.config/aics/rules.js by default. Use --preview-rules to print proposed actions without changing files, or --apply-rules to apply supported actions. Use --rules PATH to test another rules file. Run aics --write-rules-dts to write TypeScript declarations for the rules API to ~/.config/aics/rules.d.ts.
rule("trash short commit helper sessions", ({ turns, re }) => {
return turns.user.length === 2 &&
re(String.raw`\s*[/$](gdf-)?commit\b`, "m").test(turns.user[0].text(4096))
? trash("commit helper")
: nothing();
});For the first implementation, rules can return nothing() or trash(reason). Rules mode honors the usual scope/filter flags such as -g, --dir, --agent, --after, --before, --min-lines, and --sub-agent, but it does not accept a text search query yet.
Large transcript fields are fetched from Rust only when a rule calls one of the lazy methods. The limit argument is optional; omitting it uses a practically unbounded default for stress testing, but normal rules should pass an explicit byte limit:
session.firstUserText(limit),session.firstText(limit),session.lastText(limit)turns.user[n].text(limit),turns.contextualUser[n].text(limit),turns.agent[n].text(limit),turns.system[n].text(limit),turns.toolResults[n].text(limit)turns.exec[n].stdout(limit),turns.exec[n].stderr(limit)turns.patches[n].files[m].content(limit)
turns.user excludes Codex contextual user fragments such as automatically injected AGENTS.md content. Those entries are exposed separately as turns.contextualUser.
| Key | Action |
|---|---|
↑ / ↓ |
Move selection |
PgUp / PgDn |
Scroll preview / viewer |
⏎ |
Open actions menu for selected session |
^F |
Filters modal |
^S |
Settings modal |
^T |
Toggle preview panel |
^Y |
Toggle session/summary preview mode |
^X |
View menu |
^] / ^\ |
Resize list/preview split; Ctrl+5 / Ctrl+4 are aliases |
Shift+↑ / Shift+↓ |
Jump between messages in the viewer |
? / ^L |
Help |
Esc |
Cancel / close modal |
^C |
Quit |
Session data is indexed from:
~/.claude/projects/(Claude Code)~/.codex/sessions/(Codex CLI)
By default, index data is stored under the user's home-relative cache dir, with one profile per discovered session-root set:
{userhome}/.cache/aics/profiles/<profile-id>/
Each profile stores:
index/(Tantivy index files)index_state.jsonprofile.jsonhashed-input.txt
Override the index/cache root with AICS_CACHE_ROOT.
Settings are stored in settings.json under the user's home-relative config dir:
{userhome}/.config/aics/settings.json
Override the config root with AICS_CONFIG_ROOT.
Available options:
theme(lazygit,aics,sunset,late.sh)claude_commanddefault:claude,claude_argsdefault:--dangerously-skip-permissionscodex_commanddefault:codex,codex_argsdefault:--yoloshow_previewpreview_width_pctsession_separatorsnippet_line_countsummarize_commandsummarize_prompt
MIT. See LICENSE.



