musingfox/cc-plugins/tree/main/calendar
calendar
프롬프트 위에 다가오는 Google Calendar 이벤트를 표시하는 Claude Mod(function-hooks 모듈)입니다. /cal로 전환하고 /cal N으로 1–31일을 설정합니다.
이 mod 소개
calendar은 function-hooks 모듈(hooks/register.ts)인 Claude Mod로, Claude Code 세션 안에 다가오는 Google Calendar 이벤트를 표시합니다. 표시되는 내용은 대화에 들어가지 않습니다. /cal로 프롬프트 위의 밴드를 전환하면 다음 7일의 이벤트를 나열하고, /cal N으로 다음 N일(1–31)을 나열하면서 밴드를 켜고 N을 기억합니다. Claude Mods가 기본으로 켜지는 Claude Code 2.1.287 이상이 필요합니다. 이벤트는 claude.ai Google Calendar connector를 통해 $.mcp.call로 가져옵니다(list_calendars 1회, 이후 각 캘린더마다 list_events 1회). 플러그인 옵션 exclude_calendars에 지정한 캘린더는 제외합니다. 밴드를 켤 때, 켜진 상태로 세션이 시작될 때, 켜져 있는 동안 15분마다 가져옵니다. 최초 가져오기에 실패하면 30초 간격으로 최대 10회 재시도합니다. 밴드는 이벤트 하나를 한 줄에 가장 가까운 순서로 표시하며, 컴퓨터의 시간대와 날짜 라벨(오늘/내일/MM/DD weekday), 종일·시간 지정 범위, 현재 또는 다음 이벤트의 굵은 녹색 강조와 녹색 카운트다운, 흐리게 표시한 @location, Google Calendar·이벤트·Maps 검색으로 가는 OSC 8 링크를 포함합니다. 흐린 알림 줄은 가져오는 중, 사용할 수 없음, 오래된 데이터, 비어 있음 상태를 보고하고, 추가 이벤트는 '… N more'로 접습니다. 밴드는 다른 mod의 밴드와 공간을 공유하며 켜기/끄기 상태와 N을 플러그인 저장소에 보존합니다. 테스트는 합성 fixture로 'claude plugin test calendar'를 실행합니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add musingfox/cc-plugins claude plugin install calendar
원문 / README
calendar
Shows upcoming Google Calendar events inside a Claude Code session, as one Claude Mod
(a function-hooks module, hooks/register.ts). Nothing it shows enters the conversation.
/cal: toggles a band above the prompt listing the next 7 days of events./cal N: lists the next N days (1–31), turns the band on, and remembers N.
Needs Claude Code 2.1.287 or later, where Claude Mods are on by default. Built and tested against Claude Code 2.1.287.
Where events come from
Every fetch goes through the claude.ai Google Calendar connector with $.mcp.call: one
list_calendars, then one list_events per calendar for the window from now to N days
ahead. Every calendar you can see is listed except those named in the plugin option
exclude_calendars (names or ids). Claude Code asks for it when the plugin is enabled; a
list option has no /config row, so change it later under
pluginConfigs["calendar@<marketplace>"].options in ~/.claude/settings.json.
Events are fetched when /cal turns the band on, at session start when the band was left
on, and every 15 minutes while it is on. Nothing is fetched while the band is off. A fetch
never blocks a prompt or a tool call. The claude.ai connectors are still connecting when a
session starts, so a failed fetch with nothing yet on screen is retried every 30 s, at most
10 times.
$.mcp.call asks no permission. Any installed Claude Mod can read your mail and
calendar through a connected claude.ai connector this way. Install third-party mods with
that in mind.
The band
One line per event, soonest first, in the machine's time zone (TZ when set):
今天 14:00–15:00 Dentist @Clinic 還有 4h
明天 全天 中秋節
09/27 日 22:00–09/28 01:30 Trip
09/28 一 18:00–21:00 Dinner @Home
- The day reads
今天,明天, orMM/DD <weekday>, in blue. - An all-day event reads
全天; a timed one its start and end, with the end's date when it ends on another day. - The first timed event (the one under way, or the next to start) has its title in bold
green. Today's timed events end in a green countdown,
還有 3h 45m, or進行中once started; the band redraws every minute so it keeps moving. @<location>follows the title, dimmed, when the event has one.- Three parts are links (OSC 8 on the terminal; a terminal without it prints the URL dimmed after the text): the day opens that day in Google Calendar, the title opens the event, and the location opens a Google Maps search for it.
- Cancelled events are left out, and an event shared into several calendars shows once.
- A dim notice line says
Fetching calendar events,Unavailable: <reason>before any fetch succeeded,Stale: <reason>; showing data from <age> agoafter a failed one, orNo events in the next N days. - More events than the band holds end in a dim
… N more. Every line is cut at the band's width.
The band shares its space with any band another mod draws there (/quota, for one) instead of hiding it.
The band's on/off state and N are kept in the plugin's store and read at session start.
Tests
claude plugin test calendar
The fixtures in tests/fixtures/world.ts are synthetic; no real calendar data belongs in
this repo.
