How ludalunizz/the-researcher works
The Researcher is a local research loader for Claude Code and opencode. Its main workflow discovers documents, expands configured or custom sets, presents a selective chooser, converts selected material to cached plain text, and loads only the checked items. Separate capabilities cover prior-chat context, source-code profiles, saved UI choices, and anonymous opt-in usage reporting. The excerpts establish the CLI’s library setup and worker validation path; some runtime wiring is supported only by README descriptions, so uncertain internal calls are omitted.
Main entry points: main.rs CLI Orchestrator · popup.rs Selection Popup · sessions.rs Chat Sessions · index.js Usage Receiver
Components 16
CLI and Selection
- CLI Orchestrator
src/main.rs - Selection Popup
src/popup.rs - Saved Choices
src/state.rs - Time Grouping
src/bands.rs
Research Library
- Library Scanner
src/library.rs - Text Cache
src/text.rs - Research Files
Context and Profiles
- Chat Sessions
src/sessions.rs - Code Profiles
src/code.rs
Usage Reporting
- Usage Log and Reports
src/usage.rs - Usage Receiver
worker/src/index.js - Payload Validator
worker/src/validate.js - Usage Database
worker/schema.sql
Other components
- User
- Claude Session
- opencode
Connections 17
- User → CLI Orchestrator: starts load
README.md - CLI Orchestrator → Library Scanner: scans library
src/main.rs - CLI Orchestrator → Selection Popup: opens chooser
README.md - Selection Popup → Saved Choices: saves choices
- Selection Popup → Time Grouping: groups chats
src/popup.rs - Library Scanner → Research Files: reads files
src/library.rs - CLI Orchestrator → Text Cache: prepares text
README.md - Text Cache → Research Files: converts selected
README.md - CLI Orchestrator → Claude Session: loads selection
README.md - CLI Orchestrator → Chat Sessions: loads context
src/main.rs - Chat Sessions → Claude Session: reads chat history
README.md - Chat Sessions → opencode: exports sessions
src/sessions.rs - CLI Orchestrator → Code Profiles: scans profiles
src/main.rs - CLI Orchestrator → Usage Log and Reports: records loads
README.md - Usage Log and Reports → Usage Receiver: sends opt-in records
README.md - Usage Receiver → Payload Validator: validates payload
worker/src/index.js - Usage Receiver → Usage Database: stores records
worker/src/index.js