From bf5d493aa83ca1a35cdc634ce1f93ff3fd0a1494 Mon Sep 17 00:00:00 2001 From: isTuhin <109235568+isTuhin@users.noreply.github.com> Date: Sat, 14 Nov 2026 05:08:32 +0600 Subject: [PATCH] docs(pstack): correct Claude Code transcript slug and listing Document that transcript slugs replace every non-alphanumeric character, and use find instead of multi-glob ls so zsh unmatched globs do not abort reflect step 1. Fixes #1155 Co-authored-by: Cursor --- harness/pstack/claude-code/docs/harness/claude-code.md | 2 +- harness/pstack/claude-code/skills/reflect/SKILL.md | 3 ++- pstack/docs/harness/claude-code.md | 2 +- pstack/skills/reflect/SKILL.md | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/harness/pstack/claude-code/docs/harness/claude-code.md b/harness/pstack/claude-code/docs/harness/claude-code.md index bf154e6464..b74011c925 100644 --- a/harness/pstack/claude-code/docs/harness/claude-code.md +++ b/harness/pstack/claude-code/docs/harness/claude-code.md @@ -53,7 +53,7 @@ Claude Code loads every `.md` file in `~/.claude/rules/` into each new session, | `~/.cursor/plugins/`, `.cursor-plugin/plugin.json` | `~/.claude/plugins/`, `.claude-plugin/plugin.json` | | `.cursor/rules/*.mdc`, always-applied rules | `CLAUDE.md`, or `AGENTS.md` when no `CLAUDE.md` exists. Claude Code never reads `.mdc` files. The model rule is the exception. See Models. | | `https://github.com/cursor/plugins/blob/main/pstack/` | `/` when that file exists. The plugin ships the skills, `docs/guide/`, and `README.md`. Read the local copy and never fetch it. Give the user the URL when they need a link. | -| Transcripts in `~/.cursor/projects//agent-transcripts/` | `~/.claude/projects//.jsonl`. The slug is the workspace path with each `/` and `.` changed to `-`, so `/Users/you/proj` is `-Users-you-proj`. The newest `.jsonl` directly in that folder is the current session. Its `/subagents/` folder holds subagent transcripts. Read only this workspace's folder. | +| Transcripts in `~/.cursor/projects//agent-transcripts/` | `~/.claude/projects//.jsonl`. The slug is the workspace path with each character that is not an ASCII letter or digit changed to `-`, so `/Users/you/proj` is `-Users-you-proj` and a folder ending in non-ASCII characters becomes trailing `-` runs. The newest `.jsonl` directly in that folder is the current session. Its `/subagents/` folder holds subagent transcripts. Read only this workspace's folder. | ## Cursor-only features diff --git a/harness/pstack/claude-code/skills/reflect/SKILL.md b/harness/pstack/claude-code/skills/reflect/SKILL.md index dcb6c91759..78b0e3077c 100644 --- a/harness/pstack/claude-code/skills/reflect/SKILL.md +++ b/harness/pstack/claude-code/skills/reflect/SKILL.md @@ -17,7 +17,8 @@ Invoke when the user says "reflect" or "/reflect". Skip when the conversation is Before fanning out, find this conversation's transcript in the `agent-transcripts/` directory the system prompt names. Do not glob across `~/.cursor/projects/*/`. That crosses workspace boundaries and reads private chats from unrelated projects. ```bash -ls -t /*.jsonl /*/*.jsonl /*/subagents/*.jsonl 2>/dev/null | head -10 +# Prefer find: in zsh, unmatched globs in `ls -t a/*.jsonl b/*.jsonl` abort the whole command. +find -type f -name '*.jsonl' -print0 2>/dev/null | xargs -0 ls -t 2>/dev/null | head -10 ``` That covers the legacy flat (`.jsonl`), current nested (`/.jsonl`), and subagent (`/subagents/.jsonl`) layouts. For each candidate, read the first JSONL line. Take the file whose `message.content[0].text` contains the conversation's opening user prompt. If none matches, pass a tight digest of the session instead. diff --git a/pstack/docs/harness/claude-code.md b/pstack/docs/harness/claude-code.md index bf154e6464..b74011c925 100644 --- a/pstack/docs/harness/claude-code.md +++ b/pstack/docs/harness/claude-code.md @@ -53,7 +53,7 @@ Claude Code loads every `.md` file in `~/.claude/rules/` into each new session, | `~/.cursor/plugins/`, `.cursor-plugin/plugin.json` | `~/.claude/plugins/`, `.claude-plugin/plugin.json` | | `.cursor/rules/*.mdc`, always-applied rules | `CLAUDE.md`, or `AGENTS.md` when no `CLAUDE.md` exists. Claude Code never reads `.mdc` files. The model rule is the exception. See Models. | | `https://github.com/cursor/plugins/blob/main/pstack/` | `/` when that file exists. The plugin ships the skills, `docs/guide/`, and `README.md`. Read the local copy and never fetch it. Give the user the URL when they need a link. | -| Transcripts in `~/.cursor/projects//agent-transcripts/` | `~/.claude/projects//.jsonl`. The slug is the workspace path with each `/` and `.` changed to `-`, so `/Users/you/proj` is `-Users-you-proj`. The newest `.jsonl` directly in that folder is the current session. Its `/subagents/` folder holds subagent transcripts. Read only this workspace's folder. | +| Transcripts in `~/.cursor/projects//agent-transcripts/` | `~/.claude/projects//.jsonl`. The slug is the workspace path with each character that is not an ASCII letter or digit changed to `-`, so `/Users/you/proj` is `-Users-you-proj` and a folder ending in non-ASCII characters becomes trailing `-` runs. The newest `.jsonl` directly in that folder is the current session. Its `/subagents/` folder holds subagent transcripts. Read only this workspace's folder. | ## Cursor-only features diff --git a/pstack/skills/reflect/SKILL.md b/pstack/skills/reflect/SKILL.md index 9bb153bd21..0e74243530 100644 --- a/pstack/skills/reflect/SKILL.md +++ b/pstack/skills/reflect/SKILL.md @@ -15,7 +15,8 @@ Invoke when the user says "reflect" or "/reflect". Skip when the conversation is Before fanning out, find this conversation's transcript in the `agent-transcripts/` directory the system prompt names. Do not glob across `~/.cursor/projects/*/`. That crosses workspace boundaries and reads private chats from unrelated projects. ```bash -ls -t /*.jsonl /*/*.jsonl /*/subagents/*.jsonl 2>/dev/null | head -10 +# Prefer find: in zsh, unmatched globs in `ls -t a/*.jsonl b/*.jsonl` abort the whole command. +find -type f -name '*.jsonl' -print0 2>/dev/null | xargs -0 ls -t 2>/dev/null | head -10 ``` That covers the legacy flat (`.jsonl`), current nested (`/.jsonl`), and subagent (`/subagents/.jsonl`) layouts. For each candidate, read the first JSONL line. Take the file whose `message.content[0].text` contains the conversation's opening user prompt. If none matches, pass a tight digest of the session instead.