Automate cross-system summarization workflow for Chronicle sessions. Export sessions from remote systems (like FreeBSD) and import/summarize on local machine with Gemini API. Use when you have sessions on a system without Gemini API access and need to summarize them on another machine.
This skill automates the workflow for summarizing Chronicle sessions across different systems (e.g., FreeBSD dev machine → Mac with Gemini API).
This skill auto-activates! (Milestone #13)
Prompts like "summarize session on remote" or "import session from FreeBSD" automatically trigger this skill!
Trigger patterns: remote, freebsd, import session, summarize on remote See:
docs/HOOKS.mdfor full details
Use this skill when:
Common scenario: FreeBSD development server (no Gemini API) → macOS laptop (has Gemini API key)
Chronicle provides import-and-summarize --quiet which:
-3)--quiet)No pollution between systems - the remote session stays on the remote system, only the summary is transferred.
Prerequisites:
chronicle config ai.gemini_api_key YOUR_KEY)Step 1: Configure Remote System (One-Time Setup)
# Configure FreeBSD remote system
chronicle config remote_systems.freebsd.hostname "chandlerhardy-dev.aws0.pla-net.cc"
chronicle config remote_systems.freebsd.chronicle_path "/home/chandlerhardy/.local/bin/chronicle"
# Verify configuration
chronicle config --list | grep freebsd
Step 2: Use the Skill
When Claude uses this skill and finds remote system configuration, it will automatically construct the command:
ssh chandlerhardy-dev.aws0.pla-net.cc "/home/chandlerhardy/.local/bin/chronicle export-session 7" | chronicle import-and-summarize --quiet 2>&1 | grep -A 999999 '^{$' | ssh chandlerhardy-dev.aws0.pla-net.cc "/home/chandlerhardy/.local/bin/chronicle import-summary"
If no config found, Claude will ask for the hostname and construct the command interactively:
Command (Manual):
ssh <remote-host> "chronicle export-session <id>" | chronicle import-and-summarize --quiet 2>&1 | grep -A 999999 '^{$' | ssh <remote-host> "chronicle import-summary"
Example:
ssh freebsd "chronicle export-session 7" | chronicle import-and-summarize --quiet 2>&1 | grep -A 999999 '^{$' | ssh freebsd "chronicle import-summary"
Note: The grep -A 999999 '^{$' filters out Google library warnings that can leak through even with --quiet and 2>/dev/null.
What this does:
Why --quiet works:
2>/dev/null suppresses Google library warnings (harmless)Time: Typically 30-60 seconds for large sessions (depends on transcript size)
If SSH pipes hang or you need to inspect intermediate files:
ssh <remote-host> "chronicle export-session <id>" > /tmp/session_<id>.json
Example:
ssh freebsd "chronicle export-session 7" > /tmp/session_7.json
cat /tmp/session_<id>.json | chronicle import-and-summarize --quiet 2>/dev/null > /tmp/summary.json
Example:
cat /tmp/session_7.json | chronicle import-and-summarize --quiet 2>/dev/null > /tmp/summary.json
What happens:
-3)/tmp/summary.jsoncat /tmp/summary.json | ssh <remote-host> "chronicle import-summary"
Example:
cat /tmp/summary.json | ssh freebsd "chronicle import-summary"
Result:
On import-and-summarize --quiet:
-1, -2, -3)~/.ai-session/sessions/session_-3.cleanedis_session=Truesummarize_session_chunked() with Gemini API{
"version": "1.0",
"original_id": 7,
"summary": "AI-generated summary...",
"summary_generated": true,
"keywords": ["feature", "implementation", "testing"]
}
session_-3.cleaned)On import-summary (remote side):
original_id (e.g., 7)response_summary, summary_generated=True, keywordsTested with:
All sessions work perfectly with this workflow.
Symptom: Command hangs indefinitely
Solution: Use manual 3-step workflow instead:
# Step 1: Export to file
ssh freebsd "chronicle export-session 7" > /tmp/session.json
# Step 2: Process locally
cat /tmp/session.json | chronicle import-and-summarize --quiet > /tmp/summary.json
# Step 3: Send back
cat /tmp/summary.json | ssh freebsd "chronicle import-summary"
Symptom: ImportError: google-generativeai package not installed
Solution: Configure Gemini API key on local machine:
chronicle config ai.gemini_api_key YOUR_API_KEY_HERE
Get free API key: https://ai.google.dev/
Symptom: Session 7 not found
Solution: Check session exists on remote:
ssh freebsd "chronicle sessions --limit 20"
Behavior: import-and-summarize will overwrite existing summaries
Note: This is by design - you can re-summarize sessions if needed.
--quiet flag: Essential for piping - suppresses status messages2>/dev/null to hide Google library warnings~/.local/bin/chronicleWhen invoked, Claude should:
Check for remote system config:
chronicle config --list | grep remote_systems
If config exists (e.g., remote_systems.freebsd.hostname):
chronicle config remote_systems.freebsd.hostnamechronicle config remote_systems.freebsd.chronicle_path<hostname>"If no config exists:
Run the command and monitor output
Confirm success or handle errors
User: "I have session 7 on my FreeBSD dev machine that needs summarization, but FreeBSD doesn't have Gemini API. Can you summarize it here on my Mac?"
Assistant (with config):
chronicle config remote_systems.freebsd.hostnamechandlerhardy-dev.aws0.pla-net.ccssh chandlerhardy-dev.aws0.pla-net.cc "/home/chandlerhardy/.local/bin/chronicle export-session 7" | chronicle import-and-summarize --quiet 2>&1 | grep -A 999999 '^{$' | ssh chandlerhardy-dev.aws0.pla-net.cc "/home/chandlerhardy/.local/bin/chronicle import-summary"
Assistant (without config):
chronicle config --list | grep remote_systemschandlerhardy-dev.aws0.pla-net.cc/home/chandlerhardy/.local/bin/chronicleIf one-liner hangs:
/tmp/session_7.json/tmp/summary.json# List unsummarized sessions on remote
ssh freebsd "chronicle sessions --limit 50" | grep "No summary"
# For each session ID (7, 8, 9):
for id in 7 8 9; do
echo "Summarizing session $id..."
ssh freebsd "chronicle export-session $id" | \
chronicle import-and-summarize --quiet 2>/dev/null | \
ssh freebsd "chronicle import-summary"
done
# Export and summarize
ssh freebsd "chronicle export-session 7" | \
chronicle import-and-summarize --quiet 2>/dev/null > /tmp/summary.json
# Review summary
cat /tmp/summary.json | jq '.summary'
# If satisfied, import
cat /tmp/summary.json | ssh freebsd "chronicle import-summary"
If you need to see what's happening, remove --quiet:
ssh freebsd "chronicle export-session 7" | chronicle import-and-summarize
# Shows: "Importing session...", "Summarizing...", "Cleaning up...", then JSON
Note: Without --quiet, JSON is NOT at line 1, so it won't pipe cleanly to import-summary.
chronicle export-session <id> - Export session as JSONchronicle import-session - Import session (permanent, gets new ID)chronicle import-and-summarize - Import + summarize + auto-cleanup (transient)chronicle import-summary - Update existing session with summarychronicle session <id> - View session details and summary