Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Session Context Injector

v1.0.0

Reorient a Telegram chat after a session reset. Reads a project's STATUS.md (resume point, blockers, next action) and sends a project-specific context inject...

0· 82·0 current·0 all-time
byNissan Dookeran@nissan

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for nissan/session-context-injector.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Session Context Injector" (nissan/session-context-injector) from ClawHub.
Skill page: https://clawhub.ai/nissan/session-context-injector
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: TELEGRAM_BOT_TOKEN
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install session-context-injector

ClawHub CLI

Package manager switcher

npx clawhub@latest install session-context-injector
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name/description align with sending project context into Telegram. Required items declared (python3, TELEGRAM_BOT_TOKEN) are reasonable for that purpose. However, the SKILL.md expects other inputs (bot_token via op read, PROJECTS_DIR, memory files like sessions.json/telegram-groups.json) that are not declared in the registry metadata, which is an incoherence.
!
Instruction Scope
Instructions tell the agent to read local project files (projects/<slug>/STATUS.md), agent memory files (sessions.json, memory/telegram-groups.json), and to retrieve credentials via `op read`. None of these file paths or the use of the 1Password CLI are declared in the skill metadata. The skill will also transmit project STATUS content to external endpoints (api.telegram.org) — expected for the purpose, but you should confirm that sending potentially sensitive project content to Telegram chats is acceptable and limited to intended chat IDs.
Install Mechanism
No install spec and no included code files — instruction-only skill. Low disk/installation risk because nothing is downloaded or written by the skill bundle itself.
!
Credentials
Metadata declares a single credential (TELEGRAM_BOT_TOKEN), which is appropriate, but the SKILL.md also documents fetching `bot_token` with `op read "op://OpenClaw/Telegram Bot Token/credential"` (1Password) and references PROJECTS_DIR and agent memory files. The additional secret-retrieval and filesystem access are not reflected in requires.env or required config paths, creating a mismatch and potential surprise access to secrets or local files.
Persistence & Privilege
always is false (good). The skill can be autonomously invoked by the agent (default), which combined with an available bot token means it could send messages without manual approval. Autonomous invocation alone is normal, but because the skill posts externally and reads local project state, you should be aware of this behavior.
What to consider before installing
Before installing or enabling: 1) Confirm how the skill obtains the bot token — metadata lists TELEGRAM_BOT_TOKEN but SKILL.md shows an `op read` (1Password) step; clarify which method will be used and update metadata. 2) Verify PROJECTS_DIR and the locations of sessions.json / memory/telegram-groups.json — these filesystem reads are not declared and may expose project content; ensure the agent runs in a workspace you trust. 3) Review the Telegram bot's scope and which chats the bot can message (the skill contains a hard-coded special-case chat_id for Nissan). Limit the bot token permissions and rotate it if you enable the skill. 4) Ask the publisher to remove or explain hard-coded IDs, and to declare any CLI tools (e.g., 1Password CLI) needed at runtime. 5) Test in dry-run mode or a sandboxed environment first to ensure messages, truncation, and HTML formatting behave as expected and that no unintended data is leaked. If you cannot get answers to the above, treat the inconsistencies as a risk and do not grant the bot token or filesystem access.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🔄 Clawdis
Binspython3
EnvTELEGRAM_BOT_TOKEN
Primary envTELEGRAM_BOT_TOKEN
latestvk9713q7970b0hxq8zbdp4j5gms844pe5
82downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

SKILL: session-context-injector

Use when: A Telegram chat session has been cleared, a collaborator joins a project room, a new project room is created, or any context needs to be re-anchored in a specific chat after a reset.

Why this exists: After a session clear, the next person to message gets a blank-slate AI with no project awareness. This skill ensures every reset is followed by a project-specific reorientation message — so the first reply in a fresh session is always oriented, not confused.

Invoked by:

  • playbooks/session-refresh/PLAYBOOK.md — Phase 3, after each session clear
  • playbooks/new-project/PLAYBOOK.md — Stage 5b, after room creation
  • playbooks/telegram-collaborator-room/PLAYBOOK.md — on collaborator join

Inputs

InputSourceRequired
chat_idsessions.json or telegram-groups.json
slugmemory/telegram-groups.json[chat_id].slug✅ for project rooms
project_namememory/telegram-groups.json[chat_id].name
bot_tokenop read "op://OpenClaw/Telegram Bot Token/credential"
STATUS.mdprojects/<slug>/STATUS.mdOptional — enriches message
chat_typegroup / direct / tui

Step 1 — Parse STATUS.md

If projects/<slug>/STATUS.md exists, extract:

import re

def parse_status(slug: str) -> dict:
    path = PROJECTS_DIR / slug / "STATUS.md"
    if not path.exists():
        return {}
    text = path.read_text()

    def extract(heading: str) -> str:
        m = re.search(
            rf"##+ {re.escape(heading)}\s*\n(.*?)(?=\n##|\Z)",
            text, re.DOTALL
        )
        return m.group(1).strip()[:400] if m else ""

    resume   = extract("RESUME FROM HERE") or extract("Resume From Here") or ""
    blockers = extract("Blockers") or extract("Open Blockers") or ""

    # Strip markdown bullets
    resume   = re.sub(r"^[-*] ", "", resume, flags=re.MULTILINE).strip()
    blockers = re.sub(r"^[-*] ", "", blockers, flags=re.MULTILINE).strip()

    return {
        "resume":   resume[:300],
        "blockers": blockers[:200],
    }

