記事一覧へ
## Claude Codeを24時間365日の開発チームに変えた方法
私は3ヶ月間、毎回同じ説明から始めていた。「React + TypeScript + Postgres + Vercelで構築している…」。毎日、毎セッション。測定したら1日47分の無駄だった。
仕組みを全部作り直したら変わった。Claudeは私が過去に下したすべての意思決定を覚えるようになった。眠っている間に5つのエージェントが並列で動く。コーディング規約は自動で適用される。毎セッションごとにゼロにリセットされる代わりに、使うごとに賢くなっていく。
これはすべて月$20のサブスクで動いている。
---
## Part 1: CLAUDE.md — すべての基盤となるファイル
90%のユーザーがスキップするか、間違って書いているファイルだ。
CLAUDE.mdはプロジェクトルートに置く。Claude Codeが毎セッション開始時に読む。一度だけ「自分は何者で、何を構築していて、どう動いてほしいか」を伝える方法だ。
**ほとんどの人が書くもの(無意味):**
```
# CLAUDE.md
これはReactアプリです。親切にしてください。
```
**実際に機能するもの:**
```markdown
## project
- stack: Next.js 14, TypeScript, Tailwind, Postgres via Prisma
- deployed on Vercel, stagingブランチは自動デプロイ
- monorepo: /apps/web, /apps/api, /packages/shared
## conventions
- コンポーネントはPascalCase
- APIルートは { data, error } 形式を返す
- デフォルトエクスポートなし(ページを除く)
- テストはソースファイルの隣に *.test.ts
- コミットはConventional Commits(feat:, fix:, chore:)
## architecture decisions
- prisma over drizzle(2024年12月): 型安全性優先
- zustand over redux(2025年1月): ボイラープレート削減
- auth via clerk: チームサイズに合ったDX
## current focus
- Stripe CheckoutからStripe Elementsへの支払い移行中
- /dashboard のパフォーマンス監査(目標: LCP < 2秒)
## rules
- 3ファイル超の一括編集前に必ずプランを見せる
- 新テストを書く前に既存テストを実行する
- 5ステップ超のタスクは最初にプランドキュメントを作成する
```
これで毎セッション冒頭の5分間説明が不要になる。Claudeはスタック・規約・アーキテクチャ決定・現在の作業をすでに知っている。
ただしCLAUDE.mdは静的で、学習も成長もしない。次の層が必要だ。
---
## Part 2: 永続メモリ — 忘れないセットアップ
デフォルトでClaude Codeはセッション間でメモリがゼロ。毎回同じコンテキストを説明し、同じ修正をし、同じ解決策を再発見する。
3つのツールを組み合わせて解決した:
**Obsidianをナレッジベースとして使う**
開発作業専用のObsidian vaultをセットアップした。構造:
```
/vault
/decisions — コンテキスト付きのすべてのアーキテクチャ決定
/errors — 遭遇したバグと解決方法
/patterns — コードベースで機能するパターン
/sessions — 毎日何が起きたかのサマリ
/stack — 使用するすべてのツールのドキュメント
Memory.md — 自分自身、構築しているもの、好み
index.md — vaultのすべてのマスターインデックス
```
Andrej KarpathyのLLM wikiコンセプトから着想: Claude がセッションごとにゼロから再発見する代わりに、時間をかけて積み重なる永続wikiwikiから読み込む。
**claude-mem でセッション持続性を実現**
長期メモリを圧縮で追加。セッション終了時に主要な決定とコンテキストを圧縮して次のセッションに引き継ぐ。
**サブコンシャスエージェント**
バックグラウンドで動くエージェントがセッションを監視し、ファイルを読み込み、何もしなくても時間をかけてメモリを構築する。まるでバックで全部メモを取っているジュニア開発者がいるようだ。
結果: 月曜日にClaude Codeを開くと、金曜日に支払いWebhookの競合状態をデバッグしていたこと、ポーリングからWebSocketへの切り替えを決めたこと、テストの更新が必要なことをすでに知っている。
---
## Part 3: スキル — ジェネラリストをスペシャリストに変える
デフォルトのClaude Codeはジェネラリストだ。何でもできるが、特別に得意なことはない。スキルがそれを変える。
**まず全員がインストールすべきスキル: superpowers**
```
/plugin install superpowers@claude-plugins-official
```
GitHub 17万+スター。Anthropic公式プラグインマーケットプレイス掲載。Claude Codeを「言われたらコードを書く」ツールから完全な開発メソドロジーへ変換する。
ブレインストーミング → スペック → プラン → TDD → 実装 → レビュー というワークフローを強制する。
**追加したスペシャリストスキル:**
- **Trail of Bits セキュリティスキル**: 実際のセキュリティエンジニアが構築したリアルなセキュリティ監査ワークフロー。すべてのPRが自動スキャンされる
- **Anthropic公式スキル**: PDF/DOCX/XLSX生成、データ分析
- **tdd-guard**: テストをスキップするコミットを自動的にブロック。テストなしのコードは出荷できない
スキルはいくつでも積み重ねられる。競合しない。一つずつClaudeをある作業に特化させ、組み合わせるとワークフローを知るスペシャリストが生まれる。
---
## Part 4: サブエージェント — 1つのClaudeが5つになる
1つのClaude Codeセッションは同時に1つしかできない。機能開発 → コードレビュー → バグ修正 → ドキュメントを順番にやると、4つ目の時点でコンテキストが汚染されている。
サブエージェントで作業を分割する:
- **architect**: 高レベルの設計決定、スペック作成、実装計画。コードは絶対に触れない
- **coder**: architectのプランに従ってコードを書く。フルツールアクセス
- **reviewer**: セキュリティファーストの視点でPRを読む。問題をフラグ付け
- **tester**: テストを書いて実行する。TDDを徹底。tdd-guardと連携
- **ops**: デプロイ、CI/CD、インフラ管理。ビルド監視と失敗修正
各エージェントは専用のCLAUDE.mdを持ち、ツール権限とコンテキスト境界が決まっている。coderはデプロイ設定を見ない。reviewerはコードを書かない。クリーンな分離だ。
---
## Part 5: フック & スラッシュコマンド — 繰り返し作業を自動化
同じ指示を3回目に入力した時はスラッシュコマンドの合図だ:
- `/fix-issue 456`: GitHubイシューを読み、ブランチを作り、テスト付きの修正を書き、PRを開く
- `/review`: セキュリティチェック・テストカバレッジ分析・コード品質スコアリングでPRをレビュー
- `/deploy staging`: opsエージェントを通じてデプロイパイプラインを実行
フックはさらに進んで、特定の瞬間に自動でトリガーする:
- **pre-commit hook**: コミット前にtdd-guardがテストの存在とパスを確認
- **session start hook**: Obsidianからメモリをロード、最近のセッションログを読み、コンテキストをプライム
- **pre-push hook**: コードがリモートに届く前にセキュリティレビューを自動実行
自分のルールを毎回Claudeに思い出させる必要がなくなる。ルールが自己適用するから。
---
## Part 6: オーケストレーション — エージェントが寝ている間も動く
これが最後のピースだ。$20/月のサブスクを開発チームを持つ感覚に変えるもの。
**claude-squad**: 複数のAIエージェントを並列で実行するために特化したターミナルマルチプレクサ。各エージェントはgit worktreeで独立したワークスペースを持つ。
```bash
brew install claude-squad
cs
```
ターミナルを閉じても動き続ける。朝起きたら完成したPRが待っている。
**私の夜のワークフロー:**
1. claude-squadを開いて3セッションを起動:
- エージェント1: 「リポジトリの'bug'ラベルの全イシューを修正して」
- エージェント2: 「/apps/api/src/services/ のテストが抜けているところを書いて」
- エージェント3: 「ダッシュボードコンポーネントを新しいデザイントークンに対応するようリファクタリングして」
2. 信頼できるタスクは自動承認モード(cs -y)を有効化
3. ラップトップを閉じて寝る
4. 朝: 3つのPRが待っている。それぞれ独立したブランチ、競合なし、テスト通過済み
---
## Part 7: フルスタックとコスト
- Layer 1: CLAUDE.md — 無料(ただのファイル)
- Layer 2: Obsidian + claude-mem — 無料(Obsidianは無料、リポジトリはオープンソース)
- Layer 3: superpowers + スキル — 無料(全てオープンソース、MITライセンス)
- Layer 4: サブエージェント — 無料(Markdownファイル)
- Layer 5: フック + コマンド — 無料(全てオープンソース)
- Layer 6: claude-squad — 無料(オープンソース)
**インフラコスト合計: $0**
**Claude Codeサブスクリプション: $20/月(Proプラン)**
このリストのすべてはオープンソース。支払うのはClaudeサブスクリプションのみ。
---
## どこから始めるか
全6層を今日から構築する必要はない。まずこの3つから始めよう(半日でセットアップできる):
1. プロジェクトのCLAUDE.mdを正しく書く
2. Obsidian vaultをセットアップしてMemory.mdを作成する
3. superpowersをインストールする
この仕組みを構築するのに3ヶ月かかった。あなたは半日でできる。

