sync: auto-sync from GURU-5070 at 2026-06-02 20:40:54

Author: Mike Swanson
Machine: GURU-5070
Timestamp: 2026-06-02 20:40:54
This commit is contained in:
2026-06-02 20:40:57 -07:00
parent 0b854bc737
commit 480f97ed3e
39 changed files with 1101 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
# Claude Code Commands
# Claude Code Commands (also available to Grok)
Custom commands that extend Claude Code's capabilities.
Custom commands that extend the AI's capabilities (Claude Code or Grok).
These live in `.claude/commands/*.md`. For Grok coexistence, thin native wrappers exist in `.grok/skills/<name>/SKILL.md` (with `name:` frontmatter so `/save`, `/rmm` etc. work as first-class Grok slash commands via project skill discovery). The wrappers delegate to these files (read them at runtime + adapt tool names). Single source of truth remains here. See `.grok/README.md` for details.
## Available Commands

View File

@@ -1,6 +1,9 @@
Reconstruct a session log from a Claude Code transcript when a session crashed or was closed before `/save`.
Reconstruct a session log from a Claude Code or Grok transcript when a session crashed or was closed before `/save`.
Claude Code writes every session live to a transcript JSONL under `~/.claude/projects/<slug>/<uuid>.jsonl`. `/recover` distills one of those transcripts back into a normal session log in the `.claude/commands/save.md` format. This is the **manual, reviewed** path; the background detector (`detect_orphaned_sessions.py`) handles unattended auto-recovery.
- Claude Code: `~/.claude/projects/<slug>/<uuid>.jsonl`
- Grok: `~/.grok/sessions/<slug>/<uuid>/` (chat_history.jsonl + events + terminal/call-*.log etc.)
`/recover` distills the transcript back into a normal ClaudeTools session log (the format used by `/save`). This is the **manual, reviewed** path. The driver is auto-detected or can be forced.
---
@@ -82,3 +85,24 @@ Use `/recover` when you know a specific session was lost and want a clean log. L
- `--auto` and `--json` modes on `recover_session.py` exist for the detector and for scripting; `/recover` uses `--print` so Claude always reviews before anything lands on disk.
- The prose is Ollama-drafted from the transcript; the Commands/Config/Reference sections are extracted verbatim by Python. Never trust the prose for exact commands, IPs, credentials, paths, SHAs, or ticket IDs — read those from the verbatim sections.
- Transcripts are per-machine. You can only recover sessions that ran on the machine you are on.
## Grok sessions
Grok stores richer per-session artifacts (separate chat_history, events, per-tool terminal logs with full output, summary, etc.) under `~/.grok/sessions/<slug>/<uuid>/`.
The companion script is `.claude/scripts/recover_grok_session.py`.
Current support (MVP):
- `--list`, `--latest`, `--uuid <id>` work and locate the right dir using the same slug rules Grok uses.
- Extracts terminal command logs (highest value verbatim evidence) + basic metadata.
- `--print` and `--auto` (writes under `session-logs/grok-session-....md`).
Full parity with the Claude recover (conversation reconstruction + Ollama prose for Summary/Decisions + exact file-edit extraction) is planned; the two scripts can share helpers later.
In `/recover` flows, if the chosen orphan or explicit id lives under a Grok sessions tree, the Grok script is used automatically (future enhancement to the dispatcher in recover_session.py or a thin wrapper).
Example (manual):
```bash
py .claude/scripts/recover_grok_session.py --latest --print
py .claude/scripts/recover_grok_session.py --uuid 019e8b67-f97e-7b33-9c45-ec34b342d3eb --auto
```