How elviisaeva/petty-thief works
Petty Thief captures links from Telegram (or directly from a user), makes them available to Claude Code, and turns them into analyses or collection cards stored in the user’s local loot folder. The Cloudflare Worker handles bot setup, ownership, link intake, and the API; the plugin’s Markdown skill guides analysis and local organization. Worker relationships are supported by excerpts and the SOURCE INDEX. Plugin internals were not sampled, so those connections reflect README-documented behavior rather than inspected calls.
Main entry points: telegram.ts Bot commands and intake · setup.ts Bot setup · db.ts Stash data access · SKILL.md Petty Thief skill
Components 21
Setup and intake
- Bot setup
worker/src/setup.ts
Cloudflare worker
- Request router
worker/src/index.ts - Webhook handler
worker/src/webhook.ts - Bot commands and intake
worker/src/telegram.ts - Link and tag parsing
worker/src/urls.ts - Stash API
worker/src/api.ts - Stash data access
worker/src/db.ts - Database schema
worker/src/schema.ts - Tokens and secrets
worker/src/auth.ts - Telegram client
worker/src/telegram-client.ts - Bot branding
worker/src/branding.ts
Claude skill
- Petty Thief skill
plugin/skills/petty-thief/SKILL.md - Stash gathering
plugin/skills/petty-thief/scripts/gather.sh
Analysis and collections
- Analysis lenses
plugin/skills/petty-thief/lenses - Collection handling
plugin/skills/petty-thief/reference/collections.md
Local loot
- Loot files
- Stash commands
plugin/skills/petty-thief/scripts/stash.sh
Other components
- Phone user
- Telegram
- Claude Code
- Cloudflare D1
Connections 33
- Phone user → Telegram: forwards links
README.md - Telegram → Request router: sends updates
README.md - Request router → Webhook handler: routes webhook
worker/src/index.ts - Request router → Bot setup: routes setup
worker/src/index.ts - Request router → Stash API: routes API
worker/src/index.ts - Bot setup → Telegram client: registers webhook
worker/src/setup.ts - Telegram client → Telegram: calls Telegram API
worker/src/telegram-client.ts - Webhook handler → Bot commands and intake: dispatches update
worker/src/webhook.ts - Bot commands and intake → Link and tag parsing: extracts links
worker/src/telegram.ts - Bot commands and intake → Stash data access: stores and queries
worker/src/telegram.ts - Stash API → Stash data access: reads and updates
worker/src/api.ts - Webhook handler → Stash data access: checks secret
worker/src/webhook.ts - Bot setup → Stash data access: stores setup state
worker/src/setup.ts - Bot setup → Tokens and secrets: creates secrets
worker/src/setup.ts - Bot commands and intake → Tokens and secrets: issues tokens
worker/src/telegram.ts - Bot setup → Bot branding: applies branding
worker/src/setup.ts - Bot commands and intake → Bot branding: applies branding
worker/src/telegram.ts - Bot setup → Database schema: ensures schema
worker/src/setup.ts - Webhook handler → Database schema: ensures schema
worker/src/webhook.ts - Stash API → Database schema: ensures schema
worker/src/api.ts - Stash data access → Tokens and secrets: generates IDs
worker/src/db.ts - Cloudflare D1 → Stash data access: persists stash
- Bot commands and intake → Telegram: replies to owner
- Bot commands and intake → Stash API: exposes stash
- Claude Code → Petty Thief skill: runs skill
README.md - Petty Thief skill → Stash gathering: gathers waiting links
- Stash gathering → Stash API: fetches stash
- Petty Thief skill → Analysis lenses: analyzes with
README.md - Petty Thief skill → Collection handling: files collections
README.md - Petty Thief skill → Stash commands: manages stash
- Analysis lenses → Loot files: writes analysis
README.md - Collection handling → Loot files: writes cards
README.md - Stash commands → Loot files: updates files