Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Claude Code agentをfile-based inboxで組織化した話

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for しお しお
May 26, 2026
25

Claude Code agentをfile-based inboxで組織化した話

5/26(火)StepByCode vol.18「私のAI活用法&はじめての登壇!2本立てLT会」 発表資料

Avatar for しお

しお

May 26, 2026

Transcript

  1. STEPBYCODE VOL.18 ・ "私のAI活用法" Claude Code agent を file-based inbox

    で 組織化した話 斎木 翔太 株式会社レボーン エンジニア 2026-05-26
  2. 自己紹介 StepByCode vol.18 / 2026-05-26 斎木 翔太 25 ・ 福岡県北九州市

    株式会社レボーン エンジニア ― 「におい」を測り・作り・届ける嗅覚 AI startup 言語 Kotlin Python TypeScript Dart / Flutter C (PSoC / STM32) インフラ Google Cloud (GKE) Docker ArgoCD GitHub Actions IoT PSoC 5LP STM32 Arduino UNO R3 / R4 WiFi Raspberry Pi 3 2020/11 株式会社レボーン アルバイト入社 2021/03 都立産業技術高等専門学校 卒業 2022/01 株式会社レボーン 正社員入社 2023/03 北九州事業所へ異動 2025/12 北九州 Tech カンファレンス 2025 コアスタッフ 2026/07 Kitakyushu Hardware Meetup #1 実施予定 X: @NaCl_5alt 斎木翔太 / 株式会社レボーン 2 / 11 BF ++++[>++++<-]>[<++++>-]++++[<++++>-]<--.-----.------.++.>++++[>+++ +<-]>[<++>-]<.>>++++[<<<---->>>-]<<<---.>.>++++[<<++++++++++>>-]<<---- -.>>++[<<---->>-]<<.>.
  3. 複数 chat 並行 = user が手動 orchestrator PJ 別に chat

    を分けるのは普通。でも、こうなる。 症状 痛み chat 間で context が共有されない PJ 横断の情報を user が 手動でコピペ 認知負荷が user に集中 全 chat の状態を 脳内 RAM で保持 new chat の都度 context 復元 自動要約で詳細が抜け落ち・前提を毎回再投入 性能 ≠ 並列度 モデルを上げても判断する user は 1 人 — 承認 queue が直列化 「AI worker を増やす」より「AI 組織を作る」が本質。 StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 3 / 11
  4. Claude をもっと使い倒したい 乗り換えではなく、Claude Code 自体を組織化基盤として極める。 ✓ 複数 orchestrator + 長期

    context 持続 ― Anthropic 公式は 1 lead only ✓ user が随時介入できる中庸 ― Devin 等の完全自律ではない ✓ ファイルベースで軽量 ― claude.app 単体で完結・既存環境を磨くだけ hook + state file だけで全部いける説 → Claude を活用しつつ自作した。 StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 4 / 11
  5. Anthropic 公式 agent teams の制約を、どう越えるか 公式 spec は experimental +

    明示的な制約あり。 "One team at a time" / "No nested teams" / "Lead is fixed" ― Anthropic Claude Code Docs ・ Agent teams › Limitations code.claude.com/docs/en/agent-teams#limitations 軸 Anthropic 公式 本実装 orchestrator 1 つのみ 複数並立 (federation) worker 階層 flat (lead 直下のみ・nested 不可) 各 orchestrator 配下に独立階層 GUI MCP ❌ CLI ベース・別途 Browser MCP 要 Chrome MCP / Claude in Chrome 可 StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 5 / 11
  6. 我々の解: dispatch system コアな仕組みは 4 つだけ。 シンプル・OSS 不要・既存 Claude Code

    に hook を足すだけ。 StepByCode vol.18 / 2026-05-26 自作 file-based inbox (JSONL) — 1 worker = 1 file .claude/state/orchestrator/inbox/<alias>.jsonl 01 Claude Code 上で動作・script は自作 persistent Monitor — inbox JSONL の更新時刻 (mtime) を 2 秒間隔で監視・検知 したら event 発火 → auto-pickup 02 仕組みは Claude Code 既存・hook script は自作 UserPromptSubmit hook — user type 時に pending を prompt 先頭へ inject 03 claude.app 既存機能を活用 claude.app の tab = 1 agent — 独立可視・transcript 個別閲覧可 04 斎木翔太 / 株式会社レボーン 6 / 11
  7. 構造図: tab ⇄ file ⇄ tab claude.app tab #1 ・

    OrchestratorA OrchestratorA Claude session Monitor UserPromptSubmit hook .claude/state/orchestrator/ 両 tab 共有 inbox/ WorkerA.jsonl inbox/ OrchestratorA.jsonl sessions.json claude.app tab #2 ・ WorkerA WorkerA Claude session Monitor UserPromptSubmit hook ① Orchestrator が /dispatch → JSONL に append ② 相手 Monitor が mtime を検知 (2s polling) ③ event 発火 → auto-pickup → Worker が処理 ④〜⑥ 逆向きに返信 — 同じ経路で Orchestrator へ StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 7 / 11
  8. 実稼働: 本日の dashboard 出力 38 累計 agent (registered) 7 🟢

    ALIVE (現在稼働) 1 うち orchestrator 59 直近 24h ・ agent 間 message # 📡 dispatch dashboard (2026-05-26T18:20) ## 🟢 ALIVE orchestrator alias ppid last orch-A 6462 2h ## 📊 24h dispatch volume (top 5) alias 24h count state orch-B 25 🔴 worker-A 14 🟢 orch-A 11 🟢 orch-C 5 🔴 worker-B 4 🔴 StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 8 / 11
  9. dispatch だけでは足りなかった — 自走化 3 layer 並列化はできた。でも user が judgement

    に呼ばれ続けた。 user を呼ぶ原因 どう対応したか claude.app restart で worker 全死 → 都度 手動 register SessionStart hook で worker を auto 復旧 orch が「これ user 承認要る?」で毎度 ping 判断ルール表を作成・ 「聞く / 聞かない」を事前定義 同じ user preference を毎度確認 判断履歴メモを蓄積・2 回目以降 auto-apply StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 9 / 11
  10. 展望: 次に磨きたい層 → 多 model federation ― Sonnet / Haiku を

    worker に振り分けてコスト最適化 → 他 vendor agent との連邦化 ― ローカル LLM / Codex / Gemini など Claude 以外も worker として運 用 → 判断ルール表の動的学習 ― user 介入 pattern から「実は聞かなくて良かった」を自動更新 → 設計 docs と最小実装の公開 ― 「1 日で作れる AI org」テンプレ化 実装は揃った。次は「どう運用するか」の設計の磨き込み。 StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 10 / 11
  11. まとめ Claude を「並列 chat」から「組織」へ。 ✓ file-based inbox + persistent Monitor

    + hook で軽量実装 ✓ claude.app の tab 構造を multi-orchestrator として活用 ✓ 実装より「どう運用するか」の磨き込みが本体 🙏 質問・突っ込み大歓迎 X: @NaCl_5alt StepByCode vol.18 / 2026-05-26 斎木翔太 / 株式会社レボーン 11 / 11