Automatically find Reddit comments that match your startup's pain point using Claude and multi-armed bandit optimization.
Pain Hunter crawls Reddit to discover people expressing frustrations that your product solves. It uses Claude to intelligently filter comments, a Softmax bandit to focus on the highest-yield subreddits over time, and generates suggested responses for each match — giving you a stream of warm leads without manual searching.
- Discovery — Claude generates search terms from your pain point description and discovers hundreds of relevant subreddits via Reddit's API.
- Training — The system surfaces early matches for your review. You confirm or reject the first few, teaching Claude what a real match looks like for your specific use case.
- Production Hunting — Once calibrated, Pain Hunter runs autonomously: a Softmax bandit selects subreddits, Claude scores posts by potential, analyzes comment batches, and auto-saves matches with suggested responses.
- Claude Sonnet 4 for intelligent comment analysis and response generation
- Softmax (Boltzmann) bandit with temperature annealing for subreddit selection
- Hot/cold scoring — when no match is found, Claude rates subreddit potential so the bandit still learns
- Post ranking — Claude pre-scores posts by relevance before fetching comments
- Session resume — stop and restart without losing progress (state persisted to JSONL + JSON)
- Duplicate prevention — tracks analyzed posts and individual comment IDs
- 2x growth re-analysis — revisits posts whose comment count has doubled since last analysis
- Rate limiting — exponential backoff with retries for Reddit's API
- Python 3.10+
- An Anthropic API key
git clone https://github.com/YOUR_USERNAME/pain_hunter.git
cd pain_hunter
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Set your API key — copy the example env file and add your key:
cp .env.example .env
# Edit .env and set your Anthropic API key- Describe your pain point in
pain_point.md. Be specific about the problem your product solves — this is what Claude uses to evaluate every comment. Seepain_point.example.mdfor a template.
source venv/bin/activate
python3 pain_hunter_v2.pyDuring the training phase, you'll be prompted to confirm or reject the first few matches. After 3 confirmed positives, the system switches to fully autonomous mode.
pain_hunter/
├── pain_hunter_v2.py # Main implementation
├── pain_point.md # Your pain point description (not tracked in git)
├── pain_point.example.md # Example pain point for reference
├── .env # Your API key (not tracked in git)
├── .env.example # Example env file
├── requirements.txt # Python dependencies
├── .gitignore
└── outputs/ # Generated per session (not tracked in git)
└── session_YYYYMMDD_HHMMSS/
├── match_001_HHMMSS.txt # Individual match files
├── analyzed_posts.jsonl # Post/comment tracking
├── bandit_stats.json # Subreddit reward history
├── training_examples.json # Confirmed positive/negative examples
└── discovered_subreddits.md # Subreddit list for this session
Pain Hunter uses a Softmax (Boltzmann) exploration strategy to balance trying new subreddits with exploiting known good ones.
Temperature annealing:
- Starts with a high temperature (more random exploration across subreddits)
- As successful matches accumulate, the temperature decreases (shifts toward exploiting top performers)
- Minimum temperature of 0.1 prevents total convergence
Reward signals:
| Outcome | Reward | Effect |
|---|---|---|
| Confirmed match | +10.0 | Strong signal to revisit this subreddit |
| Hot/cold score (no match) | -0.5 to +0.5 | Claude estimates subreddit potential (0-100) |
| No posts available | 0 | Neutral |
| No feedback | -0.001 | Slight negative to avoid stalling |
This means the bandit learns even from misses — a subreddit with no matches but a hot/cold score of 80 still gets a positive signal.
The PainHunterV2 constructor accepts several parameters:
# Default: new session, 1000 pulls, 100 max matches, training enabled
hunter = PainHunterV2(api_key)
# Longer run with higher limits
hunter = PainHunterV2(api_key, max_pulls=5000, max_total_matches=500)
# Resume a previous session
hunter = PainHunterV2(api_key, resume_from_dir="outputs/session_20250829_152635")
# Skip the interactive training phase
hunter = PainHunterV2(api_key, skip_training=True)Reddit: Uses Reddit's public JSON API (old.reddit.com/*.json) — no authentication required. Rate limited at ~100 requests/minute with built-in exponential backoff.
Anthropic: Claude is called for:
- Search term generation (1 call)
- Post ranking per subreddit (1 call per subreddit fetch)
- Comment batch analysis (1 call per batch of up to 200 comments)
- Response generation (1 call per match)
- No automated posting — generates suggested responses for human review only
- Respectful rate limiting — exponential backoff built into all Reddit API calls
- Follow Reddit's ToS — this tool is for research and lead discovery, not spam
- Privacy — your pain point description and API key stay local; only Reddit public data is read
MIT