Development
Architecture
Section titled “Architecture”The aichat command has three layers:
- Python (
claude_code_tools/) — CLI entry points, backend logic, session parsing - Rust (
rust-search-ui/) — search TUI with Tantivy full-text search engine - Node.js (
node_ui/) — action menus (resume, export, trim, etc.)
Flow Diagram
Section titled “Flow Diagram”Python CLI (aichat search) | vRust binary (aichat-search) | Tantivy full-text search | Interactive TUI for humans vUser selects session | vNode.js menus (node_ui/) | Resume, export, trim, rollover options vPython backend | Session parsing, cloning, trimming vNew or modified sessionPrerequisites
Section titled “Prerequisites”- Python 3.11+
- UV —
curl -LsSf https://astral.sh/uv/install.sh | sh - Rust/Cargo —
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Node.js 18+ — required for action menus
-
Clone the repository:
Terminal window git clone \https://github.com/pchalasani/claude-code-toolscd claude-code-tools -
Create a virtual environment:
Terminal window uv venv --python 3.11source .venv/bin/activate -
Install dependencies:
Terminal window uv sync -
Install in editable mode:
Terminal window make install # Python (editable) + node_ui depsmake install-gdocs # with Google Docs/Sheets extrasmake aichat-search-install # Rust binary
After setup, Python changes apply immediately
(editable mode). For Rust changes, re-run
make aichat-search-install. Node.js runs directly
from node_ui/ — no build step needed.
Because make install is an editable install, the
aichat on your PATH runs from this checkout and uses
this checkout’s node_ui/node_modules. A fresh clone or
git worktree therefore needs its own copy of those npm
packages; make install installs them, and
make node-ui-deps installs them on their own. Without
them, aichat reports which packages are missing and
where it expected to find them instead of starting a menu.
Starlight Docs
Section titled “Starlight Docs”The documentation site lives in docs-site/ and
is built with Astro Starlight.
It deploys automatically to GitHub Pages on push
to main via .github/workflows/deploy-docs.yml.
To work on the docs locally:
# Start dev server with hot reloadmake docs-dev
# Build the site (output in docs-site/dist/)make docs-build
# Preview the built sitemake docs-previewThe content pages are in
docs-site/src/content/docs/. Pages using Starlight
components (Tabs, Steps, etc.) must be .mdx; plain
markdown pages can be .md. The sidebar structure
is configured in docs-site/astro.config.mjs.