Fallback: If STATUS.md is missing or empty, use the generic template (Step 2b).


Step 2a — Build Project Room Message (group chat)

def build_group_message(project_name: str, slug: str, status: dict) -> str:
    resume   = status.get("resume", "")
    blockers = status.get("blockers", "")

    lines = [
        f"🔄 <b>Session Refresh — {project_name}</b>",
        "",
        "I've refreshed my context. Here's where we are:",
        "",
    ]

    if slug:
        lines.append(f"📌 <b>Project:</b> {slug.upper()}")
    if resume:
        lines.append(f"📍 <b>Resume from:</b> {resume}")
    if blockers and blockers.lower() not in ("none", "—", "-", ""):
        lines.append(f"🚧 <b>Blockers:</b> {blockers}")

    lines += [
        "",
        "My memory and project files are fully updated. "
        "Jump back in whenever you're ready — just pick up the thread. 🐾",
    ]
    return "\n".join(lines)

Character limit: Keep under 4096 chars (Telegram max). Truncate resume and blockers at the values above if STATUS.md is long.


Step 2b — Build Direct Chat Message (Nissan DM)

Use when chat_type == "direct" and the chat_id is Nissan's (821071206).

def build_direct_message(touched_projects: list[dict]) -> str:
    lines = [
        "🔄 <b>Daily Session Refresh</b>",
        "",
        "Context cleared. Memory and STATUS files are up to date.",
    ]
    if touched_projects:
        lines.append("")
        lines.append("Active projects refreshed:")
        for p in touched_projects[:10]:
            lines.append(f"• <b>{p['slug'].upper()}</b> — {p['name']}")
    lines += ["", "Anything you want to jump straight into? 🐾"]
    return "\n".join(lines)

Step 2c — Build New Room / Collaborator Join Message

Use when a room is freshly created or a collaborator joins for the first time (not a reset).

def build_welcome_message(project_name: str, slug: str, purpose: str, allowed_topics: list[str]) -> str:
    topic_list = "\n".join(f"• {t}" for t in allowed_topics[:8])
    return (
        f"👋 <b>Welcome to {project_name}</b>\n\n"
        f"{purpose}\n\n"
        f"<b>What I can help with here:</b>\n{topic_list}\n\n"
        f"I have full project context loaded. Ask me anything within scope. 🐾"
    )

Step 3 — Send via Telegram Bot API

import urllib.request, json

def send_injection(bot_token: str, chat_id: str, text: str, dry_run: bool = False) -> bool:
    if dry_run:
        print(f"[DRY-RUN] → {chat_id}: {text[:100].replace(chr(10),' ')}…")
        return True
    try:
        url     = f"https://api.telegram.org/bot{bot_token}/sendMessage"
        payload = json.dumps({
            "chat_id":    chat_id,
            "text":       text,
            "parse_mode": "HTML",
        }).encode()
        req = urllib.request.Request(
            url, data=payload,
            headers={"Content-Type": "application/json"}
        )
        with urllib.request.urlopen(req, timeout=10) as r:
            return r.status == 200
    except Exception as e:
        print(f"⚠️  Injection failed ({chat_id}): {e}")
        return False

Parse mode: Always use HTML (not Markdown). Markdown requires escaping; HTML is more predictable with <b> and <i>.

On failure: Log the failure, continue with other chats. Never block the refresh loop on a single failed send.


Step 4 — Log the Injection

After each successful send, append to memory/YYYY-MM-DD.md:

### Context Injection Sent — [project_name] — YYYY-MM-DD HH:MM AEST
- **Chat ID:** [chat_id]
- **Slug:** [slug]
- **Type:** [session-refresh / room-creation / collaborator-join]
- **Status:** ✅ sent / ❌ failed

And if the project has a STATUS.md, append a one-liner:

_Context injection sent: YYYY-MM-DD HH:MM AEST — session cleared._

Decision Rules

ConditionAction
STATUS.md exists + has contentUse Step 2a with extracted resume/blockers
STATUS.md missing or emptyUse Step 2a with slug + name only (no resume/blockers section)
chat_type == "direct" + NissanUse Step 2b
New room / first joinUse Step 2c
chat_id is NoneSkip Telegram send; log to memory only
bot_token unavailableLog failure to memory; do not crash
Message > 4096 charsTruncate resume to 200 chars, blockers to 100 chars

Example Output (group chat, STATUS.md found)

🔄 Session Refresh — OpenClaw — Portkey Gateway Integration

I've refreshed my context. Here's where we are:

📌 Project: PORTKEY
📍 Resume from: Test latency comparison between direct Anthropic calls and Portkey-routed calls. Script is at scripts/portkey-bench.py — needs --compare flag wired up.
🚧 Blockers: Portkey dashboard shows incorrect token counts for cache_read events — filed upstream.

My memory and project files are fully updated. Jump back in whenever you're ready — just pick up the thread. 🐾

Reuse Checklist

Before calling this skill from a playbook or script:

  • chat_id is confirmed (from sessions.json or telegram-groups.json)
  • bot_token retrieved from 1Password (not hardcoded)
  • slug verified — projects/<slug>/STATUS.md exists or graceful fallback confirmed
  • parse_mode: "HTML" — not Markdown
  • Failure is logged, not raised

ClawHub Tags

telegram, context-injection, session-refresh, project-rooms, reorientation


Changelog

  • 2026-04-03: Extracted from playbooks/session-refresh/PLAYBOOK.md Phase 3. Added welcome/join variant (Step 2c). Formalised as standalone reusable skill.

Comments

Loading comments...