A TypeScript-based tool for analyzing Reddit discussions comparing AI coding tools, with a focus on Claude Code vs Codex. Uses AI-powered sentiment analysis to identify trends, themes, and developer opinions.
- Reddit Discovery: Automatically finds relevant discussions across multiple subreddits
- Smart Filtering: Client-side filtering for comprehensive coverage without API limitations
- AI-Powered Analysis: Uses Claude API to analyze sentiment, extract themes, and identify quote-worthy comments
- Interactive Dashboard: Next.js-based dashboard with real-time filtering by subreddit, theme, and comparison type
- Local-Only Architecture: No database required - all data stored in JSONL files
- Admin Mode: Localhost-only controls for curating and cleaning data
1. Discovery (src/discover-reddit.ts)
→ Fetch posts from coding subreddits
→ Filter for comparative discussions
→ Save to discovered_urls.jsonl
2. Scraping (src/scrape.ts)
→ Read discovered URLs
→ Fetch full posts + comments
→ Save to reddit_data.jsonl
3. Analysis (src/analyze.ts)
→ Read reddit data
→ AI sentiment analysis via Claude
→ Save to sentiment_analysis.jsonl
4. Dashboard (dashboard/)
→ Next.js web app
→ Interactive filtering and visualization
→ Admin controls for data curation
- Language: TypeScript
- Reddit API: Snoowrap
- AI Analysis: Anthropic Claude API
- Dashboard: Next.js + React
- Data Format: JSONL (JSON Lines)
- Node.js 18+ and npm
- Reddit API credentials (client ID, client secret, username, password)
- Anthropic API key
- Clone the repository:
git clone https://github.com/yourusername/loisandclark.git
cd loisandclark- Install dependencies:
npm install
cd dashboard && npm install && cd ..- Configure environment variables:
cp .env.example .envEdit .env and add your credentials:
# Reddit API
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_username
REDDIT_PASSWORD=your_password
REDDIT_USER_AGENT=lois-content-research/1.0.0
# Anthropic API
ANTHROPIC_API_KEY=your_api_key
ANALYSIS_MODEL=claude-3-5-haiku-20241022Find posts mentioning both "Claude Code" and "Codex":
npm run discoverThis creates discovered_urls.jsonl with matching Reddit threads.
Fetch full posts and all comments:
npm run scrapeThis creates reddit_data.jsonl with complete thread data.
Analyze comments with AI:
npm run analyzeThis creates sentiment_analysis.jsonl with:
- Sentiment classification (positive/negative/neutral)
- Comparison category (which tool is preferred)
- Themes discussed (performance, bugs, UI, etc.)
- Quote-worthy excerpts
- Upvote counts
The analysis runs in batches (default: 500 comments per run) and can be re-run to process more comments incrementally.
View results in the interactive dashboard:
npm run dashboardOpen http://localhost:3000 to explore:
- Overall sentiment breakdown
- Filter by subreddit, theme, or comparison type
- Sort by upvotes or recency
- Toggle upvote weighting
- Admin mode (localhost only) for curating data
The analysis classifies each comment into one of 9 categories:
- 🏆 claude_code_better: Direct comparison favoring Claude Code
- 🏆 codex_better: Direct comparison favoring Codex
- ⚖️ equal: Both tools rated equally
- 👍 claude_code_only_positive: Only discusses Claude Code (positive)
- 👎 claude_code_only_negative: Only discusses Claude Code (negative)
- 👍 codex_only_positive: Only discusses Codex (positive)
- 👎 codex_only_negative: Only discusses Codex (negative)
- ❌ neither: Neither tool discussed favorably
⚠️ off_topic: Not comparing the tools
All data is stored in append-only JSONL format:
discovered_urls.jsonl: Reddit URLs to scrapereddit_data.jsonl: Full posts with commentsreddit_data_clean.jsonl: Filtered version (optional)sentiment_analysis.jsonl: AI analysis resultslogs/runs.jsonl: Analysis run metadata
See CLAUDE.md for detailed schema documentation.
Change the AI model in .env:
ANALYSIS_MODEL=claude-3-5-haiku-20241022
# or
ANALYSIS_MODEL=claude-3-5-sonnet-20241022Adjust batch size in src/analyze.ts:
const BATCH_SIZE = 500; // Comments per runEdit subreddit list in src/discover-reddit.ts:
const SUBREDDITS = [
'ClaudeCode',
'codex',
'ChatGPTCoding'
];- Reddit API: Free (60 requests/min)
- Analysis: ~$0.005 per comment with Haiku
- 500 comments = ~$2.50
- 1000 comments = ~$5.00
See CLAUDE.md for detailed architectural decisions and development notes.
See NOTES.md for project planning and personal notes.
Contributions welcome! Areas for improvement:
- Additional AI tool comparisons (Cursor, Windsurf, etc.)
- Multi-platform support (Hacker News, Twitter, etc.)
- Advanced visualizations
- Time-series sentiment tracking
- Export functionality (CSV, PDF)
MIT License - see LICENSE file for details.
Built with:
- Anthropic Claude API
- Snoowrap - Reddit API wrapper
- Next.js - Dashboard framework