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 16+ — 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 synccd node_ui && npm install && cd .. -
Install in editable mode:
Terminal window make install # Python (editable)make 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.
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.
Development Topics
Section titled “Development Topics” Contributing Fork, branch, test, and open a pull request.
Make Commands All available Make targets grouped by category.
Publishing Release Python packages to PyPI and Rust binaries to crates.io.
Testing How to test changes across the Python, Rust, and Node.js layers.