chatgroup-architecture
CommandChatGroup architecture — how conversation data flows from raw JSONL to rendered chat groups. Use when working on UserGroup,…
Execute SQL queries against Claude Code, Codex CLI, macOS Unified Logs, Git, and source code data. Usage: /devsql:query <SQL>
> /plugin marketplace add douglance/devsql> /plugin install devsql@devsql
description: Execute SQL queries against Claude Code, Codex CLI, macOS Unified Logs, Git, and source code data. Usage: /devsql:query <SQL>
Execute a direct SQL query against developer-local data, including macOS Unified Logs. This slash command is a convenience fallback; agents should prefer the DevSQL Code Mode server (`devsql --mcp`) when it is connected.
Install devsql first:
brew install douglance/tap/devsql
Run the user's SQL query using devsql:
devsql "$ARGUMENTS"
For agent tool commands, use the subcommands directly:
devsql search "parse" # Find symbols by name devsql context src/engine.rs # File metadata + symbols devsql history src/engine.rs # Git history for a file devsql diff main~5 HEAD # Compare refs (file + symbol level) devsql impact src/lib.rs # Exports and dependents
Run `devsql schema <table>` for any table's exact columns.
-- Recent errors; invoke with --log-last 10m --log-level info SELECT timestamp, process, subsystem, category, message FROM macos_logs WHERE process = 'ExampleApp' AND message LIKE '%error%' ORDER BY timestamp DESC LIMIT 100; -- Recent Claude prompts SELECT display, project FROM history ORDER BY timestamp DESC LIMIT 10; -- Recent Codex prompts SELECT datetime(timestamp/1000, 'unixepoch') AS time, display FROM jhistory ORDER BY timestamp DESC LIMIT 10; -- Commits correlated with Codex prompt activity SELECT date(c.authored_at) AS day, COUNT(*) AS commits, COUNT(j.session_id) AS codex_prompts FROM commits c LEFT JOIN jhistory j ON date(c.authored_at) = date(datetime(j.timestamp/1000, 'unixepoch')) GROUP BY day ORDER BY day DESC; -- Find all public Rust functions (Rust emits kind='fn'; JS/TS use 'function') SELECT name, file_path, line_start, signature FROM symbols WHERE kind = 'fn' AND visibility = 'pub' ORDER BY file_path, line_start; -- Top sessions by cache-read tokens SELECT title, project, total_cache_read_input_tokens FROM sessions ORDER BY total_cache_read_input_tokens DESC LIMIT 10; -- Files with the most symbols SELECT s.file_path, f.language, COUNT(*) as symbol_count FROM symbols s JOIN source_files f ON s.file_path = f.path GROUP BY s.file_path ORDER BY symbol_count DESC LIMIT 10; -- Join prompts with code changes: which files were you working on? SELECT df.path, COUNT(DISTINCT c.id) as commits, COUNT(DISTINCT h.timestamp) as prompts FROM diff_files df JOIN commits c ON df.commit_id = c.id LEFT JOIN history h ON date(c.authored_at) = date(datetime(h.timestamp/1000, 'unixepoch')) GROUP BY df.path ORDER BY commits DESC LIMIT 10;
Display results in a formatted table. For large results, suggest the user pipe to csv:
devsql -f csv "SELECT ..." > output.csv
Code Mode for observing AI coding history, shell history, macOS Unified Logs, Git repositories, and source code. Code Mode is the primary agent interface; the direct SQL CLI remains available for humans and scripts.
ChatGroup architecture — how conversation data flows from raw JSONL to rendered chat groups. Use when working on UserGroup,…