Session Detail Skill
Behavior on Invocation
Do not ask the user to paste the conversation. You already have it in context. The only question you may ask is the single ambiguity prompt described in Mode Resolution below.
STRICT OUTPUT RULE: Generate exactly two sections -- <session_full> and <context_updates>. No other sections.
Sensitive Data Protection (Mandatory)
Before generating an archive, review every candidate excerpt for credentials, authentication material, and other secret values. Never reproduce a secret value. This requirement overrides every instruction to preserve content verbatim, in full, exactly, without summarization, or without abbreviation.
Redact all of the following when present:
- Passwords, passphrases, PINs, recovery codes, and backup codes.
- API keys, access tokens, refresh tokens, bearer tokens, session tokens, cookies, and authorization headers.
- OAuth client secrets, webhook secrets, signing secrets, encryption secrets, private keys, and certificate blocks containing private-key material.
- Database credentials and connection strings with embedded usernames, passwords, or tokens.
- Cloud-provider credentials, package-registry tokens, SSH credentials, and secrets copied from
.envor credential files. - Any additional value that the user identifies as secret, private, or sensitive.
Preserve useful surrounding structure, labels, variable names, and safe code, but replace each secret value with a typed placeholder such as OPENAI_API_KEY=[REDACTED: API KEY] or Authorization: Bearer [REDACTED: TOKEN]. Replace an entire private-key or credential block with one placeholder such as [REDACTED: PRIVATE KEY]. Never retain a partial value, prefix, suffix, fingerprint, or URL parameter that could help reconstruct or use the secret. If uncertain whether a value is sensitive, redact it.
Never inspect .env* files, credential stores, authentication files, SSH private keys, cloud credential files, secret-manager exports, or similar sources solely to include their contents in an archive. Reading a prior session archive is allowed only for checkpoint detection and incremental-boundary comparison; sensitive values found there must still be redacted from the new output.
If any redaction occurs, add this bullet under ## Technical Notes:
- Security: Sensitive values were redacted from this archive.
Do not identify the original value or include enough information to reconstruct it.
Output destination depends on the environment:
- Claude.ai and Cowork: if file creation is available, write the archive to a downloadable .md file using the suggested filename and present it to the user; print to chat only if file creation is unavailable or the user explicitly asks for chat output. A 15-20KB archive printed into chat is carried in context on every subsequent turn; a file is not.
- Claude Code: print to chat. The separate Claude Code slash command is the file-writing form for repo
_sessions/archives; this skill does not write into the repo. In every case, include aSuggested filename:line inside the archive so the user can save or rename it.
Step 1: Detect the tool and build the prefix
Determine which tool you are running in and set the filename prefix:
- Claude Code: filesystem and
$CLAUDE_SESSION_IDare available. Prefix iscode. - Claude Cowork: a desktop workspace is present but this skill still does not write files. Prefix is
cowork. - Claude.ai: no persistent filesystem. Prefix is
claude.
If you cannot tell Cowork from Claude.ai, default the prefix to claude.
Step 2: Resolve the mode (full, incremental, or ask)
Explicit override in the trigger phrase wins.
- Force full: "full session detail", "full session-detail", "session-detail full", "session detail full". Produce a FULL archive of the entire session regardless of any prior checkpoint.
- Force incremental: "session detail incremental", "session-detail inc". Produce an INCREMENTAL. If no prior checkpoint can be found, say so in one line and produce a FULL instead (there is nothing to increment from).
No override: auto-detect. Look for the most recent prior checkpoint belonging to THIS session.
- Claude Code: scan both
_sessions/on disk AND the current conversation context for<session_full>blocks. A prior checkpoint qualifies if its markersession=equals the current$CLAUDE_SESSION_ID. Check both sources because this skill prints to chat (not disk), so a checkpoint generated earlier in this same Claude Code session exists only in the conversation context, not in_sessions/. If candidates are found in both locations, use the one with the highestseq. (This skill reads to detect; it still does not write.) - Claude.ai and Cowork: scan the current conversation context for the most recent
<session_full>block that you generated earlier in this same conversation, including the contents of any archive file you created earlier this session (the file's content passes through your tool calls and remains visible in context). - None found -> FULL,
seq=1. - Found and same-session is certain -> INCREMENTAL,
seq = prior seq + 1. - Found but same-session cannot be confirmed (for example
$CLAUDE_SESSION_IDis unavailable and only a same-date file exists, or a checkpoint appears in context that may have been pasted in from a different conversation) -> ASK exactly one line and wait:A prior session-detail checkpoint exists but I cannot confirm it is from this same session. Generate (i)ncremental from it, or (f)ull? [f]:Default to FULL on an empty or unclear reply.
- Claude Code: scan both
Step 3: Honor the incremental boundary
For an INCREMENTAL, the boundary is positional, not temporal: capture only the conversation content that comes AFTER the prior checkpoint's position in this conversation (or, when the prior checkpoint was read from disk, only work not already covered by its content). Conversation messages carry no visible timestamps, so never attempt to apply a wall-clock boundary; the prior block's position and content define what is already captured. The marker's generated field is metadata for humans and file tooling, not the boundary mechanism. Do not repeat anything already captured in the prior checkpoint. Begin the archive body with one line:
Incremental checkpoint, seq <n>, continues from <prior label> generated <time>. Covers only work since that point.
If the prior checkpoint is missing from context (for example it was compacted out on a long conversation), say so in one line, then produce a FULL rather than guessing at a boundary.
Step 4: Derive identifiers
- Timestamp:
YYYY-MM-DD-HH-MMfor now. On Claude Code usedate "+%Y-%m-%d-%H-%M"; elsewhere use the current time. - Session key:
$CLAUDE_SESSION_IDon Claude Code (orunverified-<timestamp>if unavailable); the first user message timestamp on Claude.ai and Cowork. The key goes in the marker and is the ground truth for same-session matching. - sid8: the first 8 alphanumeric characters of the session key (strip dashes and other punctuation first). On Claude Code this is the first 8 characters of the session UUID; on Claude.ai and Cowork it degenerates to the date digits, which is acceptable because there is no disk there to collide on. sid8 is a human-readable hint in the filename; the marker remains the ground truth.
- Session ID label:
<prefix>-<YYYY-MM-DD-HH-MM>-<sid8>for a full, or<prefix>-<YYYY-MM-DD-HH-MM>-<sid8>-INC-<NN>for an incremental. NN equals the markerseqand starts at 02. There is no session counting: no directory scans to number sessions, no Nth-session-today logic, no day-rollover edge. - Suggested filename: the lowercase form with
.md, for examplecode-2026-06-20-09-15-a3f9c12b-inc-02.md. - Project name: infer from the conversation, or use "Untitled Project" if unclear.
- Duration: estimate from first and last message timestamps if available, otherwise omit.
Step 5: Stamp the marker
Place this marker as the very first line inside <session_full>, before the # Session heading:
<!-- session-detail | tool=<prefix> | session=<key> | seq=<n> | generated=<YYYY-MM-DD-HH-MM> -->
where <key> is $CLAUDE_SESSION_ID on Claude Code (or unverified-<timestamp> if unavailable), and the first user message timestamp on Claude.ai or Cowork.
Step 6: Perform the final sensitive-data review
Before delivering the archive as a file or chat output, inspect the complete generated content a second time. Redact any credential, authentication material, private key, secret-bearing connection string, or other sensitive value missed during extraction. Do not deliver the archive until this review is complete. If the review causes any redaction, include the required security bullet under ## Technical Notes.
Output must be pure markdown only, clean and copy-paste ready. No preamble, no meta-commentary above the blocks. Deliver the archive and close with the single line specified in Closing Line.
Output Format
Generate exactly two sections using the exact XML tags below. No other sections. All content inside the tags must be properly formatted Markdown.
Required sections:
<session_full>-- Full Version<context_updates>-- Context Updates
FULL VERSION (~15-20KB)
Accomplished
[Each item with specific details: what was built, fixed, or configured. Be thorough.]
Decisions Made
[For each significant decision:]
- Decision: [What was decided]
- Rationale: [Why]
- Alternatives considered: [What else was evaluated]
- Impact: [How this affects the project]
Issues Encountered
[For each issue:]
- Issue: [Description]
- Root cause: [What caused it]
- Resolution: [How it was fixed, or current status if unresolved]
- Time spent: [Approximate]
- Prevention: [How to avoid in future, if applicable]
Prompts Executed
[For each significant prompt or task in the session:]
- Prompt: [Brief description]
- Outcome: [What was accomplished]
- Key Files: [Files created or changed, if any]
- Commit: [Git commit message or SHA if applicable]
Prompts Generated for Next Session
[For each prompt generated during this session but NOT executed -- these are prompts created for future work, including Claude Code prompts, fix prompts, audit prompts, or any prompt drafted but deferred. CAPTURE THE FULL BODY AFTER MANDATORY SENSITIVE-VALUE REDACTION, not just a name. Without the safe full body, the prompt is unrecoverable next session.]
[Prompt Name or Purpose]
Intent: [What problem this prompt is meant to solve] Suggested filename: [e.g., docs/prompts/fix-checkbox-table-width.md] Target session/phase: [When this should run] Full prompt body:
[Paste the entire prompt body after replacing all sensitive values with typed redaction placeholders. Do not summarize or abbreviate the remaining safe content.]
[Repeat block above for each generated prompt. If no prompts were generated for next session, write "None this session."]
Code Changes
- New files: [List with brief purpose]
- Modified files: [List with what changed]
- Deleted files: [List]
Technical Notes
[Implementation details, patterns, configurations, or technical context worth preserving. If any redaction occurred, include the required security bullet.]
Next Session
- [Priority task 1]
- [Priority task 2]
- [Priority task 3]
CONTEXT UPDATES
New Persistent Facts
[Any new project facts, configurations, or constraints established this session that must carry forward. List each as a bullet with enough context to be self-explanatory without the conversation.]
Changed or Corrected Facts
[Any previously held assumptions or facts that were corrected or superseded this session. Format: "OLD: [what was believed] -> NEW: [what is now true]".]
Decisions Locked
[Decisions made this session that are final and should not be relitigated. Include the rationale in one sentence so future sessions understand the why.]
Open Questions
[Unresolved questions or ambiguities that surfaced this session and need answers before or during the next session.]
Carry-Forward Warnings
[Any known risks, blockers, or gotchas that the next session should be aware of before starting.]
Closing Line
After both sections, output exactly this line (substituting the session ID):
Output ready. Session [SESSION-ID] archived.
Guardrails
- Sensitive Data Protection is mandatory and takes precedence over every completeness, exact-copy, full-body, and verbatim-preservation instruction in this skill.
- Never place credentials, authentication material, private keys, secret-bearing connection strings, or other secret values in the archive. Replace them with typed redaction placeholders.
- Never read a credential-bearing file solely to archive it. Only read files required for checkpoint detection or incremental comparison, and redact sensitive values from any new output.
- Perform a second sensitive-data review of the complete generated archive before delivering it.
- If any redaction occurs, include
- Security: Sensitive values were redacted from this archive.under## Technical Notes. - Do not leave any placeholder unfilled. If the conversation does not contain enough information to populate a field, omit the field or write "N/A" -- never output raw bracket placeholders like
[What was decided]. - This skill never writes into the repo. On Claude.ai and Cowork it produces a downloadable file (chat is the fallback); on Claude Code it prints to chat. Only the separate Claude Code slash command writes files to
_sessions/. - Incrementals capture only post-checkpoint work, bounded positionally. The boundary is the prior checkpoint's position and content in the conversation, never a wall-clock time. Never repeat content already captured in the prior checkpoint. If the prior checkpoint is not visible in context, produce a full and say so in one line rather than guessing the boundary.
- Ask at most one question, and only on genuine ambiguity (a prior checkpoint exists but cannot be confirmed as this session). Default to full on an unclear reply. Never ask the user to paste the conversation.
- Generated prompts must be captured in full after mandatory redaction. Preserve the complete safe prompt body, including code blocks and constraints, while replacing every sensitive value. Never capture only the name or a summary when safe content is available.
- Preserve exact wording for non-sensitive code, copy, and specific formulations produced during the session. Redact sensitive values before applying this requirement.
- Do not include pleasantries, meta-discussion, or conversational overhead. Only substance.
- Do not add any text above or below the two output sections except the single closing line.