Skip to content

v1.2.1 — Universal terminals and Ghostty support, eight new hooks, rich /status

Choose a tag to compare

@jsayubi jsayubi released this 14 Apr 10:56
· 1 commit to master since this release

The biggest CCGram release yet. Universal terminal support, Ghostty integration, eight new hook events, a completely rewritten /status, and a sweep of critical hook-format fixes that were silently breaking question answering.

v1.2.1 note: No code changes from v1.2.0. README was refreshed to cover the new features (universal terminal support, Ghostty backend, rich /status, deep links, the eight new hooks, the new src/utils/ modules) and the patch bump publishes that refreshed README to the npm package page.

Headline features

  • Direct question answering — no more keystroke injection. AskUserQuestion answers now flow back to Claude Code through the updatedInput hook output, so Telegram answers land in any terminal: tmux, Ghostty, bare zsh, screen, anything. The AppleScript / tmux send-keys path for questions is gone.
  • Ghostty integration. Full Ghostty support via AppleScript — auto-detected when TERM_PROGRAM=ghostty. Keystroke injection, tab focus, command routing all work the same as tmux. macOS only.
  • Rich /status command. Completely rewritten using Claude Code's transcript JSONL. Now shows model, Claude Code version, git branch, session ID + slug, context window usage with auto-detected 1M mode, rate limit + reset time, last activity timestamp, and the last assistant message snippet. Works for every terminal type.
  • Deep links. New /link <prompt> command generates claude-cli://open?q=... URLs that open Claude Code anywhere with your prompt pre-filled.

Eight new hook events

Hook What it gives you
PermissionDenied Telegram retry button when auto-mode blocks a tool
PreCompact Block context compaction with one tap
PostCompact Confirms compaction completed, with token savings
Elicitation Forwards MCP server input requests to Telegram (schema-aware, per-field)
StopFailure Instant alerts on API errors and rate limits
TaskCreated Notify when Claude creates a task
CwdChanged Track when Claude changes working directory
InstructionsLoaded Debug aid for CLAUDE.md / rules loading

New Telegram commands

  • /link <prompt> — generate a Claude Code deep link
  • /effort [workspace] low|medium|high — set thinking effort
  • /model [workspace] <model> — switch model (sonnet, opus, haiku)

Permission improvements

  • Defer button on permission prompts pauses the session for async approval
  • Session title support in permission and notification messages

Rate limit visibility

  • Hook payloads' rate_limits field extracted and stored per-session
  • /status displays current usage, percent, and reset time

Critical fixes

Four hook scripts had silently-malformed stdout shapes that Claude Code was ignoring without any error log. All audited against the official docs and corrected:

  • question-notify.ts — was outputting an invented format. Now correctly echoes the original questions array plus a separate answers map keyed by question text. Symptom was "I answered in Telegram, then the question also popped up in the terminal."
  • pre-compact-notify.ts — decision: "block" was nested inside hookSpecificOutput. Now at top level. Block button finally blocks compaction.
  • permission-denied-notify.ts — was missing required hookEventName. Retry button now actually retries.
  • elicitation-notify.ts — had a completely invented shape. Now parses MCP requested_schema.properties, prompts per field, emits proper {action: "accept", content: {...}}.

Other improvements

  • Removed stale !pending.tmuxSession check from callback handlers (was dropping responses in bare-terminal sessions)
  • enhanced-hook-notify.ts uses last_assistant_message directly from hook payloads (Claude Code v2.1.47+)
  • Hook if conditions (Claude Code v2.1.85+) supported in setup.ts
  • Test suite grew from 84 → 120 tests across 6 suites

Documentation

  • README rewritten to cover all v1.2.0 features: universal terminal support, Ghostty backend, rich /status, deep links, the eight new hooks
  • Architecture diagram lists permission-denied-notify, pre-compact-notify, elicitation-notify, plus the new src/utils/ modules (transcript-reader, deep-link, ghostty-session-manager)
  • FAQ "Do I need tmux?" rewritten to cover all three injection backends
  • Test counts updated (84 → 120 tests across 6 suites)

Upgrade

npx @jsayubi/ccgram@latest init

The wizard merges the new hook entries into ~/.claude/settings.json and refreshes ~/.ccgram/dist/. Existing config (.env, session map, project history) is preserved.

Full changelog: v1.1.1...v1.2.1