ctb 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,549 @@
1
+ # Claude Code as a Personal Assistant
2
+
3
+ Some context: I'm [Fabrizio](https://fabrizio.so), [@linuz90 on X](https://x.com/linuz90), co-founder and designer of [Typefully](https://typefully.com).
4
+
5
+ At Typefully, we fully embraced AI coding early on, and we use Claude Code (and Codex) extensively. But I also like to optimize and automate parts of my personal life.
6
+
7
+ Especially since the introduction of the Sonnet/Opus 4.5 models, [Claude Code](https://claude.com/product/claude-code) has become my AI coding assistant of choice.
8
+
9
+ I quickly realized that these models are actually very capable **general-purpose agents** when given the right instructions, context, and tools.
10
+
11
+ After seeing my co-founder [Francesco](https://x.com/frankdilo) use Claude Code to handle tasks and emails, I started **using it as a personal assistant, especially through Telegram** (which is what this project is about).
12
+
13
+ After some iteration, I landed on this system/setup:
14
+
15
+ 1. **I've created a `fab-dev` folder** with a `CLAUDE.md` that teaches Claude about me, my preferences, where my notes live, my workflows.
16
+ 2. _OPTIONAL_: I've asked Claude to **[symlink](https://en.wikipedia.org/wiki/Symbolic_link) configuration files** into this new central folder, so I can edit them easily and improve my dev setup. For example, I symlinked `~/.claude/commands` and `~/.claude/skills` here, so I can ask Claude to add new commands or skills which will be available everywhere. I also symlinked `~/.zshrc` into this folder for shell configuration.
17
+ 3. _OPTIONAL_: **I've tracked the folder as a Git repository** so I can also easily version control it, or share it on multiple Macs in the future if I need it.
18
+ 4. **I set this "fab-dev" folder as the working directory** for this bot (via `CLAUDE_WORKING_DIR`).
19
+
20
+ **To keep CLAUDE.md lean**, I reference my personal notes system there rather than embedding everything directly.
21
+
22
+ The main "Notes" folder referenced in `CLAUDE.md` is an iCloud folder that I added to [Ulysses](https://ulysses.app/) and [iA Writer](https://ia.net/writer), so I can see changes made by my assistant live, wherever I am. iCloud is insanely good at this, pushing updates live to all devices in the background.
23
+
24
+ Also, I've extended its capabilities by installing [MCPs](https://code.claude.com/docs/en/mcp), adding [commands](https://code.claude.com/docs/en/slash-commands), and [skills](https://code.claude.com/docs/en/skills). Skills are particularly powerful — they're auto-triggered based on context and define specific workflows for common tasks like creating todos, researching topics, or planning workouts.
25
+
26
+ **The magical part: when I need a new capability, I just ask Claude to build it.** Even via the Telegram bot, on the go.
27
+
28
+ For example, I wanted my assistant to summarize videos, so I asked it to create scripts for fetching YouTube subtitles (with fallback to downloading and transcribing locally). Now I can request video summaries from anywhere via Telegram.
29
+
30
+ ![Video summary example](../assets/demo-video-summary.gif)
31
+
32
+ So wether I launch a Claude Code session (usually with the `--dangerously-skip-permissions` flag) on my Mac or chat with the Telegram bot, **Claude is now my 24/7 executive assistant**.
33
+
34
+ ## CLAUDE.md is the Assistant's Brain
35
+
36
+ The `CLAUDE.md` file in my personal assistant `fab-dev` folder is the centerpiece of the setup.
37
+
38
+ Since Claude runs by default with prompt permissions bypassed (more on this in [SECURITY.md](../SECURITY.md)), it can browse other folders, read and write files, and execute commands quite freely within the allowed paths (more on scripts and commands below).
39
+
40
+ Here's a template based on my own setup:
41
+
42
+ ````
43
+ # CLAUDE.md
44
+
45
+ This file provides guidance to Claude Code so it can act as [Your Name]'s personal assistant.
46
+
47
+ ## Quick Reference
48
+
49
+ **This folder:**
50
+ - `cli/` - Utility scripts (run with `bun run cli/...`)
51
+ - `.claude/skills/` - Task workflows (things-todo, gmail, research, workout-planning, etc.)
52
+ - `.claude/agents/` - Subagents for pulse and digests
53
+
54
+ **Key paths:**
55
+ - Notes: `~/Documents/Notes/` (Me/, Research/, Health/, Journal/, [Hobby]/)
56
+ - Personal docs: `~/Documents/Personal/`
57
+
58
+ ## About [Your Name]
59
+
60
+ [Your Name] is a [age]yo [profession] based in [City].
61
+
62
+ [Brief context about work, lifestyle, hobbies, etc.]
63
+
64
+ For personal context, goals, and finances — see the Me/ files below.
65
+
66
+ **Keeping context fresh**: When new personal information emerges, proactively update the relevant Me/ notes.
67
+
68
+ ## How to Assist
69
+
70
+ - **Choose the right source(s)**: Autonomously decide where to look. Search multiple sources in parallel when needed (web, notes, reddit, etc.)
71
+ - **Always check the date**: For time-sensitive questions, run `date` first
72
+ - **Communication style**: [e.g., "Balanced and friendly, use emojis sparingly"]
73
+ - **Autonomy**: Handle routine tasks independently, ask before significant actions
74
+ - **Formatting**: Prefer bullet lists over markdown tables
75
+ - **Priority**: Highlight important items; don't just dump lists
76
+
77
+ **CRITICAL**: When asked to remember something, update the relevant file:
78
+ - Personal goal → `life-goals.md`
79
+ - Personal context → `personal-context.md`
80
+ - Claude behavior → `CLAUDE.md`
81
+
82
+ # KNOWLEDGE & FILES
83
+
84
+ Notes are stored in `~/Documents/Notes/` (synced to iCloud). Use `qmd` for semantic search:
85
+
86
+ qmd search "keywords" # Fast keyword matching
87
+ qmd query "question" # LLM reranking (best quality)
88
+
89
+ ## Personal Context (Me/)
90
+
91
+ Source-of-truth files:
92
+ - `personal-context.md` — Family, friends, preferences, habits
93
+ - `life-goals.md` — Long-term objectives
94
+ - `pulse.md` — Current life digest
95
+ - `finances.md` — Financial overview
96
+
97
+ ## Other Folders
98
+
99
+ - `Journal/` — Monthly entries by year
100
+ - `Health/` — Diet, workouts, training plan
101
+ - `Research/` — Research notes
102
+ - `[Hobby]/` — Hobby-specific notes
103
+
104
+ ## Quick Lookup
105
+
106
+ - Life/priorities → `Me/pulse.md` + recent Journal
107
+ - Goals → `Me/life-goals.md`
108
+ - Workouts → `Health/` or `bun run cli/utils/health.ts workouts week`
109
+
110
+ # TASK MANAGEMENT
111
+
112
+ ## Tasks
113
+
114
+ Use the `things-todo` skill for task creation, scheduling, and project routing.
115
+
116
+ **When asked "what's on my plate"**: Check both tasks AND calendar.
117
+
118
+ ## Calendar
119
+
120
+ bun run cli/google/calendar.ts today|tomorrow|week|range <from> <to>
121
+
122
+ ## Email
123
+
124
+ Use the `gmail` skill for email and email-to-task workflows.
125
+
126
+ ## Work Integrations (optional)
127
+
128
+ bun run cli/integrations/slack.ts channels|messages|recent
129
+ bun run cli/integrations/notion.ts search|page|databases
130
+
131
+ ````
132
+
133
+ The _"keeping context fresh"_ instruction creates a sort of **file-based memory system**, since Claude automatically reads and updates context files (notes) as it learns new things about me.
134
+
135
+ I also occasionally ask Claude to check my Notes folder, Things projects, etc., and update the `CLAUDE.md` file with the latest information, so it's fine to hardcode some information there since it's quite easy to let it update itself.
136
+
137
+ ## Example: Claude as a Personal Trainer / Health Coach
138
+
139
+ One of my favorite uses of this setup is having Claude act as a personal trainer that knows my diet, my training plan, and my recent activity.
140
+
141
+ I recorded demos on my Mac, but this is what I normally do on the go, from my iPhone:
142
+
143
+ ![Workout example](../assets/demo-workout.gif)
144
+
145
+ The setup is simple:
146
+
147
+ 1. **[Health Auto Export](https://www.healthyapps.dev/)** - An iOS app that syncs Apple Health data to iCloud as daily JSON files
148
+ 2. **A CLI script** (`cli/utils/health.ts`) that reads those files and returns structured health data — you can ask Claude to build this kind of script quite easily
149
+ 3. **A `workout-planning` skill** that defines the workflow for creating workouts based on training plan and recent activity
150
+ 4. **A Notes folder** (synced via iCloud) where workout logs are saved as markdown
151
+
152
+ I asked Claude to create the health script, which parses Health Auto Export's JSON files and returns my current health metrics plus historical trends for comparison.
153
+
154
+ Here's what it returns:
155
+
156
+ ```json
157
+ {
158
+ "current": {
159
+ "sleep": {
160
+ "duration": "8h 6m",
161
+ "deep": "2h 4m",
162
+ "rem": "2h 4m",
163
+ "bedtime": "1:18 AM",
164
+ "wakeTime": "9:27 AM"
165
+ },
166
+ "activity": {
167
+ "steps": 6599,
168
+ "distance": "5.1km",
169
+ "activeCalories": 582,
170
+ "exerciseTime": 20
171
+ },
172
+ "vitals": {
173
+ "restingHR": 48,
174
+ "hrv": 70.6,
175
+ "avgHR": 61
176
+ }
177
+ },
178
+ "trends": {
179
+ "last7days": { "avgSleep": "7h 40m", "avgRestingHR": 56.6, "avgHRV": 68.8 },
180
+ "30daysAgo": { "avgSleep": "7h 21m", "avgRestingHR": 55.1, "avgHRV": 66.4 },
181
+ "3monthsAgo": { "avgSleep": "7h 29m", "avgRestingHR": 51.3, "avgHRV": 77.5 }
182
+ },
183
+ "recovery": {
184
+ "score": 80,
185
+ "status": "optimal"
186
+ }
187
+ }
188
+ ```
189
+
190
+ Now I can ask things like "how did I sleep?" or "how's my recovery looking?" from anywhere.
191
+
192
+ Instead of embedding workout instructions in CLAUDE.md, I now use a **`workout-planning` skill** (`.claude/skills/workout-planning/SKILL.md`):
193
+
194
+ ```markdown
195
+ ---
196
+ name: workout-planning
197
+ description: Create personalized workout plans based on training program and recent activity. Use when asked for a workout, exercise routine, gym plan, or "what should I train today".
198
+ allowed-tools: Read, Write, Bash(cli/utils/health.ts workouts:*), Glob
199
+ ---
200
+
201
+ # Workout Planning
202
+
203
+ When asked for a workout:
204
+
205
+ 1. **Read training program**: `~/Documents/Notes/Health/training.md` (PT plan)
206
+ 2. **Check recent logs**: `~/Documents/Notes/Health/Workouts/`
207
+ 3. **Check workout frequency**: Run `health.ts workouts week` to see last 7 days
208
+ 4. **Propose appropriate workout** based on what's scheduled and recent activity
209
+ 5. **Immediately create** the workout file: `Health/Workouts/YYYY-MM-DD-workout.md`
210
+ ```
211
+
212
+ The skill also includes a CLI for checking workout history:
213
+
214
+ ```bash
215
+ bun run cli/utils/health.ts workouts # Today's workouts
216
+ bun run cli/utils/health.ts workouts week # Last 7 days
217
+ bun run cli/utils/health.ts workouts enrich # Add Health data to today's log
218
+ ```
219
+
220
+ When I message "give me a workout", Claude:
221
+
222
+ 1. Checks my training plan from my PT
223
+ 2. Looks at what I did in recent workouts
224
+ 3. Considers my recovery score from the health script
225
+ 4. Creates a workout log file like this:
226
+
227
+ ```markdown
228
+ # Workout - 29 Dec 2025
229
+
230
+ **Type:** Full Body
231
+ **Location:** Gym
232
+
233
+ ## Exercises
234
+
235
+ 3 sets, 10-12 reps, 1 min rest
236
+
237
+ 1. **Leg Extension** - [video](https://youtu.be/...)
238
+ 2. **Leg Curl** - [video](https://youtu.be/...)
239
+ 3. **Lat Machine** - [video](https://youtu.be/...)
240
+ 4. **Shoulder Press** - [video](https://youtu.be/...)
241
+ 5. **Triceps Pushdown + Bicep Curl**
242
+
243
+ ## Notes
244
+
245
+ Light workout during vacation, ~45-50 min.
246
+ ```
247
+
248
+ Since my Notes folder syncs via iCloud, I open [Ulysses](https://ulysses.app/) on my iPhone at the gym and the workout is right there.
249
+
250
+ I can message Claude mid-workout asking to tweak something, like "swap the shoulder press for lateral raises", and the file updates. I see the change live in Ulysses within seconds.
251
+
252
+ It's like having a personal trainer in my pocket who knows my training history, my recovery status, and can adjust on the fly.
253
+
254
+ As usual, the better the context, the better the results. So if you have a training plan or training history, make sure those notes are available to Claude.
255
+
256
+ ## Example: Life Pulse Command with Subagents
257
+
258
+ [Commands](https://code.claude.com/docs/en/slash-commands) let you define reusable prompts with dynamic context. They live in `~/.claude/commands/` (global) or `your-project/claude/commands/`.
259
+
260
+ [Subagents](https://code.claude.com/docs/en/sub-agents) on the other hand are specialized agents that Claude can delegate tasks to. They're defined as markdown files in `.claude/agents/` and each runs with its own context window, which keeps the main conversation lean.
261
+
262
+ My personal assistant "fab-dev" folder contains both commands and subagents. Commands are symlinked from `~/.claude/commands/` so they're available everywhere, and they can use MCPs and invoke subagents defined in this folder.
263
+
264
+ I always liked the idea of reading a sort of **executive summary of what's on my plate** every morning, so I asked Claude to create a `/life-pulse` command, with a set of specialized subagents, and also to set it up to run automatically every morning.
265
+
266
+ ### Why Subagents?
267
+
268
+ A complex command like `/life-pulse` needs to gather data from many sources: email, work issues, finances, health metrics, racing stats, web news. If the main agent does all this directly, the context window fills up fast with raw data, and can lead to poor results or missing information.\*
269
+
270
+ So my pulse command uses **6 subagents** that run in parallel:
271
+
272
+ | Subagent | Job | Returns |
273
+ | ------------------- | ------------------------------ | ----------------------------------------- |
274
+ | `gmail-digest` | Analyze inbox & recent emails | Unread needing attention, orders, threads |
275
+ | `linear-digest` | Analyze work issues | In-progress, blockers, up next |
276
+ | `finance-digest` | Analyze net worth & allocation | Financial snapshot, time-sensitive items |
277
+ | `health-digest` | Analyze Apple Health data | Brief health check-in |
278
+ | `sim-racing-digest` | Analyze race results | Performance insights |
279
+ | `for-you-digest` | Curate web & Reddit content | 10-15 interesting items |
280
+
281
+ The main agent then just handles lightweight data (Things tasks, calendar, journal) and **assembles** the subagent outputs into the final digest.
282
+
283
+ ### Subagent Example
284
+
285
+ Here's what a digest subagent looks like (simplified):
286
+
287
+ ```
288
+ ---
289
+ name: health-digest
290
+ description: Analyzes health metrics and provides a brief check-in. Use for pulse or when user asks about health.
291
+ tools: Bash, Read
292
+ model: haiku
293
+ ---
294
+
295
+ You are a health-conscious friend giving a quick check-in on health metrics.
296
+
297
+ ## Data Gathering
298
+
299
+ Run the health script:
300
+ bun run cli/utils/health.ts
301
+
302
+ ## Analysis
303
+
304
+ Look for what's actually notable:
305
+
306
+ - Sleep significantly better/worse than usual
307
+ - Resting HR trending up (stress) or down (fitness)
308
+ - HRV changes over the past month
309
+
310
+ ## Output
311
+
312
+ Return a brief check-in (3-5 lines). Write like a friend, not a medical report.
313
+
314
+ Example: "Sleep's been solid at 7.2h — up from 6.8h last month. Resting HR holding at 54bpm. Activity a bit low this week, might want to get some walks in."
315
+ ```
316
+
317
+ ### The Main Pulse Command
318
+
319
+ Here's a simplified version of the `/life-pulse` command:
320
+
321
+ ````
322
+ ---
323
+ description: Generate executive life digest
324
+ allowed-tools: Bash, Read, Write, mcp__things__*, Task
325
+ ---
326
+
327
+ # Generate Life Pulse
328
+
329
+ ## Context
330
+
331
+ - Current time: !`date "+%A, %Y-%m-%d %H:%M"`
332
+
333
+ ## Implementation
334
+
335
+ 1. **Gather Data** (run in parallel):
336
+
337
+ - Things: `get_today`, `get_upcoming`, `get_projects` (lightweight, main agent handles)
338
+ - Calendar: `bun run cli/google/calendar.ts range <today> <today+28>`
339
+ - Journal: Read 2-3 recent entries
340
+ - **Email**: Invoke `gmail-digest` subagent (do NOT run in background)
341
+ - **Work**: Invoke `linear-digest` subagent (do NOT run in background)
342
+ - **Finances**: Invoke `finance-digest` subagent (do NOT run in background)
343
+ - **Health**: Invoke `health-digest` subagent (do NOT run in background)
344
+ - **Racing**: Invoke `sim-racing-digest` subagent (do NOT run in background)
345
+ - **For You**: Invoke `for-you-digest` subagent (do NOT run in background)
346
+
347
+ 2. **Synthesize** the outputs into sections:
348
+
349
+ - **TL;DR**: Bullet points (max 400 chars each) capturing essential state of life. Each bullet starts with a relevant emoji. Include financial snapshot, email highlights, upcoming events.
350
+ - For items with a clear next action, add a follow-up line:
351
+ ```
352
+ 💰 **Item description here.**
353
+ ↳ **Clear next action here**
354
+ ```
355
+ - **Now**: Very concise list of what needs attention. 3-6 items max, no fluff.
356
+ - **For You**: Curated content from for-you-digest. Brief bullets with emojis and links.
357
+ - **Top of Mind**: What's occupying mental bandwidth. Use emoji at the start of each paragraph.
358
+ - **Health**: From health-digest. Can be bullets, each with a relevant emoji.
359
+ - **Next**: Near-term priorities combined with longer-term goals.
360
+
361
+ 3. **Formatting Rules**:
362
+ - NO TABLES — use natural prose and bullet points
363
+ - Use **bold** for emphasis on key terms
364
+ - Keep it scannable but warm, like a personal briefing
365
+ - Make links clickable (Linear issues, Things tasks, emails)
366
+
367
+ 4. **Write** to `~/Documents/Notes/life-pulse.md`
368
+
369
+ 5. Open the file when done: `open ~/Documents/Notes/life-pulse.md`
370
+ ````
371
+
372
+ All the raw data stays contained in fast and cheap subagent runs (they use `haiku`). The main agent only sees the synthesized summaries and assembles everything into a coherent, readable digest.
373
+
374
+ And because each subagent is a standalone file, I can invoke them directly to answer questions like "how's my health?" or "check my email".
375
+
376
+ I've been reading my life pulse digest on my iPad every morning while sipping coffee for a while now, and it's been a great way to start the day.
377
+
378
+ ## Example: Dynamic Calendars
379
+
380
+ Another cool pattern I use is having Claude **manage calendars that sync to my phone**. I use this for both real-world track days and sim racing leagues.
381
+
382
+ ```
383
+ YAML config → sync.py → .ics file → GitHub Gist → Google/Apple Calendar
384
+ ```
385
+
386
+ [GitHub Gist](https://gist.github.com/) URLs are stable, so calendar apps that subscribe to them auto-refresh when the content changes (with some delay).
387
+
388
+ I wanted to know about track days at circuits near me (Estoril, Portimão in Portugal). The problem: event info is scattered across multiple organizer websites, often in PDF flyers or image-based pages.
389
+
390
+ So I asked Claude to build a scraper. It grew into a 36,000-line Python script (`racing-events.py`) that:
391
+
392
+ 1. **Scrapes multiple sources** - EuropaTrackdays, Driven.pt, Motor Sponsor, CRM Caterham
393
+ 2. **Uses Playwright** for JavaScript-heavy sites
394
+ 3. **Uses OCR and Claude Vision** for PDF flyers and image-based calendars
395
+ 4. **Outputs YAML** with structured event data
396
+
397
+ YAML is a good format for this since it's easy to read and write, and I can also easily spot mistakes and manually edit it.
398
+
399
+ ```yaml
400
+ # calendars/track-days.yaml (auto-generated)
401
+ gist:
402
+ id: 12344asdasd257be07871234asddfg123
403
+ filename: track_days.ics
404
+ calendar:
405
+ name: "Fab • Track Days"
406
+ timezone: Europe/Lisbon
407
+ events:
408
+ - date: "2026-01-11"
409
+ time: "09:00"
410
+ title: "Portimão - Gedlich Racing"
411
+ duration_minutes: 540
412
+ description: "Endless Summer | €3,290 | Open Pit Lane..."
413
+ url: https://en.europatrackdays.com/trackday/29919/...
414
+ ```
415
+
416
+ The YAML is then synced to a Gist that my calendar subscribes to.
417
+
418
+ When I ask "update my track day calendar", Claude runs the scraper, updates the YAML, and syncs to the gist. My calendar refreshes automatically.
419
+
420
+ In fact, I asked Claude to create a `sync.py` script that converts YAML to iCalendar format and pushes to GitHub:
421
+
422
+ ```bash
423
+ # List available calendars
424
+ calendars/sync.py list
425
+
426
+ # Preview upcoming events
427
+ calendars/sync.py preview sim-racing
428
+
429
+ # Sync to gist (uses `gh` CLI)
430
+ calendars/sync.py sync sim-racing
431
+ ```
432
+
433
+ I subscribed to these Gist URLs once in Google Calendar and Apple Calendar:
434
+
435
+ ```
436
+ https://gist.githubusercontent.com/linuz90/.../raw/sim_racing.ics
437
+ https://gist.githubusercontent.com/linuz90/.../raw/track_days.ics
438
+ ```
439
+
440
+ Now when I message "add the Belgium race to my sim racing calendar for next Thursday", Claude:
441
+
442
+ 1. Edits `sim-racing.yaml`
443
+ 2. Runs `sync.py sync sim-racing`
444
+ 3. The gist updates
445
+ 4. My phone calendar refreshes within minutes
446
+
447
+ I can manage my racing calendars from anywhere in the world, via Telegram.
448
+
449
+ ## Example: Claude as a Researcher
450
+
451
+ Another pattern I use all the time is having Claude do thorough research for me. Whether I'm comparing products, investigating a topic, or making a purchase decision, Claude searches multiple sources and synthesizes findings into a clear recommendation.
452
+
453
+ ![Research example](../assets/demo-research.gif)
454
+
455
+ The setup now uses a **`research` skill** that handles the entire workflow:
456
+
457
+ ```markdown
458
+ ---
459
+ name: research
460
+ description: Research topics thoroughly using web search, Reddit, and Hacker News, then save findings to Notes. Use when asked to research, compare options, investigate a topic, or find pros/cons.
461
+ allowed-tools: WebSearch, WebFetch, Bash(reddit.sh:*), Bash(hn.sh:*), Read, Write, Edit, Glob
462
+ ---
463
+
464
+ # Research Workflow
465
+
466
+ **CRITICAL: Every research task MUST save results to `~/Documents/Notes/Research/` BEFORE responding.**
467
+
468
+ ## Process
469
+
470
+ 1. **Check existing research** in `~/Documents/Notes/Research/` first
471
+ 2. **Search thoroughly** using multiple sources:
472
+ - WebSearch for general information
473
+ - Reddit for community insights
474
+ - Hacker News for tech/startup discussions
475
+ 3. **Synthesize** findings with clear recommendation
476
+ 4. **Save to file** - update if exists
477
+ ```
478
+
479
+ The skill includes scripts for community sources:
480
+
481
+ **Reddit** - Real-world opinions and experiences:
482
+
483
+ ```bash
484
+ reddit.sh top iRacing,simracing --time week --limit 10 --preview
485
+ reddit.sh search "BMW M2 front splitter" --time all --limit 20 --preview
486
+ ```
487
+
488
+ **Hacker News** - Tech and startup discussions:
489
+
490
+ ```bash
491
+ hn.sh top --limit 5 --min-score 100 # Top stories this week
492
+ hn.sh search "startup pricing" --preview # Search with comments
493
+ ```
494
+
495
+ The `--preview` flag includes full post content and top comments, which is where the real insights are.
496
+
497
+ When I message something like "research upgrade options for my sim racing rig", Claude:
498
+
499
+ 1. **Checks existing research** - looks in `Research/` for any previous files on the topic
500
+ 2. **Searches the web** - uses web search for product reviews and expert opinions
501
+ 3. **Searches Reddit and HN** - finds community discussions with real-world experiences
502
+ 4. **Synthesizes everything** - combines specs, reviews, and community feedback
503
+ 5. **Saves the research** - creates a dated file like `2025-12-30-sim-racing-rig-upgrade.md`
504
+
505
+ The result is a comprehensive research document with clear recommendations and links to all sources. I love that I can trigger this anywhere and anytime.
506
+
507
+ ## Example: Claude as a Co-Worker
508
+
509
+ Since integrating **Slack, Linear, and Notion** into my setup, Claude can act as a co-worker who keeps track of what's happening at work.
510
+
511
+ When I've been away for a few days, I can ask things like:
512
+
513
+ - "What are my teammates up to? Any blockers?"
514
+ - "Catch me up on the #progress-updates channel"
515
+ - "What's the latest on the API v2 project?"
516
+
517
+ Claude checks Slack for recent messages and threads, Linear for issue updates and blockers, and Notion for any new specs or docs — then summarizes what's relevant to me.
518
+
519
+ ### Setting Up Slack Access
520
+
521
+ To make this work, you need to create a Slack app with the right permissions:
522
+
523
+ 1. **Create a Slack app** at [api.slack.com/apps](https://api.slack.com/apps)
524
+ 2. **Add OAuth scopes** under "OAuth & Permissions":
525
+ - `channels:history` - Read messages in public channels
526
+ - `channels:read` - List channels
527
+ - `groups:history` - Read messages in private channels (optional)
528
+ - `groups:read` - List private channels (optional)
529
+ 3. **Install the app** to your workspace and copy the Bot User OAuth Token
530
+ 4. **Invite the bot** to channels you want it to read (use `/invite @YourBotName` in each channel)
531
+
532
+ The bot can only see messages in channels it's been invited to, which gives you control over what Claude can access.
533
+
534
+ ### The CLI
535
+
536
+ I asked Claude to build a simple Slack CLI:
537
+
538
+ ```bash
539
+ bun run cli/integrations/slack.ts channels # List joined channels
540
+ bun run cli/integrations/slack.ts messages general # Recent messages from #general
541
+ bun run cli/integrations/slack.ts recent # Recent across all channels
542
+ bun run cli/integrations/slack.ts thread <url> # Full thread from a Slack URL
543
+ ```
544
+
545
+ Combined with Linear and Notion access, Claude can give me a complete picture of what's been happening at work — all from a quick Telegram message while I'm grabbing coffee.
546
+
547
+ In the end, it's up to you wether to create scripts, skills, commands, or any combination of them to empower your agent to assist you. Sky's the limits, and seems like this is evolving every day now.
548
+
549
+ I'd love to know what you're building, [hit me up on X](https://x.com/linuz90).
@@ -0,0 +1,76 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Label</key>
6
+ <string>com.claude-telegram-ts</string>
7
+
8
+ <key>ProgramArguments</key>
9
+ <array>
10
+ <!-- Update this path to your bun installation -->
11
+ <string>/Users/USERNAME/.bun/bin/bun</string>
12
+ <string>run</string>
13
+ <!-- Update this path to your bot installation -->
14
+ <string>/Users/USERNAME/Dev/claude-telegram-bot-ts/src/index.ts</string>
15
+ </array>
16
+
17
+ <key>WorkingDirectory</key>
18
+ <!-- Update this path to your bot installation -->
19
+ <string>/Users/USERNAME/Dev/claude-telegram-bot-ts</string>
20
+
21
+ <key>EnvironmentVariables</key>
22
+ <dict>
23
+ <!-- Required: Your Telegram bot token -->
24
+ <key>TELEGRAM_BOT_TOKEN</key>
25
+ <string>your-bot-token-here</string>
26
+
27
+ <!-- Required: Comma-separated Telegram user IDs -->
28
+ <key>TELEGRAM_ALLOWED_USERS</key>
29
+ <string>123456789</string>
30
+
31
+ <!-- Recommended: Working directory for Claude -->
32
+ <key>CLAUDE_WORKING_DIR</key>
33
+ <string>/Users/USERNAME/Dev</string>
34
+
35
+ <!-- Optional: For voice transcription -->
36
+ <key>OPENAI_API_KEY</key>
37
+ <string>sk-...</string>
38
+
39
+ <!-- Optional: Comma-separated paths Claude can access -->
40
+ <key>ALLOWED_PATHS</key>
41
+ <string>/Users/USERNAME/Dev,/Users/USERNAME/Documents</string>
42
+
43
+ <!-- Optional: Thinking keywords -->
44
+ <key>THINKING_KEYWORDS</key>
45
+ <string>think,pensa,ragiona</string>
46
+ <key>THINKING_DEEP_KEYWORDS</key>
47
+ <string>ultrathink,think hard,pensa bene</string>
48
+
49
+ <!-- Optional: Rate limiting -->
50
+ <key>RATE_LIMIT_ENABLED</key>
51
+ <string>true</string>
52
+ <key>RATE_LIMIT_REQUESTS</key>
53
+ <string>40</string>
54
+ <key>RATE_LIMIT_WINDOW</key>
55
+ <string>60</string>
56
+
57
+ <!-- Ensure PATH includes necessary binaries -->
58
+ <key>PATH</key>
59
+ <string>/Users/USERNAME/.bun/bin:/Users/USERNAME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
60
+ </dict>
61
+
62
+ <!-- Restart automatically if it crashes -->
63
+ <key>KeepAlive</key>
64
+ <true/>
65
+
66
+ <!-- Start on login -->
67
+ <key>RunAtLoad</key>
68
+ <true/>
69
+
70
+ <!-- Log output -->
71
+ <key>StandardOutPath</key>
72
+ <string>/tmp/claude-telegram-bot.log</string>
73
+ <key>StandardErrorPath</key>
74
+ <string>/tmp/claude-telegram-bot.err</string>
75
+ </dict>
76
+ </plist>
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ cd /Users/linuz90/Dev/claude-telegram-bot-ts
5
+
6
+ # Source environment variables
7
+ if [ -f .env ]; then
8
+ set -a
9
+ source .env
10
+ set +a
11
+ fi
12
+
13
+ # Run the bot
14
+ exec /Users/linuz90/.bun/bin/bun run src/index.ts
@@ -0,0 +1,42 @@
1
+ /**
2
+ * MCP Servers Configuration for Claude Telegram Bot.
3
+ *
4
+ * Copy this file and customize for your setup.
5
+ * Each MCP server gives Claude access to external tools/data.
6
+ *
7
+ * Format matches Claude's MCP config schema.
8
+ * See: https://docs.anthropic.com/en/docs/build-with-claude/mcp
9
+ */
10
+
11
+ import { homedir } from "os";
12
+ import { dirname } from "path";
13
+
14
+ const HOME = homedir();
15
+ const REPO_ROOT = dirname(import.meta.path);
16
+
17
+ export const MCP_SERVERS: Record<
18
+ string,
19
+ | { command: string; args?: string[]; env?: Record<string, string> }
20
+ | { type: "http"; url: string; headers?: Record<string, string> }
21
+ > = {
22
+ // Ask User - present options as Telegram inline keyboard buttons
23
+ // Uncomment to enable interactive button prompts
24
+ // "ask-user": {
25
+ // command: "bun",
26
+ // args: ["run", `${REPO_ROOT}/ask_user_mcp/server.ts`]
27
+ // },
28
+
29
+ // Example: Typefully - draft and schedule social posts
30
+ // Docs: https://support.typefully.com/en/articles/13128440-typefully-mcp-server
31
+ // "typefully": {
32
+ // type: "http",
33
+ // url: `https://mcp.typefully.com/mcp?TYPEFULLY_API_KEY=${process.env.TYPEFULLY_API_KEY || ""}`
34
+ // },
35
+
36
+ // Example: Things 3 task manager (macOS)
37
+ // Requires: https://github.com/hald/things-mcp
38
+ // "things": {
39
+ // command: "uv",
40
+ // args: ["--directory", `${HOME}/Dev/things-mcp`, "run", "things_server.py"]
41
+ // },
42
+ };