Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install vivekkarmarkar-claude-code-os-skills-tg-exchange-loop-extractgit clone https://github.com/VivekKarmarkar/claude-code-os.gitcp claude-code-os/SKILL.MD ~/.claude/skills/vivekkarmarkar-claude-code-os-skills-tg-exchange-loop-extract/SKILL.md---
name: tg-exchange-loop-extract
description: Loop over a range of Telegram exchanges in Telegram_calls.md, extracting verbatim transcribed input and Claude tool output into dedicated markdown files
---
# tg-exchange-loop-extract — Batch extract Telegram exchanges into verbatim + claude files
## Arguments
The user provides a `filename_substring` and optionally context about which exchanges to extract:
- `/tg-exchange-loop-extract introduction` → extracts exchanges about the introduction
- `/tg-exchange-loop-extract methods section discussion` → extracts exchanges about methods
- `/tg-exchange-loop-extract` → no substring provided, ask user
## Behavior
### Step 1 — Determine `filename_substring`
- If the user provides a clear `filename_substring`, use it.
- If the user provides no context, ask: "What topic or section should I extract? This will be used for the filename (e.g., `introduction`, `methods`, `results`)."
- If the user gives a vague response (e.g., "the stuff we just talked about", "that last discussion"), choose an appropriate `filename_substring` based on conversation context.
### Step 2 — Create the two output files
Invoke `/new-md` to create both:
- `{filename_substring}_verbatim.md`
- `{filename_substring}_claude.md`
If either file already exists, ask the user whether to append to it or skip creation. Do not overwrite.
### Step 3 — Identify FIRST and LAST relevant messages
Read `Telegram_calls.md` in the project root. Scan all entries to identify:
- **FIRST**: The earliest message whose content (reply text or input metadata context) is relevant to the topic/context
- **LAST**: The most recent message whose content is relevant to the topic/context
Report the identified range to the user: "Found exchanges from message {FIRST_ID} to message {LAST_ID} ({N} exchanges). Proceeding with extraction."
### Step 4 — Loop over the range
For each exchange between FIRST and LAST (inclusive), where the exchange is relevant to the topic:
**A) Extract verbatim transcribed input:**
- Apply `/verbatim-input-transcribed-from-tg-exchange` logic: from the metadata, locate the corresponding transcription in the current session's conversation context
- Append to `{filename_substring}_verbatim.md` with a section header: `## Message {ID} (ts: {timestamp})`
- Followed by the verbatim transcribed text
- Followed by `---` separator
**B) Extract Claude's tool call output:**
- Apply `/claude-tool-output-from-tg-exchange` logic: extract the "Reply text" field from the Telegram_calls.md entry
- Append to `{filename_substring}_claude.md` with a section header: `## Reply to Message {ID}`
- Followed by the reply text
- Followed by `---` separator
### Step 5 — Report
After processing all exchanges, confirm:
```
Extracted {N} exchanges for "{filename_substring}":
- {filename_substring}_verbatim.md — {N} verbatim transcribed inputs
- {filename_substring}_claude.md — {N} Claude tool outputs
Range: message {FIRST_ID} → message {LAST_ID}
```
## Notes
- Only include exchanges that are relevant to the topic. Skip exchanges in the range that are about unrelated things (e.g., skill creation, file management) unless they contain substantive content about the topic.
- If transcriptions are not available in the current session context for voice messages, note this in the verbatim file: `[Transcription not available in current session — re-transcribe from .oga file if needed]`
- For text messages (not voice), the verbatim input is the text content from the channel tag.
- This skill composes: `/new-md`, `/verbatim-input-transcribed-from-tg-exchange`, and `/claude-tool-output-from-tg-exchange`.