Save and manage Claude Code sessions as GitHub Gists.
Threads is a Claude Code plugin that lets you persist your coding sessions to GitHub Gists, enabling you to save, list, and restore session context across different Claude Code sessions.
/plugin marketplace add mpuig/threads
/plugin install threads
git clone https://github.com/mpuig/threads
cd threads
uv sync
uv run th --help
Save your current Claude Code session as a GitHub Gist:
th save --name "feature-auth" --description "JWT authentication implementation"
Options:
--name, -n - Thread name (auto-generated if not provided)--description, -d - Description for the gist--public - Make the gist public (default: secret)View all your saved thread sessions:
th list
Options:
--limit, -l - Maximum number of threads to show (default: 10)--filter, -f - Filter threads by keyword--json - Output as JSONRestore a previous session's context:
th open <gist-id>
th open https://gist.github.com/user/abc123def
The th prime command is automatically run on session start to show available commands and recent threads:
th prime
~/.claude/projects/<project>/ as JSONL files[Claude Thread] prefixgh) authenticated, or GITHUB_TOKEN environment variableThreads uses the GitHub API to manage gists. You can authenticate using either:
GitHub CLI (recommended):
gh auth login
Environment variable:
export GITHUB_TOKEN=your_token_here
The plugin automatically configures a SessionStart hook to run th prime when starting a new Claude Code session.
.claude-plugin/plugin.json){
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "th prime"
}
]
}
]
}
}
Threads stores local configuration in .threads/ directory:
config.json - Local configurationthreads.json - Index of saved threads for the projectThe gh CLI is not authenticated or GITHUB_TOKEN is not set.
# Option 1: Authenticate via gh CLI (recommended)
gh auth login
# Option 2: Set environment variable
export GITHUB_TOKEN=your_personal_access_token
To create a personal access token, visit GitHub Settings > Tokens and create a token with gist scope.
This error occurs when Threads cannot find a Claude Code session for the current directory.
Causes:
~/.claude/projects/, and no matching project existsSolution:
Run th save from within a project directory where you have an active Claude Code session.
th listYou haven't saved any threads yet, or your gists don't have the [Claude Thread] prefix.
Solution:
Save your first thread with th save --name "my-first-thread".
th openEnsure you're using a valid gist ID. You can use either:
th open abc123defth open https://gist.github.com/username/abc123def# Clone and install
git clone https://github.com/mpuig/threads
cd threads
uv sync
# Run tests
uv run pytest
# Run CLI
uv run th --help
See CONTRIBUTING.md for development guidelines.
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub mpuig/threads --plugin threadsAgent skill for generating professional PowerPoint decks. 7 composable skills (extract, build, edit, audit, critique, polish, full) powered by a purpose-built CLI and Python API.
Python-focused agent skills for code review, commits, and more
Browse, search, and carry context across Claude Code sessions. Exposes /threadhop:handoff, /threadhop:observe, /threadhop:tag.
Persistent local memory for Claude Code. Every tool call, every file edit, every thinking block from every session — stored verbatim on your machine. Semantic recall in ~126ms with zero API calls.
Developer experience essentials: GitHub Actions debugging, conversation cloning/half-cloning, context handoffs, and Reddit research
Persistent memory system for AI coding sessions — cross-tool memory sharing with 6-dimensional hybrid search
Sync Claude Code sessions across devices with encrypted cloud storage
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques