til/applied-sciences/engineering/orchestration-stack
orchestration-stack.mdupdated 2026-07-163947 words
ダブルクリックで英日反転
Applied Sciences · Engineering

Launching Claude Code from an Orchestration Layer

EN

Running `claude` manually per session leads to stale settings, repeated role decisions, and a disconnected task queue. The fix: launch Claude Code as a child process from an external orchestrator.

Ecosystem Tools

  • obra/superpowers — skill registry; `superpowers install` syncs skills into `.claude/skills/`
  • claude-code-beans — plugin pack; distributes skills/hooks/commands as a bundle
  • ECC (Everything Claude Code) — paradigm for running both business and dev in one Claude Code
  • paperclip (HT) — 9 sub-agents converging on a single goal via specialised division of labour

Launch Layer Structure

  • Scheduler/cron → Orchestrator (reads Notion Tasks DB) → `claude --name <id> --add-dir <repo>`
  • Orchestrator runs `superpowers update` or `beans sync` before each launch to keep `.claude/` fresh
  • `.claude/` holds skills, agents, commands, hooks, and MCP — all ready on startup

Setup Checklist

  • Version-control `.claude/` per repo; HT-wide rules in `~/src/ht/CLAUDE.md` (hierarchical load)
  • Subscribe to a skill registry for OSS skills; write custom skills in `.claude/skills/<name>/SKILL.md`
  • Four key hooks: SessionStart (read MEMORY), PostToolUse (prettier), Stop (auto-commit), PreCompact (re-inject CLAUDE.md)
  • Centralise MCP in parent-dir `.mcp.json`; each repo opts in via `enabledMcpjsonServers`

Anti-Patterns

  • Updating `.claude/` by hand — goes stale; route updates through registry install commands
  • Single-session monolith — dirties the main context; offload to sub-agents / worktrees
  • Orchestrator inside Claude Code — if the parent dies, everything stops; keep it external
  • Per-repo MCP definitions — credentials scatter; consolidate in the parent directory
Treat Claude Code as a child process, not a REPL: version-control `.claude/`, sync skills via a registry, and let an external scheduler trigger sessions.
Applied Sciences · Engineering

オーケストレーター(上位制御プロセス)から​Claude Codeを​起動する

JP

毎回​手動で​ `claude` を​起動すると、​設定の​陳腐化・役割再決定の​繰り返し・タスクキューの​断絶が​起きる。​解決策は、​外部オーケストレーターから​子プロセスと​して​ Claude Code を​起動する​ことに​ある。

エコシステムの​主要ツール

  • obra/superpowers — スキルレジストリ​(技能の​配布・管理基盤)。​`superpowers install` で​ `.claude/skills/` を​最新化
  • claude-code-beans — プラグインパック。​スキル/フック/コマンドを​まとめて​配布
  • ECC​(Everything Claude Code)​— 経営と​開発を​一つの​ Claude Code で​賄う​パラダイム(​思想的な​方​向性)
  • paperclip​(HT内製)​— 専門分業した​9サブエージェントが​一つの​ゴールに​収束する​事例

起動レイヤーの​構造

  • スケジューラ/cron → オーケストレーター​(Notion Tasks DB を​読む)​→ `claude --name <id> --add-dir <repo>`
  • 起動前に​ `superpowers update` や​ `beans sync` を​実行し `.claude/` を​常に​最新に​保つ
  • `.claude/` に​スキル・エージェント・コマンド・フック・MCPを​揃えた​状態で​起動する

セットアップの​手順

  • `.claude/` を​リポジトリごと​ git 管理。​HT全社​共通ルールは​ `~/src/ht/CLAUDE.md` に​(階層的自動読込)
  • スキルレジストリに​登録して​OSSスキルを​取得。​独自スキルは​ `.claude/skills/<name>/SKILL.md` に​作成
  • 4つの​必須フック: SessionStart​(MEMORY読込)​・PostToolUse​(prettier)​・Stop​(自動コミット)​・PreCompact​(CLAUDE.md再注入)
  • MCPは​親ディレクトリの​ `.mcp.json` に​集約し、​各リポは​ `enabledMcpjsonServers` で​必要な​ものだけ​有効化

避けるべきアンチパターン

  • `.claude/` を​手動更新 → すぐ​陳腐化する。​レジストリの​インストールコマンド経由で​管理する
  • 全作業を​単一セッションに​詰め込む → メインコンテキストが​汚染される。​サブエージェント/worktreeに​切り出す
  • オーケストレーターを​ Claude Code 内部に​置く​ → 親プロセスが​死ぬと​全停止。​cron等の​外部に​置く
  • MCPを​リポジトリごとに​定義する​ → 認証情報が​散乱する。​親ディレクトリに​集約する
Claude Code は​REPL​(対話型シェル)ではなく​子プロセスと​して​扱う。​`.claude/` を​バージョン管理し、​レジストリで​スキルを​同期し、​外部​スケジューラが​セッションを​起動する​設計が​正解。
148 notestil