From ec745129258ae800065e302a2a40b54488cbca08 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 10 Feb 2026 09:52:34 +0200 Subject: Add tmux popup history storage and consolidate state files to XDG_STATE_HOME - Add StateDir() helper function respecting XDG_STATE_HOME (~/.local/state/hexai/) - Implement JSONL-based history storage for tmux popup submissions - New history.go with AppendHistory() and GetHistory() functions - Store timestamp, agent name, cwd, and submitted text - Comprehensive unit tests for history functionality - Integrate history append into tmux edit workflow after successful submission - Move logs from /tmp/ to persistent state directory: - hexai-lsp.log: ~/.local/state/hexai/hexai-lsp.log - hexai-tmux-edit.log: ~/.local/state/hexai/hexai-tmux-edit.log - Update README.md with File Locations section documenting XDG directories - Fix pre-existing test failures by isolating project config in unit tests - Panic on state directory creation failure instead of silent fallback All unit tests pass. Follows XDG Base Directory Specification for proper state file management with persistence across reboots. Co-Authored-By: Claude Sonnet 4.5 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 7011723..efb9b0c 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,20 @@ It has got improved capabilities for Go code understanding (for example, create ## Tmux Status Line See the [tmux integration guide](docs/tmux.md) for details on configuring the status line. + +## File Locations + +hexai follows the XDG Base Directory Specification: + +- **Configuration:** `~/.config/hexai/config.toml` (or `$XDG_CONFIG_HOME/hexai/`) + - Global settings, provider credentials, and preferences + - Project-specific: `.hexaiconfig.toml` at repository root +- **Cache:** `~/.cache/hexai/` (or `$XDG_CACHE_HOME/hexai/`) + - `stats.json` - LLM usage tracking (regenerable) + - `stats.lock` - File lock for stats access +- **State & Logs:** `~/.local/state/hexai/` (or `$XDG_STATE_HOME/hexai/`) + - `tmux-edit-history.jsonl` - History of text submitted via tmux popup + - `hexai-lsp.log` - LSP server debug logs + - `hexai-tmux-edit.log` - Tmux edit debug logs +- **Temporary Files:** `/tmp/` (OS temp directory) + - `hexai-*.md` - Temporary editor workspaces (auto-deleted) -- cgit v1.2.3