Search Telegram Message History

VerifiedCaution

Search through Telegram conversation history and stored links. Find past messages, quotes, or links shared in chats using SQLite queries.

Sby Skills Guide Bot
ProductivityBeginner
3/8/2026
Claude CodeCursorCodex
#sqlite#telegram#search#message-history#links

Recommended for

Automated summary

Queries a local SQLite database (~/.valor/telegram_history.db) to find past Telegram messages and links shared in chats.

Strengths

  • Ships ready-to-run SQL for listing chats, recent messages, and keyword searches
  • Also covers the links table with url, title, AI summary, and tags
  • Explicitly documents the correct database path and the one to avoid
  • Supports narrowing searches to a specific chat_id

Limitations

  • Assumes ~/.valor/telegram_history.db already exists and is populated by another tool
  • Keyword search is plain SQL LIKE, with no ranking or full-text search
  • Read-only: nothing about writing, editing, or deduplicating records
When to use it

Use it when you need to recall what someone said in a Telegram chat or find a link shared in a past conversation.

When not to use it

Don't use it for other messaging platforms, or when the Telegram history database isn't present on the machine.

Security analysis

Caution
Quality score84/100

The skill legitimately uses Bash and sqlite3 for read-only queries against a local SQLite database. This is a powerful tool and touches sensitive private message history, so it warrants caution, but there are no destructive, exfiltrating, or obfuscated instructions.

Findings
  • •Uses Bash with sqlite3 to read a local database of private Telegram messages and links, which may contain sensitive personal communications.
  • •Queries are read-only SELECT statements, but the skill does not explicitly warn against modifications or unsafe SQL construction if user-supplied keywords are interpolated.
  • •No evidence of data exfiltration, destructive commands, obfuscation, or disabling safety controls.
How this analysis is made

Examples

Recall a past discussion
Search my Telegram history for any message mentioning 'deployment checklist' and show who said it and when.
Find shared links
Find links shared in chat -5240384240 whose title or summary mentions Postgres, and list the URL and sender.
Recent activity summary
List the last 10 messages across all my Telegram chats with sender, a snippet of content, and timestamp.

name: searching-message-history description: Search Telegram conversation history and stored links. Use when finding past messages, what someone said, or links shared in chats. allowed-tools: Read, Grep, Glob, Bash

Message History

Location: ~/.valor/telegram_history.db (SQLite)

Tables

messages: id, chat_id, message_id, sender, content, timestamp, message_type

links: id, url, final_url, title, description, domain, sender, chat_id, message_id, timestamp, tags, notes, status, ai_summary

Query Examples

# List all chats
sqlite3 ~/.valor/telegram_history.db "SELECT chat_id, COUNT(*) as count FROM messages GROUP BY chat_id ORDER BY count DESC"

# Recent messages (all chats)
sqlite3 ~/.valor/telegram_history.db "SELECT sender, substr(content, 1, 200), timestamp FROM messages ORDER BY timestamp DESC LIMIT 10"

# Messages from specific chat
sqlite3 ~/.valor/telegram_history.db "SELECT sender, content, timestamp FROM messages WHERE chat_id = '-5240384240' ORDER BY timestamp DESC LIMIT 10"

# Messages from Valor
sqlite3 ~/.valor/telegram_history.db "SELECT chat_id, substr(content, 1, 300), timestamp FROM messages WHERE sender='Valor' ORDER BY timestamp DESC LIMIT 10"

# Search by keyword
sqlite3 ~/.valor/telegram_history.db "SELECT sender, content, timestamp FROM messages WHERE content LIKE '%keyword%' ORDER BY timestamp DESC LIMIT 10"

# Search in specific chat
sqlite3 ~/.valor/telegram_history.db "SELECT sender, content, timestamp FROM messages WHERE chat_id = '-5240384240' AND content LIKE '%keyword%' ORDER BY timestamp DESC"

Links

# Recent links
sqlite3 ~/.valor/telegram_history.db "SELECT url, title, sender, chat_id, timestamp FROM links ORDER BY timestamp DESC LIMIT 10"

# Links from specific chat
sqlite3 ~/.valor/telegram_history.db "SELECT url, title, sender FROM links WHERE chat_id = '-5240384240' ORDER BY timestamp DESC"

# Search links
sqlite3 ~/.valor/telegram_history.db "SELECT url, title, ai_summary FROM links WHERE title LIKE '%keyword%' OR ai_summary LIKE '%keyword%'"

Note

The file /Users/valorengels/src/ai/data/telegram_history.db is NOT used. Always use ~/.valor/telegram_history.db.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/search-telegram-message-history-mmh8qqwj' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/search-telegram-message-history-mmh8qqwj/download' --output '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md.part' && mv '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md.part' '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Grep, Glob, Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && test -s '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/searching-message-history' && cp -R '.skill-downloads/search-telegram-message-history-mmh8qqwj' '.claude/skills/searching-message-history'

Cursor
test -f '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && test -s '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/searching-message-history' && cp -R '.skill-downloads/search-telegram-message-history-mmh8qqwj' '.cursor/skills/searching-message-history'

Codex
test -f '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && test -s '.skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/searching-message-history' && cp -R '.skill-downloads/search-telegram-message-history-mmh8qqwj' '.agents/skills/searching-message-history'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/search-telegram-message-history-mmh8qqwj'

openskills read 'search-telegram-message-history-mmh8qqwj'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/search-telegram-message-history-mmh8qqwj/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills