Enable Hyperspell Auto-Trace
Set up automatic session trace sending to Hyperspell for memory extraction
What this skill does
# Enable Hyperspell Auto-Trace
This skill configures a Claude Code `SessionEnd` hook that automatically sends your conversation transcripts to Hyperspell at the end of each session. Hyperspell extracts procedural memories and emotional context from these traces, so your agents can learn from past sessions.
## Instructions
### Step 1: Verify Prerequisites
Check that `jq` is installed:
```sh
which jq
```
If not found, display:
```
jq is required for the auto-trace hook. Install it with:
brew install jq (macOS)
apt install jq (Linux)
```
Wait for the user to install it before continuing.
### Step 2: Get the API Key
When the user invoked this skill, they may have passed an API key as an argument: '$1'
If that string is blank or not a valid API key (should start with `hs-` or `hs_`), check:
1. The current project's `.env.local` or `.env` for `HYPERSPELL_API_KEY`
2. The user's shell profile (`~/.zshrc`, `~/.bashrc`, `~/.zprofile`) for an exported `HYPERSPELL_API_KEY`
If still not found, ask the user:
```
Please paste your Hyperspell API key. Get one at https://app.hyperspell.com/api-keys
```
### Step 3: Get the User ID
Check the user's shell profile for `HYPERSPELL_USER_ID`. If not found, ask:
```
What user ID should traces be associated with? This can be your email or any identifier.
```
If the user doesn't have a preference, suggest using their system username (output of `whoami`).
### Step 4: Ensure Environment Variables Are Exported
Check the user's primary shell profile (usually `~/.zshrc` on macOS). If `HYPERSPELL_API_KEY` is not exported there, add it:
```sh
export HYPERSPELL_API_KEY="<the-api-key>"
```
Similarly for `HYPERSPELL_USER_ID` if the user provided a custom one.
**Do not duplicate** if the export already exists -- update the existing line instead.
### Step 5: Create the Trace Script
Create the directory `~/.hyperspell/` if it doesn't exist, then write the following script to `~/.hyperspell/send-trace.sh`:
```bash
#!/usr/bin/env bash
# Hyperspell Auto-Trace: Sends Claude Code session transcripts to Hyperspell
# for procedural memory and mood extraction.
#
# Invoked by a Claude Code SessionEnd hook. Reads hook JSON from stdin.
set -euo pipefail
INPUT=$(cat)
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty')
TRANSCRIPT_PATH=$(echo "$INPUT" | jq -r '.transcript_path // empty')
if [ -z "$TRANSCRIPT_PATH" ] || [ ! -f "$TRANSCRIPT_PATH" ]; then
exit 0
fi
if [ -z "$SESSION_ID" ]; then
exit 0
fi
if [ -z "${HYPERSPELL_API_KEY:-}" ]; then
exit 0
fi
HYPERSPELL_API_URL="${HYPERSPELL_API_URL:-https://api.hyperspell.com}"
HYPERSPELL_USER_ID="${HYPERSPELL_USER_ID:-$(whoami)}"
HISTORY=$(cat "$TRANSCRIPT_PATH")
PAYLOAD=$(jq -n \
--arg session_id "$SESSION_ID" \
--arg history "$HISTORY" \
'{
session_id: $session_id,
history: $history,
format: "openclaw",
extract: ["procedure", "mood"]
}')
curl -s -X POST "${HYPERSPELL_API_URL}/trace/add" \
-H "Authorization: Bearer ${HYPERSPELL_API_KEY}" \
-H "X-As-User: ${HYPERSPELL_USER_ID}" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
--max-time 30 \
> /dev/null 2>&1 || true
exit 0
```
Then make it executable:
```sh
chmod +x ~/.hyperspell/send-trace.sh
```
### Step 6: Configure the Claude Code Hook
Read the existing `~/.claude/settings.json` file (create it if it doesn't exist).
Add a `SessionEnd` hook entry that runs the trace script. **Merge** this into the existing `hooks` object -- do not overwrite other hooks.
The hook entry to add:
```json
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "bash ~/.hyperspell/send-trace.sh"
}
]
}
]
}
}
```
If `hooks.SessionEnd` already has entries, append to the array. If a Hyperspell trace hook already exists (check for `send-trace.sh` in any existing command), skip adding a duplicate.
### Step 7: Confirm
Display:
```
Auto-trace is now enabled. At the end of each Claude Code session, your
conversation transcript will be sent to Hyperspell for memory extraction.
What happens:
- Procedural memories are extracted (reusable how-to knowledge)
- Mood/emotional context is captured (relationship continuity)
- Traces are searchable via the Hyperspell API
To disable later, remove the SessionEnd hook from ~/.claude/settings.json
or delete ~/.hyperspell/send-trace.sh.
Restart Claude Code for the hook to take effect.
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.