From 321fc03cfb804bff6e42faf98a771f54d4b385fe Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Wed, 28 Jan 2026 23:57:01 -0800 Subject: [PATCH] docs: Update CLAUDE.md with multi-machine setup and key patterns Add standard Claude Code header, reference to TAILSCALE_SETUP.md for multi-machine deployment, single test example, and raw entries pattern. Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9d6a0c7..86b6836 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,11 +1,15 @@ # CLAUDE.md +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + Queryable analytics for Claude Code session logs, exposed as an MCP server and CLI. **API Reference**: `agent-session-analytics-cli --help` or `src/agent_session_analytics/guide.md` (MCP resource: `agent-session-analytics://guide`). **Schema Design**: See [docs/SCHEMA.md](docs/SCHEMA.md) for database tables, indexes, and migration history. +**Multi-Machine Setup**: See [docs/TAILSCALE_SETUP.md](docs/TAILSCALE_SETUP.md) for deploying across machines with Tailscale. + --- ## ⚠️ DATABASE PROTECTION @@ -48,6 +52,9 @@ make check # fmt, lint, test make install-server # LaunchAgent + CLI + MCP config (idempotent, restarts service) make restart # Lightweight service restart (no dependency sync) make logs # Tail server logs + +# Run single test +uv run pytest tests/test_storage.py::TestRawEntries::test_add_raw_entries_batch -v ``` ### When to Restart @@ -63,8 +70,9 @@ make logs # Tail server logs ## Key Patterns - **Storage API**: Use `storage.execute_query()` / `execute_write()`; avoid `_connect()` -- **Migrations**: `@migration(version, name)` decorator in storage.py +- **Migrations**: `@migration(version, name)` decorator in storage.py; update `SCHEMA_VERSION` constant - **CLI/MCP parity**: Every query accessible from both interfaces +- **Raw entries**: `raw_entries` table stores unparsed JSONL for future re-parsing; always store alongside parsed events ---