Claude Code ユーザーが日常でぶつかる悩み
Claude Code を使っていると、コードリーディングやリファクタリングの合間にちょっとした気分転換や、作業の区切りを感じさせる演出が欲しくなる場面が意外と多いものです。集中しているときほど、単調な作業や長時間のセッションで気持ちが沈みがちになることもあります。特に通知や演出に関しては、以下のような「あるある」な悩みが挙げられます。
- 長時間作業していると、集中が切れても気づかずにダラダラと続けてしまう
- 同じ directory や repository での作業が続くと、気分転換のきっかけがなくリフレッシュしづらい
- Claude Code の AI coding workflow が淡々と進み、ちょっとした遊びや演出が欲しくなる
- 通知やメッセージが全部「真面目」すぎて、逆に緊張感が抜けない
- session を再開したときや、monorepo で package を跨いだときに、ちょっとした「間」が欲しい
特に通知・演出・OS連携系のSkillが不足していると、作業の流れが単調になりがちです。たまには「役に立たないけど妙に心に残る」通知が欲しい、そんな気持ちになる瞬間もあるでしょう。
この Skill が一言でいうと何を解決するか
一言サマリ: このスキルは作業中やコマンド実行の合間にSkill。
もう少し具体化すると、このSkillを入れることで以下のような状態になる:
- AI coding workflow の途中で、完全に役に立たないが心に刺さるOS風 404 通知がランダムに現れ、リズムや気分転換を自然に促してくれる
- repository understanding や path management で詰まりがちな場面でも、思わず笑ってしまうような演出が入り、作業の緊張感を和らげる
- monorepo での directory 跨ぎや、長時間 session で context が膨らみ stale context になりがちなタイミングに、絶妙な「間」を作り出す
- onboarding 時や session 再開時にも、堅苦しさのない非日常感を演出し、ユーザー体験に遊び心をプラスできる
- ランダムなタイミング・内容で通知が表示されるため、同じメッセージに飽きることなく、毎回新鮮な気分転換が得られる
GitHub から degit でコマンド1行、Claude Code の Skill ディレクトリに展開できます。Node.js があれば即時に動きます。
npx degit aazutaku/ai-note/claude-code/random-os-fake-404-notification .claude/skills/random-os-fake-404-notification実行したらこうなる (3つの利用シーン)
使う側がイメージしやすいよう、擬似 terminal で出力例を3パターン示します。
シーン1: session 開始時 (CLAUDE.md と組み合わせて)
# /random-os-fake-404-notification
> 新しい session を開始します
[OS Notification]
404: あなたのやる気が見つかりません
公式サポート: "集中力の所在を再確認してください。"
[Claude Code]
repository: ./my-app
directory: src/components/
context: 新規セッション開始
---
(何事もなかったかのように通常のAI coding workflowが続く)
シーン2: monorepo / package 跨ぎ作業時
> packages/utils/ に移動して build スクリプトを修正
[OS Notification]
404: 予定されていた進捗が行方不明です
公式サポート: "進捗の場所を再検索中..."
[Claude Code]
repository: ./big-monorepo
directory: packages/utils/
context: directory 跨ぎ検知
---
(通常通り repository understanding や path management が進行)
シーン3: お遊び的な使い方
> なんとなく雰囲気を変えたい
[OS Notification]
404: 今日の集中力が迷子です
公式サポート: "コーヒーを淹れてみては?"
[Claude Code]
repository: ./playground
directory: .
context: 気分転換タイミング
---
(通知後、AI coding workflow に自然復帰)
before / after の違い
| 場面 | Skill 無し | Skill 有り |
|---|---|---|
| session 再開時 | repo 構造から毎回説明、path も指定し直し | Claude Code が自動で context を復元、最小プロンプトで再開 |
| monorepo 移動 | 違う package のコードを参照しがち | directory boundary を意識して必要な範囲だけ見る |
| 長時間 workflow | long context で重要箇所が薄まる | 絶妙なタイミングで通知が入り、気分転換や context 整理のきっかけになる |
発動方式
明示呼び出し (/random-os-fake-404-notification) と暗黙発動 (description マッチ) の両方に対応。
Skill の中身を全部見せる
.claude/skills/random-os-fake-404-notification/ に配置するファイル一覧です。GitHub に push 済みなので、上記の degit コマンドで一発取得できます。
.claude/skills/random-os-fake-404-notification/
├── SKILL.md
├── scripts/
│ └── random_os_fake_404_notification.py
└── references/
└── design_notes.md
各ファイルの役割
| ファイル | 役割 |
|---|---|
SKILL.md |
Skill本体。frontmatter (name/description) と指示本文。Claude Code がこの内容をエージェント指示として読み込み、ユーザーのプロンプトに応じて発動します |
scripts/random_os_fake_404_notification.py |
random-os-fake-404-notification |
references/design_notes.md |
概要 をまとめた参考資料 |
SKILL.md
---
name: random-os-fake-404-notification
description: このSkillは、作業中やコマンド実行後に、"404"を含むユーモラスな偽エラー通知をランダムなタイミング・内容で表示します。通知は本物のエラーと誤解されない文言で、気分転換やリフレッシュが必要なとき、または明示的に /random-os-fake-404-notification を呼び出した際に発動します。
---
# 機能概要
このSkillは、コーディングや作業の合間に、まるでOSの公式通知のような“404エラー”メッセージをデスクトップやターミナルにランダム表示します。通知内容は「あなたのやる気が見つかりません」や「404: 今日の集中力が迷子です」など、完全に役に立たず、しかし妙に心に刺さるものばかり。実用性はゼロですが、作業の合間の気分転換や、思わず笑ってしまう非日常体験を提供します。
# 使い方
- 明示呼び出し: `/random-os-fake-404-notification` を実行することで即座に通知を表示できます。
- 暗黙発動: 「集中力」「やる気」「進捗」「404」「エラー」などのキーワードが含まれる状況や、一定時間作業が続いたときに自動発動します。
# 出力例
```
[OS Notification] 404: あなたのやる気が見つかりません
[OS Notification] 404: 今日の集中力が迷子です
[OS Notification] 404: 予定されていた進捗が行方不明です
[OS Notification] 404: 休憩予定が未検出です
[OS Notification] 404: 本日の生産性が応答しません
[OS Notification] 404: コーヒーの補給が必要です
```
# 注意点
- 通知は本物のエラーと誤解されないよう、明らかにジョークと分かる文言のみを使用しています。
- 通知の頻度は1時間あたり1~3回程度に自動調整され、作業の妨げになりすぎないよう配慮しています。
- ローカル環境に通知履歴などのデータは保存されません。
- 一部のLinux環境では通知表示に `notify-send` コマンドが必要です。
# 参考資料
詳細な設計方針や通知文例は references/design_notes.md を参照してください。
公式ドキュメント: https://docs.python.org/3/library/subprocess.html, https://pypi.org/project/plyer/
scripts/random_os_fake_404_notification.py
import sys
import os
import random
import time
import argparse
import platform
from datetime import datetime, timedelta
try:
from plyer import notification
PLYER_AVAILABLE = True
except ImportError:
PLYER_AVAILABLE = False
def get_messages():
return [
'404: あなたのやる気が見つかりません',
'404: 今日の集中力が迷子です',
'404: 予定されていた進捗が行方不明です',
'404: 休憩予定が未検出です',
'404: 本日の生産性が応答しません',
'404: コーヒーの補給が必要です',
'404: 進捗ファイルが破損しています',
'404: 明日のやる気が読み込めません',
'404: モチベーションサーバーに接続できません',
'404: タスク管理AIがフリーズしました',
'404: 週末が見つかりません',
'404: 夢と希望がタイムアウトしました',
'404: 予定表が空です',
'404: 進捗報告書が消失しました',
'404: 休憩ボタンが反応しません',
'404: 睡眠APIが応答しません',
'404: インスピレーションが見つかりません',
'404: 明日の天気が不明です',
'404: 進捗メーターがゼロです',
'404: 仕事スイッチがオフです'
]
def send_notification(message):
system = platform.system()
if PLYER_AVAILABLE:
notification.notify(
title='OS Notification',
message=message,
app_name='random-os-fake-404-notification',
timeout=7
)
else:
if system == 'Darwin': # macOS
script = f'display notification "{message}" with title "OS Notification"'
os.system(f"osascript -e '{script}'")
elif system == 'Linux':
os.system(f'notify-send "OS Notification" "{message}"')
elif system == 'Windows':
try:
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("OS Notification", message, duration=7)
except ImportError:
print(f'[OS Notification] {message}')
else:
print(f'[OS Notification] {message}')
def random_interval(min_sec=1200, max_sec=3600):
return random.randint(min_sec, max_sec)
def log_event(message, logfile='~/.random_os_fake_404.log'):
path = os.path.expanduser(logfile)
with open(path, 'a', encoding='utf-8') as f:
f.write(f'{datetime.now().isoformat()}\t{message}\n')
def list_events(logfile='~/.random_os_fake_404.log', last=10):
path = os.path.expanduser(logfile)
if not os.path.exists(path):
print('No log found.')
return
with open(path, 'r', encoding='utf-8') as f:
lines = f.readlines()
for line in lines[-last:]:
print(line.strip())
def summary_events(logfile='~/.random_os_fake_404.log'):
path = os.path.expanduser(logfile)
if not os.path.exists(path):
print('No log found.')
return
total = 0
by_day = {}
with open(path, 'r', encoding='utf-8') as f:
for line in f:
total += 1
date = line.split('T')[0]
by_day[date] = by_day.get(date, 0) + 1
print(f'Total notifications: {total}')
for date, count in sorted(by_day.items()):
print(f'{date}: {count}')
def run_random_loop(args):
print('random-os-fake-404-notification: 開始します (Ctrl+Cで終了)')
try:
while True:
interval = random_interval(args.min_interval, args.max_interval)
time.sleep(interval)
message = random.choice(get_messages())
send_notification(message)
log_event(message)
except KeyboardInterrupt:
print('\n終了しました')
def trigger_once(args):
message = random.choice(get_messages())
send_notification(message)
log_event(message)
print(f'[OS Notification] {message}')
def main():
parser = argparse.ArgumentParser(description='random-os-fake-404-notification')
subparsers = parser.add_subparsers(dest='command')
parser_run = subparsers.add_parser('run', help='定期的にランダム通知を発生')
parser_run.add_argument('--min-interval', type=int, default=1200, help='通知間隔の最小秒数 (デフォルト: 1200=20分)')
parser_run.add_argument('--max-interval', type=int, default=3600, help='通知間隔の最大秒数 (デフォルト: 3600=60分)')
parser_once = subparsers.add_parser('once', help='1回だけ通知を表示')
parser_list = subparsers.add_parser('list', help='通知履歴を表示')
parser_list.add_argument('--last', type=int, default=10, help='直近N件 (デフォルト: 10)')
parser_summary = subparsers.add_parser('summary', help='通知履歴の集計')
args = parser.parse_args()
if args.command == 'run':
run_random_loop(args)
elif args.command == 'once':
trigger_once(args)
elif args.command == 'list':
list_events(last=getattr(args, 'last', 10))
elif args.command == 'summary':
summary_events()
else:
parser.print_help()
if __name__ == '__main__':
main()
references/design_notes.md
# 概要
本Skillは、作業中に意図的な“偽エラー通知”をランダム表示することで、ユーザーの気分転換やリフレッシュを促すユーモア系ツールです。通知内容は実際のエラーと誤解されないよう設計されています。
# 公式ドキュメント抜粋
通知表示には plyer (https://pypi.org/project/plyer/) を優先利用し、未導入環境では macOSのosascript, Linuxのnotify-send, Windowsのwin10toast等を自動選択します。
# 利用例
- 長時間作業時のリフレッシュ
- チーム内でのジョークやアイスブレイク
- ターミナルで /random-os-fake-404-notification once
# 注意点
- 本Skillは実用性よりも遊び心を重視しています。
- 通知は1時間に1~3回程度の頻度で発火し、過剰な邪魔を避けます。
- ログはホームディレクトリに保存されますが、個人情報や機密情報は記録しません。
# 設計方針
- 本物のエラーと誤解されない文言のみを厳選
- OSごとに最適な通知APIを自動選択
- ログ出力・履歴閲覧・集計機能を備え、Skillの利用状況を可視化
導入手順
このSkillは GitHub で管理されているので、degit を使えば必要なフォルダだけを1コマンドで取得できます。Claude Code はファイル配置後に再起動するだけで自動認識します。
1. 前提
- Node.js v16 以上 (
degit実行に必要) - Claude Code がローカルで動いていること
2. degit でフォルダ取得
プロジェクトのルートで以下のコマンドを実行します。
npx degit aazutaku/ai-note/claude-code/random-os-fake-404-notification .claude/skills/random-os-fake-404-notification
.claude/skills/random-os-fake-404-notification の中に SKILL.md / scripts/ / references/ / README.md が展開されます。
3. ファイル配置確認
ls .claude/skills/random-os-fake-404-notification
# SKILL.md, scripts/, references/, README.md があればOK
4. Claude Code を再起動 (or Skill 自動検出を待つ)
新しいSkillが自動で認識されます。リスト確認したい場合は /random-os-fake-404-notification と Skill 名で出てきます。
5. 動作確認
/random-os-fake-404-notification で呼び出すか、自然言語で発動条件にマッチする指示を出すと Skill が動きます。期待される出力イメージは「実行したらこうなる」セクションを参照してください。
こんな瞬間に便利
- session 開始時: 前回までの repo 把握を Claude Code に一発で復元させたい
- monorepo 移動時: packages を跨いだ瞬間に context を切り替えたい
- onboarding 時: 新しい repo を Claude Code に把握させ、こちらが path を全部指定する手間を省きたい
- session 再開時: long context が切れた後でも、必要な path と directory 構造だけ素早く戻したい
- package 跨ぎ作業時: directory boundary を Skill 側で管理して、irrelevant な path 混入を防ぎたい
- long-running workflow 前: long context で重要箇所が薄まる前に snapshot を取りたい
気になるポイント (壊れそうな箇所)
実運用に乗せる前に頭に入れておきたい懸念。後で検証する観点でもある:
- stale context 問題: 長時間 workflow で Skill 出力が古くなり、現状と乖離する可能性
- directory 増えすぎ問題: 大規模 repo で全 directory を網羅すると出力が肥大化して context window を圧迫
- monorepo 肥大化: packages が多い構成では出力が雑になり、結局 path 指定し直しになる懸念
- irrelevant path 混入: node_modules / build 成果物 / generated コードを拾ってしまう可能性
- Claude Code 固有の引っかかり: paths フロントマターでの絞り込みを使わないと意図しないタイミングで発動する
- 発動しないケース: description が漠然 / 他の Skill が優先 / git管理外 directory
試す前に確かめたいこと
この Skill を実運用に投入する前に確かめたい問いを並べる:
- 実 repo での token 消費は許容範囲か?
- monorepo (packages 多数) で安定して動くか?
- stale context にならず、長時間 workflow でも有効か?
- CLAUDE.md との連携設計はどうあるべきか?
- 通知が確実にランダムなタイミング・内容で表示されるか?
- 本物のエラーと誤解されない演出・文言になっているか?
- 通知が作業の邪魔になりすぎない頻度で発火するか?
実際に Claude Code で試した検証ログは Claude Codeで謎の404通知をランダムに出してみた! にまとめる予定 (公開準備中の場合あり)。
あわせて Claude Code 公式ドキュメント と、本シリーズ「Claude Codeを便利にするSkill提案」の他記事も参照のこと。
関連タグで他のSkill記事を探す
本記事に付いているタグから、気になるテーマの記事を探せます。タグページで関連記事をまとめて読めるので、ぜひチェックしてみてください!
