Skip to content

feat(channel): forward Claude tool invocations to Telegram via PreToolUse hook#126

Merged
codeaholicguy merged 1 commit into
mainfrom
feature-claude-prompt-hook
Jun 29, 2026
Merged

feat(channel): forward Claude tool invocations to Telegram via PreToolUse hook#126
codeaholicguy merged 1 commit into
mainfrom
feature-claude-prompt-hook

Conversation

@codeaholicguy

@codeaholicguy codeaholicguy commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Problem: Claude Code interactive prompts/tool calls are not written to the session JSONL, so they never reached Telegram.
  • Solution: Three-part implementation - a `PreToolUse` hook, a new `setup --agent claude` step, and timestamp-dedupe polling in the channel runner.

@codeaholicguy codeaholicguy force-pushed the feature-claude-prompt-hook branch from e0e6cec to 45747ea Compare June 29, 2026 14:39
@codeaholicguy codeaholicguy changed the title feat(channel): forward Claude approval prompts to Telegram via PreToolUse hook + PID guard feat(channel): forward Claude tool invocations to Telegram via PreToolUse hook Jun 29, 2026
@codeaholicguy codeaholicguy force-pushed the feature-claude-prompt-hook branch 7 times, most recently from 7c2e8d8 to d2dea0f Compare June 29, 2026 19:20
…lUse hook

Claude Code interactive prompts are not written to the session JSONL, so
they never reached Telegram. This adds a focused, agent-agnostic solution:

1. claude-prompt-hook.js — a CJS PreToolUse/Bash hook that overwrites
   ~/.ai-devkit/prompts/<session_id>.json on each tool invocation.

2. setup --agent claude — copies the hook to ~/.claude/hooks/ and merges
   a PreToolUse/Bash entry into ~/.claude/settings.json (idempotent).

3. startOutputPolling() — after forwarding JSONL messages each tick,
   reads the prompt store file and sends a "🔧 [Prompt]" message to
   Telegram when the entry's timestamp has changed. Deduplication is
   handled by tracking the last-seen timestamp; no PID-file or
   Claude-specific state is needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codeaholicguy codeaholicguy force-pushed the feature-claude-prompt-hook branch from d2dea0f to c13b333 Compare June 29, 2026 19:47
@codeaholicguy codeaholicguy merged commit 172ef94 into main Jun 29, 2026
7 checks passed
@codeaholicguy codeaholicguy deleted the feature-claude-prompt-hook branch June 29, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant