claude-session-share
v1.2.2
Published
MCP server for sharing Claude Code sessions via GitHub Gist with privacy protection
Maintainers
Readme
claude-session-share
MCP server for sharing Claude Code sessions via GitHub Gist with automatic privacy protection.
Features
- One-Click Sharing - Export sessions to GitHub Gist through natural language
- Privacy First - Automatically strips thinking blocks, sanitizes paths, and redacts secrets
- Seamless Import - Import shared sessions that work exactly like native Claude Code sessions
- Full Compatibility - Imported sessions appear in
claude --resume
Installation
Prerequisites
- Node.js 18+
- Claude Code CLI
- GitHub Personal Access Token with
gistscope
Setup GitHub Token
- Go to GitHub Settings > Personal Access Tokens
- Click "Generate new token (classic)"
- Check the
gistscope - Generate and copy the token
Configure MCP Server
Option 1: One-liner (recommended)
Run this in terminal, replacing YOUR_TOKEN with your GitHub token:
mkdir -p ~/.claude && cat > ~/.claude/mcp.json << 'EOF'
{
"mcpServers": {
"claude-session-share": {
"command": "npx",
"args": ["-y", "claude-session-share"],
"env": {
"GITHUB_TOKEN": "YOUR_TOKEN"
}
}
}
}
EOFOption 2: Manual edit
Create or edit ~/.claude/mcp.json:
{
"mcpServers": {
"claude-session-share": {
"command": "npx",
"args": ["-y", "claude-session-share"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Note: If the file already exists with other MCP servers, add the
"claude-session-share": {...}block inside the existing"mcpServers"object.
Verify Installation
claude # Start (or restart) Claude Code
# Type: /mcp
# You should see "claude-session-share" in the listImportant: If Claude Code was already running, restart it for the new MCP server to load.
Usage
Share a Session
In any Claude Code conversation:
"Share my current session to GitHub Gist"Claude will:
- Find your current session
- Remove thinking blocks and sanitize paths/secrets
- Upload to a secret GitHub Gist
- Return a shareable link
Import a Session
"Import this session: https://gist.github.com/username/abc123"Resume an Imported Session
claude --resume
# Select the imported session from the listOr directly:
claude --resume <session-id>Privacy Protection
Every shared session is automatically sanitized:
Removed/Sanitized
- Thinking blocks (internal reasoning)
- Absolute paths → relative paths
- API keys, tokens, secrets →
[REDACTED]
Preserved
- Conversation flow and context
- Code examples
- Relative file paths
- Tool use history
MCP Tools
share_session
Exports current session to GitHub Gist.
import_session
Imports session from GitHub Gist URL.
Troubleshooting
"Not authenticated" Error
Ensure GITHUB_TOKEN is set in MCP configuration.
Imported Session Doesn't Appear
Restart Claude Code to refresh the session list.
MCP Server Not Listed
Verify ~/.claude/mcp.json and restart Claude Code.
Development
git clone https://github.com/OmkarKovvali/claude-session-share.git
cd claude-session-share
npm install
npm run build
npm testLicense
MIT © Omkar Kovvali
