MCP server for sharing Claude Code sessions via GitHub Gist with privacy protection
npm install claude-session-shareMCP server for sharing Claude Code sessions via GitHub Gist with automatic privacy protection.


- 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
- Node.js 18+
- Claude Code CLI
- GitHub Personal Access Token with gist scope
1. Go to GitHub Settings > Personal Access Tokens
2. Click "Generate new token (classic)"
3. Check the gist scope
4. Generate and copy the token
Option 1: One-liner (recommended)
Run this in terminal, replacing YOUR_TOKEN with your GitHub token:
``bash`
mkdir -p ~/.claude && cat > ~/.claude/mcp.json << 'EOF'
{
"mcpServers": {
"claude-session-share": {
"command": "npx",
"args": ["-y", "claude-session-share"],
"env": {
"GITHUB_TOKEN": "YOUR_TOKEN"
}
}
}
}
EOF
Option 2: Manual edit
Create or edit ~/.claude/mcp.json:
`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.
`bash`
claude # Start (or restart) Claude CodeType: /mcp
You should see "claude-session-share" in the list
> Important: If Claude Code was already running, restart it for the new MCP server to load.
In any Claude Code conversation:
``
"Share my current session to GitHub Gist"
Claude will:
1. Find your current session
2. Remove thinking blocks and sanitize paths/secrets
3. Upload to a secret GitHub Gist
4. Return a shareable link
``
"Import this session: https://gist.github.com/username/abc123"
`bash`
claude --resumeSelect the imported session from the list
Or directly:
`bash`
claude --resume
Every shared session is automatically sanitized:
$3
- Conversation flow and context
- Code examples
- Relative file paths
- Tool use historyMCP Tools
$3
Exports current session to GitHub Gist.$3
Imports session from GitHub Gist URL.Troubleshooting
$3
Ensure GITHUB_TOKEN is set in MCP configuration.$3
Restart Claude Code to refresh the session list.$3
Verify ~/.claude/mcp.json and restart Claude Code.Development
`bash
git clone https://github.com/OmkarKovvali/claude-session-share.git
cd claude-session-share
npm install
npm run build
npm test
``MIT © Omkar Kovvali