session-search
Search captured agent Runs and raw local/remote Pi sessions, especially dark-wizard sessions, using the joelclaw sessions bridge. Use when the user asks to search sessions, find prior dark-wizard/Panda/pi/codex/claude context, recover conversation history, verify session indexing, or bypass stale rag_search_sessions/Typesense results.
What this skill does
# Session Search
Use this when Joel asks for session/conversation history or when `rag_search_sessions` is missing config, stale, or too narrow.
Canonical terms:
- **Run**: captured agent invocation in Central/Typesense.
- **Conversation**: sibling Runs sharing interactive context.
- **Session Search Bridge**: CLI convenience that searches Central's derived Run index plus raw Pi session JSONL on the local Machine or a remote Machine over SSH.
## Fast path
Search both Central Typesense and raw dark-wizard Pi sessions from Panda:
```bash
joelclaw sessions search "<query>" \
--source both \
--machine dark-wizard \
--ssh-target joel@dark-wizard \
--limit 8
```
Read the JSON. Prefer hits with:
- `source: "typesense"` when the derived index is current
- `source: "local"` when running on the Machine that has the raw Pi files
- `source: "ssh"` when Typesense is stale or you need raw remote session files from another Machine
## Extract task context
When search finds a candidate but snippets are too thin, extract bounded task context without a background reader agent:
```bash
joelclaw sessions search "<query>" --source both --machine dark-wizard --limit 5 --extract
# singular alias also works:
joelclaw session search "<query>" --source both --machine dark-wizard --limit 5 --extract
```
For a known raw transcript path or session id:
```bash
joelclaw sessions extract <session-id-or-path> --query "<topic>" --format markdown
```
Use `sessions inspect` for deterministic evidence around exact text:
```bash
joelclaw sessions inspect <session-id-or-path> --around "<regex>" --before 20 --after 80
```
Use `sessions chunks` when you want matching chunks/snippets and neighboring raw context without full extraction:
```bash
joelclaw sessions chunks "<query>" --source local --machine dark-wizard --limit 20 --context-before 2 --context-after 4
```
Use `sessions signals` when the job is not recovery but analysis: finding high-signal user turns, friction, preferences, approvals, or decisions. This is ADR-0247-backed and deterministic in v1:
```bash
joelclaw sessions signals --kind friction --source local --machine dark-wizard --since 14d --limit 20
joelclaw sessions signals --kind any --source local --machine dark-wizard --since 14d --sample 20 --review-out ~/.joelclaw/session-signals/review.jsonl --evaluate
joelclaw sessions signals --kind mode-mismatch --source local --machine dark-wizard --since 14d --evaluate
joelclaw sessions signals --kind any --source local --machine dark-wizard --since 8w --format ndjson | jq -c 'select(.type=="hit" and .improvement.reviewPriority=="high")'
joelclaw sessions friction --source local --machine dark-wizard --since 14d
```
`friction` is an alias for `signals --kind friction`. The command filters to user turns first, classifies turnKind, and includes assistant/tool turns only as bounded evidence context. V1 includes `operator_intent`, `review_feedback`, and `approval`; it excludes task payloads, source material, and handoffs by default because those caused noisy false positives. Joel's `fuck`, `fucking`, and `fuckin` are strong emphasis signals, not automatic anger; classify by nearby critique/praise/correction language. `ShitRat` is agent identity, not friction. Use `--kind mode-mismatch` when hunting wrong execution shape: inline vs background, visual vs response, durable Inngest vs ad-hoc script, or feedback-blocking vs async.
Extraction returns session ID, path, dates, cwd, user prompts, decisions, commands run, files touched, outputs/receipts, verification, blockers, next actions, and transcript line evidence. It redacts likely secrets and does not dump whole transcripts.
Shape rules:
- `search --extract` attaches `extraction` directly to each emitted hit when available. `.result.extractions` is a compatibility convenience list. Piped `| jq` usage is supported for large envelopes.
- `extract --format markdown` still emits the canonical JSON envelope; rendered markdown is at `.result.markdown`.
- `chunks` exposes top-level `.result.chunks` / `.result.hits`, with source mirrors under `.result.local.chunks` and `.result.typesense.chunks`.
- Source metadata distinguishes `rawReturned` from `emittedHits` / `emittedChunks`.
- `signals` returns `kind`, `clusters`, `hits`, `signals[]`, stable `hitId`, exact `path`, and transcript line numbers. Treat it as a signal radar, not memory truth; promote only derived reusable guidance.
- Use `--sample N --review-out path.jsonl` to create a small golden set for human/agent labeling before tuning the classifier. Review rows include `verdict`, `correctedKind`, and `note` placeholders.
- Each signal includes `turnKind` plus a small reducer-shaped `improvement` route: surface (`system-prompt`, `skill`, `cli`, `harness`, `docs`, `memory`, `adr`, `none`), target, confidence, reviewPriority, suggested next step, and reason. Use `--evaluate` to summarize routing coverage by surface, kind, turnKind, confidence, and review priority.
- Use `--format ndjson` for balls-deep scans over SSH or thin Machines. It streams one JSON object per line: `meta`, many `hit` rows, then `summary`, so consumers can pipe through `jq` without requiring a giant response envelope.
## Source-specific searches
Typesense only:
```bash
joelclaw sessions search "<query>" --source typesense --machine dark-wizard --runtime pi --limit 8
joelclaw sessions search "<query>" --source typesense --machine dark-wizard --runtime codex --limit 8
joelclaw sessions search "<query>" --source typesense --machine all --runtime all --limit 8
```
Raw local Pi sessions only, for example on dark-wizard itself:
```bash
joelclaw sessions search "<query>" --source local --machine dark-wizard --limit 8
```
Raw remote Pi sessions only:
```bash
joelclaw sessions search "<query>" --source ssh --ssh-target joel@dark-wizard --limit 8
```
All Machines in Typesense:
```bash
joelclaw sessions search "<query>" --source typesense --machine all --runtime all --limit 8
```
Runtime filter:
- default: `--runtime pi`
- Codex: `--runtime codex`
- Claude Code: `--runtime claude-code`
- everything: `--runtime all`
Codex raw fallback is not scanned directly yet; Codex capture writes transcript deltas through Central `/api/runs`, then `memory/run.captured` indexes `runs_dev` / `run_chunks_dev`.
## When results disagree
If SSH finds fresh hits but Typesense does not, raw capture exists and the derived index is stale. Use the recovery runbook:
```bash
read ~/Code/joelhooks/joelclaw/docs/runbooks/typesense-session-indexing.md
```
Then verify:
```bash
KEY=$(secrets lease typesense_api_key)
curl -fsS -G http://localhost:8108/collections/runs_dev/documents/search \
-H "X-TYPESENSE-API-KEY: $KEY" \
--data-urlencode 'q=*' \
--data-urlencode 'filter_by=agent_runtime:=pi && machine_id:=dark-wizard' \
--data-urlencode 'per_page=3' \
--data-urlencode 'sort_by=started_at:desc' \
--data-urlencode 'include_fields=id,machine_id,started_at,tags' \
| jq '[.hits[].document | {id,machine_id,started_at:(.started_at/1000|todateiso8601)}]'
```
## Local and SSH requirements
The bridge expects the Machine being scanned to have:
- `python3`
- raw Pi sessions under `~/.pi/agent/sessions/**/*.jsonl`
SSH mode also needs:
- `ssh joel@dark-wizard` access
Smoke test:
```bash
ssh joel@dark-wizard 'hostname && python3 --version && find ~/.pi/agent/sessions -type f -name "*.jsonl" | head'
```
On dark-wizard itself:
```bash
joelclaw sessions search "<query>" --source local --machine dark-wizard --limit 8
```
With `--source both`, the raw side uses `local` when the current hostname matches `--machine`; otherwise it uses `ssh`. That keeps dark-wizard from SSHing to itself. If the local Machine has no Typesense credential, `both` skips Typesense and returns raw local hits with `typesenseSkipped`; use `--source local` when you want that explicitly. If Typesense is unavailable in `both` mode, the CLI reports `typesenseUnavailable` and continues with Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.