Local marketplace for Agent Threads plugin development
npx claudepluginhub mpuig/threadsSave and manage Claude Code sessions as GitHub Gists
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