Create a public share link for the current Claude Code session. Use when user says "share session", "share this session", "get share link", "create share link", or "share my work".
Purpose: Create a public share link for the current Claude Code session so users can share their conversation with friends.
This skill uses a single MCP tool call to share the current session.
The current session ID is available directly in the system prompt — the vibe-check UserPromptSubmit hook injects it on every turn:
[vibe-check] Session: <session-id> | Repo: ...
If the MCP tools are not available (fallback only), it can use the legacy marker technique.
Read the session ID from the hook output in the system prompt, then call mcp__vibe-check__vibe_share with it directly:
Use mcp__vibe-check__vibe_share with:
- session_id: [session ID from the hook output above]
- title: (optional) Custom title for the share
- slug: (optional) Custom URL slug
If the hook output is not present, omit session_id and the tool will fall back to the most recent session in the database.
The tool will:
Present the returned share URL to the user.
IMPORTANT: Only use this if the MCP tools are unavailable or fail. This is a last resort.
Generate a unique marker string:
VIBE_SESSION_MARKER_[random 16 character hex string]
IMPORTANT: Output this marker directly in your response:
Creating share link for this session...
Session marker: VIBE_SESSION_MARKER_[your-generated-marker]
Wait 2 seconds for vibe-check to log the marker:
sleep 2
Query the local SQLite database to find the session ID:
sqlite3 "file:$HOME/.vibe-check/vibe_check.db?mode=ro" \
"SELECT event_session_id FROM conversation_events WHERE event_data LIKE '%VIBE_SESSION_MARKER_[your-marker]%' ORDER BY event_timestamp DESC LIMIT 1;"
Replace [your-marker] with the actual marker you generated.
Save the result as SESSION_ID.
Read the API key and URL from the vibe-check config:
# Get API key
cat ~/.vibe-check/config.json | jq -r '.api.api_key'
# Get API URL (defaults to https://vibecheck.wanderingstan.com)
cat ~/.vibe-check/config.json | jq -r '.api.url // "https://vibecheck.wanderingstan.com"'
Make the API call to create a public session share:
curl -s -X POST "${API_URL}/api/shares" \
-H "X-API-Key: ${API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"scope_type\": \"session\",
\"scope_session_id\": \"${SESSION_ID}\",
\"visibility\": \"public\"
}"
The response will include:
{
"status": "ok",
"share_id": 123,
"share_token": "7Kx9mPqR2vL...",
"share_url": "https://vibecheck.wanderingstan.com/s/7Kx9mPqR2vL...",
"slug": null
}
Present the share URL prominently to the user:
Session Share Created!
Share URL: https://vibecheck.wanderingstan.com/s/[token]
Anyone with this link can view your conversation from this session.
This means the session ID doesn't have any events owned by this user. Possible causes:
Fix: Run vibe-check status to check if remote sync is working. The MCP tool automatically retries for a few seconds to handle sync delays.
No API key found in config, or remote sync is disabled.
Fix: Run vibe-check auth login to authenticate and enable remote sync.
If the MCP server isn't running or configured, fall back to the legacy marker technique above.
When using the MCP tool, you can customize the share:
Use mcp__vibe-check__vibe_share with:
- session_id: [session ID]
- title: "My awesome coding session"
- slug: "my-cool-session"
With a custom slug, the URL becomes: https://vibecheck.wanderingstan.com/s/my-cool-session