claude-workflowharness-designagent-ops
Claude Codeを24時間365日の開発チームに変える6層セットアップ完全ガイド
♥ 210↻ 28
原文を表示 / Show original
How I Turned My Claude Code Into 24/7 Dev Team (Full Guide + Repos)
most people use claude code like a chatbot. i turned mine into a 24/7 dev team that remembers everything and gets smarter every session
bookmark this so as not to forget
i mass used claude code wrong for 3 months
every single session started the same way. "i'm building a react app with typescript, using postgres, deployed on vercel, here's my folder structure..."
the same explanation. over and over. every day
then i'd write the same prompts manually. "review this code." "write tests for this." "fix the CI." typing paragraphs into a terminal that forgot everything the moment i closed it
i tracked it one week. 47 minutes a day wasted on repeating myself to a tool that should already know me
then i rebuilt my entire setup from scratch
now claude code remembers every decision i've ever made. it runs 5 agents in parallel while i sleep. it enforces my coding standards automatically without me asking. and it gets smarter with every session instead of resetting to zero
the whole thing runs on a $20/mo subscription
here's exactly how i built it, step by step
/part 1 - CLAUDE.md: the foundation that changes everything
this is the file that 90% of users either skip or write wrong
CLAUDE.md lives in your project root. claude code reads it at the start of every session. it's your way of telling claude who you are, what you're building, and how you want things done - once, permanently
most people write something like "this is a react app, please be helpful"
that's useless
here's what actually works:
# CLAUDE.md
## project
- stack: next.js 14, typescript, tailwind, postgres via prisma
- deployed on vercel, staging branch auto-deploys
- monorepo: /apps/web, /apps/api, /packages/shared
## conventions
- all components in PascalCase
- API routes return { data, error } format
- no default exports except pages
- tests live next to source files, named *.test.ts
- commits follow conventional commits (feat:, fix:, chore:)
## architecture decisions
- chose prisma over drizzle (dec 2024): type safety priority
- chose zustand over redux (jan 2025): less boilerplate
- auth via clerk, not next-auth: better DX for our team size
## current focus
- migrating payment system from stripe checkout to stripe elements
- performance audit on /dashboard (target: LCP < 2s)
## rules
- never mass edit more than 3 files without showing me the plan first
- always run existing tests before writing new ones
- if a task takes more than 5 steps, create a plan document first
the difference is night and day. instead of spending the first 5 minutes of every session explaining your project, claude already knows your stack, your conventions, your architecture decisions, and what you're currently working on
but this is just the beginning. CLAUDE.md is static. it doesn't learn. it doesn't grow. for that you need the next layer
/part 2 - persistent memory: the setup that never forgets
this is the part that changed everything for me
by default, claude code has zero memory between sessions. every conversation starts from scratch. you explain the same context, make the same corrections, re-discover the same solutions
i fixed this with three tools working together
how memory flows between sessions
obsidian as the knowledge base
i set up an obsidian vault specifically for my dev work. not notes. not bookmarks. a structured wiki that claude code reads and writes to
the structure:
/vault
/decisions — every architecture decision with context
/errors — bugs we hit and how we fixed them
/patterns — code patterns that work in our codebase
/sessions — summaries of what happened each day
/stack — documentation for every tool we use
Memory.md — who i am, what i'm building, my preferences
index.md — master index of everything in the vault
the idea comes from andrej karpathy's LLM wiki concept - instead of claude re-discovering knowledge from scratch every session, it reads from a persistent wiki that compounds over time
https://github.com/karpathy/llm-wiki
claude-mem for session persistence
claude-mem adds long-term memory via compression. at the end of each session, it compresses the key decisions and context into a persistent store that carries over to the next session
https://github.com/thedotmack/claude-mem
the subconscious agent
this one is wild. claude-subconscious runs a background agent that watches your sessions, reads your files, and builds memory over time without you doing anything
it's like having a junior dev sitting behind you, taking notes on everything you do
https://github.com/0xfurai/claude-subconscious
the result: i open claude code on monday morning, and it already knows that on friday i was debugging a race condition in the payment webhook, that i decided to switch from polling to websockets, and that i still need to update the tests
no explanation needed. it just knows
/part 3 - skills: turning a generalist into a specialist
out of the box, claude code is a generalist. it can do everything, but nothing exceptionally well
skills change that. they're markdown files that teach claude how to perform specific tasks the way you want them done
the first one everyone should install is superpowers
170k+ github stars. officially in the anthropic plugin marketplace. it transforms claude code from "write code when asked" into a complete development methodology
/plugin install superpowers@claude-plugins-official
what it actually does: instead of claude jumping straight into writing code, superpowers forces a workflow - brainstorm → spec → plan → TDD → implement → review. claude asks what you're really trying to build, writes a spec for your approval, creates a plan detailed enough for a junior dev to follow, then executes with test-driven development
https://github.com/obra/superpowers
after superpowers, i added specialized skills:
> trail of bits security skills - real security audit workflows, built by actual security engineers. every PR gets scanned for vulnerabilities before i even look at it
https://github.com/trailofbits/claude-code-skills
> anthropic's official skills - PDF, DOCX, XLSX generation, data analysis. the canonical reference that everything else builds on
https://github.com/anthropics/skills
> tdd-guard - automatically blocks commits that skip tests. claude literally can't ship untested code. it explains why the block happened and what tests are needed
https://github.com/nizos/tdd-guard
you can stack as many skills as you want. they don't conflict. each one makes claude better at one specific thing, and together they create a specialist that knows your exact workflow
/part 4 - subagents: one claude becomes five
this is where it gets serious
a single claude code session can only do one thing at a time. you ask it to write a feature, then review code, then fix a bug, then write docs - it does each one sequentially, and the context gets polluted by the time you reach task four
subagents split the work. instead of one overloaded claude, you get a team of specialists, each with its own context and a single responsibility
my setup uses five agents:
architect - handles high-level design decisions, writes specs, plans implementations. never touches code directly
coder - writes the actual code following the architect's plan. has full tool access
reviewer - reads every PR with a security-first mindset. flags issues, suggests improvements, checks test coverage
tester - writes and runs tests. enforces TDD. works closely with tdd-guard to ensure nothing ships without coverage
ops - handles deployment, CI/CD, infrastructure. monitors builds, fixes failures
each agent gets its own CLAUDE.md with specific instructions, tool permissions, and context boundaries. the coder never sees deployment configs. the reviewer never writes code. clean separation
for ready-made agent collections:
https://github.com/wshobson/agents - 25k+ stars, production subagents across strategy, dev, security, design
https://github.com/davepoon/claude-code-subagents-collection - 100+ agents, drop-in for any workflow
/part 5 - hooks and slash commands: automate the repetitive stuff
every time you catch yourself typing the same instruction for the third time, that's a slash command waiting to happen
i set up these and use them daily:
> /fix-issue 456 - reads the github issue, creates a branch, writes a fix with tests, opens a PR. one command instead of a 10-minute workflow
https://github.com/claude-commands/command-fix-issue
> /review - triggers the reviewer agent on the current PR with security checks, test coverage analysis, and code quality scoring
> /deploy staging - runs the full deployment pipeline through the ops agent
for a complete collection of 57 production-ready commands:
https://github.com/wshobson/commands - 1.7k+ stars, 15 workflows + 42 tools
hooks go even further. they trigger automatically at specific moments:
> pre-commit hook - tdd-guard checks that tests exist and pass before any commit goes through
> session start hook - loads memory from obsidian, reads recent session logs, primes context
> pre-push hook - security review runs automatically before code hits the remote
you stop reminding claude of your rules because the rules enforce themselves
/part 6 - orchestration: agents work while you sleep
this is the final piece. the thing that turns a $20/mo subscription into something that feels like having a dev team
claude-squad is a terminal multiplexer built specifically for running multiple AI agents in parallel. each agent gets its own isolated workspace via git worktrees, so they work on separate branches without conflicts
brew install claude-squad
cs
that's it. you get a TUI where you can launch, monitor, pause, and resume agents. close the terminal - they keep working. come back in the morning to finished pull requests
https://github.com/smtg-ai/claude-squad
my nightly workflow
before bed i open claude-squad and spin up three sessions:
agent 1: "fix all open issues labeled 'bug' in the repo"
agent 2: "write missing tests for /apps/api/src/services/"
agent 3: "refactor the dashboard components to use the new design tokens"
i enable auto-accept mode (cs -y) for trusted tasks, switch to plan mode for anything risky
i close the laptop. go to sleep
morning: three PRs waiting for review. each one on its own branch, no conflicts, tests passing
for more advanced orchestration:
https://github.com/ruvnet/claude-flow - 11.4k+ stars, enterprise-grade multi-agent orchestration with persistent memory
/part 7 - the full stack and what it costs
here's everything running together:
layer 1: CLAUDE.md — free (just a file)
layer 2: obsidian + claude-mem — free (obsidian is free, repos are open source)
layer 3: superpowers + skills — free (all open source, MIT license)
layer 4: subagents — free (markdown files)
layer 5: hooks + commands — free (all open source)
layer 6: claude-squad — free (open source)
total infrastructure cost: $0
claude code subscription: $20/mo (pro plan)
everything on this list is open source. the only thing you pay for is the claude subscription itself
and the ROI is not even close. i tracked my productivity for two weeks before and after this setup:
before vs after
the 47 minutes a day i was wasting? gone. but more importantly, the agents are now doing work at 3am that i used to do at 3pm
/bonus - where to start
you don't need to build all 6 layers today
start with these three. they take one afternoon:
one afternoon setup
this setup took me 3 months to figure out
you can build it in one afternoon
what does your claude code setup look like rn?
follow me @regent0x_ to study and research only fresh alpha
thx for reading. don't forget to bookmark this