Get up and running with Claude Code in minutes:
=== “Install Claude Code”
```bash
# Install Claude Code CLI
npm install -g @anthropic/claude-code
# Or use the installer
curl -fsSL https://claude.ai/install.sh | sh
# Verify installation
claude --version
```
=== “Setup Loopy Agents”
```bash
# Clone the repository
git clone https://github.com/looptech-ai/loopy-agents.git
cd loopy-agents
# Install dependencies
pip install -r requirements.txt
npm install
# Initialize configuration
./scripts/setup.sh
```
=== “First Hook”
```python
# .claude/hooks/safety.py
import json
import sys
def pre_tool_use_hook(event):
"""Block dangerous commands"""
tool_name = event.get("tool_name")
params = event.get("params", {})
# Block dangerous bash commands
if tool_name == "Bash":
command = params.get("command", "")
dangerous = ["rm -rf", "sudo", "chmod 777"]
for danger in dangerous:
if danger in command:
return {
"action": "block",
"message": f"Blocked dangerous command: {danger}"
}
return {"action": "allow"}
if __name__ == "__main__":
event = json.loads(sys.stdin.read())
result = pre_tool_use_hook(event)
print(json.dumps(result))
```
Loopy Agents is a comprehensive framework for extending Claude Code with:
graph TB
subgraph "Claude Code Core"
CC[Claude Code CLI]
API[Anthropic API]
end
subgraph "Loopy Agents Framework"
HOOKS[Hook System]
AGENTS[Agent Manager]
MCP[MCP Servers]
OBS[Observability]
end
subgraph "Extensions"
GUI[Claudia GUI]
VOICE[Voice Integration]
MEM[Memory System]
end
CC --> HOOKS
CC --> AGENTS
CC --> MCP
HOOKS --> OBS
AGENTS --> OBS
MCP --> OBS
AGENTS --> VOICE
HOOKS --> MEM
MCP --> GUI
style CC fill:#7c3aed
style HOOKS fill:#06b6d4
style AGENTS fill:#10b981
style MCP fill:#f59e0b
style OBS fill:#ef4444
```python title=”examples/multi_agent_system.py” #!/usr/bin/env python3 “”” Multi-agent system with real-time monitoring “””
from loopy_agents import AgentManager, Agent, Monitor from loopy_agents.hooks import lifecycle import asyncio
class CodeReviewer(Agent): “"”Reviews code for security and style issues””” system_prompt = “"”You are a senior code reviewer. Focus on security vulnerabilities and code quality.”””
tools = ["Read", "Grep", "Edit"]
class TestWriter(Agent): “"”Writes comprehensive test suites””” system_prompt = “"”You are a test automation expert. Write thorough tests with edge cases.”””
tools = ["Write", "Bash", "Edit"]
class Documenter(Agent): “"”Creates and maintains documentation””” system_prompt = “"”You are a technical writer. Create clear, comprehensive documentation.”””
tools = ["Write", "Edit", "Read"]
monitor = Monitor(port=8080)
manager = AgentManager(monitor=monitor)
manager.register(CodeReviewer()) manager.register(TestWriter()) manager.register(Documenter())
async def development_workflow(task): “"”Orchestrate agents for development tasks”””
# Phase 1: Code Review
review_result = await manager.run_agent(
"CodeReviewer",
f"Review this code for issues: {task}"
)
# Phase 2: Test Creation (parallel)
test_task = manager.run_agent(
"TestWriter",
f"Write tests based on review: {review_result}"
)
# Phase 3: Documentation (parallel)
doc_task = manager.run_agent(
"Documenter",
f"Document the implementation: {task}"
)
# Wait for parallel tasks
test_result, doc_result = await asyncio.gather(
test_task, doc_task
)
return {
"review": review_result,
"tests": test_result,
"docs": doc_result
}
if name == “main”: # Start monitoring dashboard monitor.start()
# Execute workflow
result = asyncio.run(
development_workflow("implement user authentication")
)
print("Workflow completed!", result) ```
!!! tip “Pro Tip”
Access the monitoring dashboard at http://localhost:8080 to see real-time agent interactions, performance metrics, and event logs.