opc-architecture
Guidance on OPC architecture for orchestrating parallel Claude Code instances.
Install
mkdir -p .claude/skills/opc-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2712" && unzip -o skill.zip -d .claude/skills/opc-architecture && rm skill.zipInstalls to .claude/skills/opc-architecture
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
OPC Architecture UnderstandingKey capabilities
- →Intercept Claude Code events via TypeScript hooks
- →Load custom prompts as skills
- →Coordinate child Claude Code processes via subprocess
- →Manage agent state using a PostgreSQL database
- →Broadcast task completion status between instances
How it works
Hooks intercept Claude Code tool usage to spawn independent child processes, which coordinate their state and task progress through a shared PostgreSQL database.
Inputs & outputs
When to use opc-architecture
- →Understand multi-agent orchestration
- →Configure hooks for Claude Code
- →Debug agent coordination state
- →Setup parallel task execution
About this skill
OPC Architecture Understanding
OPC (Orchestrated Parallel Claude) extends Claude Code - it does NOT replace it.
Core Concept
Claude Code CLI is the execution engine. OPC adds orchestration via:
- Hooks - Intercept Claude Code events (PreToolUse, PostToolUse, SessionStart, etc.)
- Skills - Load prompts into Claude Code
- Scripts - Called by hooks/skills for coordination
- Database - Store state between Claude Code instances
How Agents Work
When you spawn an agent:
- Main Claude Code instance (your terminal) runs hook on Task tool
- Hook calls
subprocess.Popen(["claude", "-p", "prompt"]) - A NEW Claude Code instance spawns as child process
- Child runs independently, reads/writes to coordination DB
- Parent tracks child via PID in DB
$ claude ← Main Claude Code (your terminal)
↓ Task tool triggers hook
↓ subprocess.Popen(["claude", "-p", "..."])
├── claude -p "research..." ← Child agent 1
├── claude -p "implement..." ← Child agent 2
└── claude -p "test..." ← Child agent 3
What OPC Is NOT
- OPC is NOT a separate application
- OPC does NOT run without Claude Code
- OPC does NOT intercept Claude API calls directly
- OPC does NOT modify Claude Code's internal behavior
What OPC IS
- OPC IS hooks that Claude Code loads from
.claude/hooks/ - OPC IS skills that Claude Code loads from
.claude/skills/ - OPC IS scripts that hooks/skills call for coordination
- OPC IS a database backend for state across Claude Code instances
Key Files
.claude/
├── hooks/ ← TypeScript hooks that Claude Code runs
├── skills/ ← SKILL.md prompts that Claude Code loads
├── settings.json ← Hook registration, Claude Code reads this
└── cache/ ← State files, agent outputs
opc/
├── scripts/ ← Python scripts called by hooks
├── docker-compose.yml ← PostgreSQL, Redis, PgBouncer
└── init-db.sql ← Database schema
Coordination Flow
- User runs
claudein terminal - Claude Code loads hooks from
.claude/settings.json - User says "spawn a research agent"
- Claude uses Task tool
- PreToolUse hook fires, checks resources
- Hook spawns
claude -p "research..."as subprocess - Hook stores PID in PostgreSQL
- Child agent runs, writes output to
.claude/cache/agents/<id>/ - Child completes, broadcasts "done" to PostgreSQL
- Parent checks DB, reads child's output file
Remember
- Every "agent" is just another
claude -pprocess - Hooks intercept events, they don't create new functionality
- All coordination happens via files and PostgreSQL
- Claude Code is always the execution engine
When not to use it
- →Running as a standalone application without Claude Code
- →Intercepting Claude API calls directly
- →Modifying internal Claude Code behavior
Prerequisites
Limitations
- →Requires Claude Code as the execution engine
- →Coordination relies on external database and file system state
How it compares
Unlike manual execution, this system automates the spawning and state tracking of multiple independent Claude Code instances through event-driven hooks.
Compared to similar skills
opc-architecture side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| opc-architecture (this skill) | 2 | 7mo | Review | Advanced |
| mcp-builder | 136 | 3mo | Review | Advanced |
| agentdb-advanced-features | 7 | 9mo | Review | Advanced |
| meta-automation-architect | 7 | 8mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
mcp-builder
anthropics
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
agentdb-advanced-features
ruvnet
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications.
meta-automation-architect
comzine
Use when user wants to set up comprehensive automation for their project. Generates custom subagents, skills, commands, and hooks tailored to project needs. Creates a multi-agent system with robust communication protocol.
hive-mind-advanced
ruvnet
Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory
memory-systems
sickn33
Design short-term, long-term, and graph-based memory architectures
parallel-agents
davila7
Multi-agent orchestration patterns. Use when multiple independent tasks can run with different domain expertise or when comprehensive analysis requires multiple perspectives.