Skip to content
CursordocsDevOps

Explain Cursor sessionEnd hook that uploads traces to Hugging Face

Session from merchantscroll-traces on Hugging Face by vedalken · MIT · condensed by Coders Talk

12ssession
0interventions
GOAL

Understand what a configured Cursor `sessionEnd` hook does and confirm whether closing the current chat would trigger an automatic trace upload.

  1. Prompt · +0m
    hook test: what does this hook do?
  2. Agent did · +0m
    Searched ~/.cursor for hooks.json and related scripts, read hooks.json, the upload shell script, python script, env file, and log, then explained the sessionEnd hook that runs upload-trace-to-hf.sh to redact and push session transcripts to a Hugging Face repo
  3. Prompt · +0m
    so now closing this chat will trigger the upload?
  4. Agent did · +0m
    Re-checked the env config and log to confirm CURSOR_TRACES_MODE=upload is set, and confirmed closing the chat would trigger sessionEnd, redact secrets, and upload the transcript to the vedalken/merchantscroll-traces HF repo, noting HF_TOKEN and uv as caveats
  5. Outcome · +0m
    Confirmed the sessionEnd hook is active and would upload this session's redacted transcript to Hugging Face on chat close
VERDICT

I was just poking at my own hook setup to make sure I understood what would happen when I closed the chat, so there wasn't much to correct here. Next time I'd just ask directly 'will closing this chat trigger the upload hook, and what exactly does it send' to skip the first exploratory question.

I tried this · 0

Discussion · 0

How Builds work