Expert guide for Jean Claude CLI - a sophisticated AI orchestration framework featuring two-agent workflows, event sourcing, coordinator pattern with ntfy.sh, agent note-taking, mailbox...
Expert knowledge for using Jean Claude CLI (jc), a sophisticated AI-driven development workflow orchestration framework.
Jean Claude is a two-layer orchestration framework:
.claude/commands/ slash commands for Claude Codesrc/jean_claude/ CLI tool with four subsystems:cli/ - Click-based command interface (14+ commands)core/ - Business logic (56+ modules)orchestration/ - Multi-agent workflow enginedashboard/ - FastAPI monitoring UI with SSE streamingKey Innovations:
jc initInitialize Jean Claude in a project (run once).
Creates:
.jc-project.yaml - Project configuration.claude/skills/jean-claude-cli/ - This skillspecs/ - Workflow specifications directoryagents/ - Agent working directoriesExample:
jc init
jc prompt "description"Execute a single prompt with Claude Agent SDK.
When to use:
Options:
--model opus|sonnet|haiku - Choose model (default: sonnet)--stream - Show real-time output--raw - Return raw response without formattingExample:
jc prompt "Add docstrings to all functions" --model sonnet --stream
jc workflow "description"Run two-agent workflow without Beads tracking.
When to use:
Phases:
Options:
--initializer-model opus|sonnet - Planning model (default: opus)--coder-model opus|sonnet|haiku - Implementation model (default: sonnet)--max-iterations N - Max iterations (default: 10)--auto-continue - Resume automatically if interruptedExample:
jc workflow "Add user authentication with JWT tokens" --auto-continue
jc work <task-id>Execute a Beads task using two-agent workflow.
When to use:
Process:
bd show <task-id>)specs/beads-{task-id}.mdExample:
jc work beads-abc123
jc noteAgent note-taking system for persistent knowledge capture.
When to use:
Subcommands:
jc note add "content" - Add note (agents can use this proactively)jc note list - View all notesjc note list --workflow <id> - Notes for specific workflowjc note search "query" - Search note contentsAgent Usage: Agents executing in workflows can proactively use the note-taking API to:
Example:
# Human usage
jc note add "Using SQLAlchemy 2.0 async patterns for all DB access"
jc note list --workflow a3b4c5d6
# Agent usage (within workflow)
await note_taking_api.create_note(
content="Discovered circular import in auth module",
workflow_id=workflow_id,
category="architecture"
)
jc primeGather project context efficiently.
When to use:
Process: Uses fast Haiku model to explore codebase and return condensed summary (~500 words) covering:
Options:
--raw - Return raw markdown without formatting--output <file> - Save to fileExample:
jc prime --raw
jc statusCheck workflow status and progress.
When to use:
Options:
<workflow-id> - Specific workflow (default: latest)--json - JSON output for scriptingExample:
jc status # Latest workflow
jc status a3b4c5d6 # Specific workflow
jc status --json | jq . # Programmatic access
jc logsView workflow event logs.
When to use:
Options:
<workflow-id> - Specific workflow (default: latest)--follow - Follow mode (real-time, like tail -f)--level debug|info|warning|error - Filter by log levelExample:
jc logs --follow # Real-time monitoring
jc logs a3b4c5d6 # Specific workflow
jc logs --level error # Errors only
jc dashboardLaunch web monitoring dashboard.
When to use:
Features:
Example:
jc dashboard # Launches on http://localhost:8000
Access dashboard in browser to see:
jc migrateUpdate existing project to latest Jean Claude version.
When to use:
Process:
Options:
--dry-run - Preview changes without applyingExample:
jc migrate --dry-run # Preview
jc migrate # Apply updates
Jean Claude's core innovation: strategic planning with tactical execution.
Initializer Agent (Opus):
agents/{workflow-id}/state.jsonCoder Agent (Sonnet):
Shared State:
agents/{workflow-id}/state.json - Single source of truthnot_started β in_progress β completedplanning β implementing β verifying β completeagents/{workflow-id}/events.jsonlWorkflowState structure (agents/{workflow-id}/state.json):
{
"workflow_id": "a3b4c5d6",
"features": [
{
"id": "feat-1",
"name": "Add JWT authentication",
"status": "completed",
"description": "...",
"verification": "..."
}
],
"current_phase": "implementing",
"costs": {"initializer": 0.45, "coder": 1.23},
"session_ids": ["sess-1", "sess-2"]
}
Jean Claude uses event sourcing for complete auditability and crash recovery.
Dual persistence:
.jc/events.db) - Centralized, queryableagents/{workflow-id}/events.jsonl) - Per-workflow append-only logEvent types:
workflow_started, workflow_completedfeature_started, feature_completedagent_invocation, agent_responsetest_run, validation_checkerror_detected, blocker_detectedmessage_sent, message_receivednote_created, note_updatedEvery 100 events, system creates snapshot for bounded replay:
Benefits:
# Via CLI
jc logs a3b4c5d6 --level error
# Via SQLite
sqlite3 .jc/events.db "SELECT * FROM events WHERE workflow_id='a3b4c5d6'"
# Via dashboard
jc dashboard # Real-time event stream
Jean Claude implements hierarchical agent coordination with human-in-the-loop escalation.
Main Claude Code (Coordinator)
β
Subagents (Initializer, Coder, etc.)
β
Mailbox Tools (ask_user, notify_user)
β
Coordinator Triage (90% auto-answer, 10% escalate)
β
ntfy.sh (Mobile notifications)
β
Human Response
Location: agents/{workflow-id}/INBOX/ and OUTBOX/
Message format:
{
"id": "msg-abc123",
"from": "coder-agent",
"to": "coordinator",
"priority": "normal",
"question": "Should I use SQLite or PostgreSQL?",
"context": {"feature_id": "feat-2"},
"created_at": "2026-01-03T12:34:56Z"
}
Priorities:
LOW - FYI, non-blockingNORMAL - Needs answer within 1 hourURGENT - Critical decision, blocks progressCRITICAL - Safety/security concernAutomatic answers (90%):
Escalated to human (10%):
Setup:
# .env configuration
export JEAN_CLAUDE_NTFY_TOPIC="your-escalation-topic"
export JEAN_CLAUDE_NTFY_RESPONSE_TOPIC="your-response-topic"
Notification format:
[project-name] Question from Coder Agent
Workflow: a3b4c5d6
Feature: Add authentication
Question: Should I implement OAuth2 or JWT tokens?
Context: User mentioned "simple auth" but didn't specify protocol.
Reply with: a3b4c5d6: your response
Response format (from phone):
a3b4c5d6: Use JWT tokens for simplicity
Multi-project support: All projects share same ntfy topics. Workflow ID ensures correct routing:
Project A (jean-claude): a3b4c5d6
Project B (my-api-server): f8e2a1b9
Project C (website): 2c7d9e4a
# You receive:
[jean-claude] Architecture Question
[my-api-server] Should I add rate limiting?
[website] Use SQLite or Postgres?
# You respond:
a3b4c5d6: Use the pattern from existing code
f8e2a1b9: Yes, add rate limiting
2c7d9e4a: Use Postgres
Coordinators poll for responses (not blocking):
max_attempts = 30 # 30 attempts Γ 10 seconds = 5 minutes
for attempt in range(max_attempts):
time.sleep(10) # Poll every 10 seconds
responses = poll_ntfy_responses()
matching = [r for r in responses if r['workflow_id'] == workflow_id]
if matching:
response = matching[0]['response']
break
else:
# Timeout - proceed with default or pause workflow
handle_timeout()
Why polling?:
Jean Claude integrates with Beads issue tracker for project-wide task management.
# 1. Find available work
bd ready # Show tasks with no blockers
# 2. Execute task
jc work beads-abc123 # Two-agent workflow
# 3. Close when done
bd close beads-abc123 # Mark complete
bd ready # Available tasks (no blockers)
bd list --status=open # All open tasks
bd list --status=in_progress # Your active work
bd show beads-abc123 # Detailed task view
# Create task
bd create \
--title="Add feature X" \
--type=feature \
--priority=2 # 0-4 or P0-P4 (0=critical, 4=backlog)
# Add dependencies
bd dep add beads-yyy beads-xxx # yyy depends on xxx (xxx blocks yyy)
bd close beads-abc123 # Single task
bd close beads-abc beads-def beads-xyz # Batch (efficient!)
bd close beads-abc --reason="Completed in PR #42" # With reason
bd sync # Push to git remote
bd sync --status # Check sync status
bd stats # Project statistics
bd doctor # Check for issues
When running jc work <task-id>, Jean Claude:
bd show <task-id>specs/beads-{task-id}.mdSpec template (src/jean_claude/templates/beads_spec.md):
# {{ title }}
**Task ID**: {{ task_id }}
**Type**: {{ type }}
**Priority**: {{ priority }}
## Description
{{ description }}
## Acceptance Criteria
{{ acceptance_criteria }}
## Dependencies
{% for dep in dependencies %}
- {{ dep }}
{% endfor %}
Autonomous continuation loop with error recovery.
When to use:
How it works:
Options:
jc workflow "Large refactoring" \
--auto-continue \
--max-iterations 50
Error detection:
test_failure_detector.py)ambiguity_detector.py)blocker_detector.py)error_detector.py)After each feature:
uv run pytest)Test commands (.jc-project.yaml):
tooling:
test_command: uv run pytest
linter_command: uv run ruff check .
format_command: uv run ruff format .
Future feature: Each workflow executes in isolated git worktree.
Benefits:
Planned structure:
trees/
βββ workflow-a3b4c5d6/ # Isolated worktree
β βββ .git # Linked to main repo
βββ workflow-f8e2a1b9/ # Another workflow
βββ .git
Jean Claude validates all bash commands before execution.
Validation (src/jean_claude/core/security.py):
Override (if needed):
# In workflow state
"security": {
"allow_dangerous": false,
"allowed_commands": ["rm -rf node_modules"]
}
jc dashboard # Launches on http://localhost:8000
Features:
Tech stack:
Server-Sent Events provide zero-latency updates:
// Browser connects to /events stream
const eventSource = new EventSource('/events');
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
// Update UI in real-time
};
Event types streamed:
Tracked per workflow:
{
"costs": {
"initializer": 0.45, // Opus planning
"coder": 1.23, // Sonnet implementation
"total": 1.68
},
"tokens": {
"input": 125000,
"output": 45000
}
}
Access via:
jc status --json | jq .costs.jc-project.yaml)directories:
specs: specs/ # Workflow specifications
agents: agents/ # Agent working directories (state.json)
trees: trees/ # Git worktrees (future)
source: src/
tests: tests/
tooling:
test_command: uv run pytest
linter_command: uv run ruff check .
format_command: uv run ruff format .
workflows:
default_model: sonnet # sonnet|opus|haiku
auto_commit: true # Auto-commit after features
max_iterations: 10
vcs:
issue_tracker: beads # beads|github
platform: github # github|gitlab
Authentication:
ANTHROPIC_API_KEY=sk-... # Optional (not needed for Claude Max)
CLAUDE_CODE_USE_BEDROCK=1 # Use AWS Bedrock backend
AWS_PROFILE=default # Bedrock credentials
AWS_REGION=us-east-1
Project:
ADW_ISSUE_TRACKER=beads # beads|github
ADW_MODEL_SET=base # base (sonnet) | advanced (opus)
LOG_LEVEL=INFO # DEBUG|INFO|WARNING|ERROR|CRITICAL
Notifications:
JEAN_CLAUDE_NTFY_TOPIC=escalation-topic
JEAN_CLAUDE_NTFY_RESPONSE_TOPIC=response-topic
# 1. Create task
bd create --title="Add user authentication" --type=feature --priority=2
# 2. Execute with two-agent workflow
jc work beads-auth123 --auto-continue
# 3. Monitor progress
jc logs --follow
# 4. Verify
uv run pytest tests/
jc status
# 5. Close task
bd close beads-auth123
# Direct workflow without Beads
jc workflow "Add user authentication with JWT" --auto-continue
# Monitor in dashboard
jc dashboard
# Check status
jc status --json
jc prompt "Refactor module X to use async/await" --model sonnet --stream
jc workflow "Migrate from SQLAlchemy 1.4 to 2.0" \
--initializer-model opus \
--coder-model sonnet \
--auto-continue \
--max-iterations 30
Agents proactively capture knowledge:
# Within workflow execution
await note_taking_api.create_note(
content="Using Redis pub/sub for real-time features",
workflow_id=workflow_id,
category="architecture"
)
Review notes later:
jc note list --workflow a3b4c5d6
jc note search "Redis"
Run workflows across projects:
# Terminal 1: Project A
cd ~/projects/jean-claude
jc workflow "Add feature X" --auto-continue
# Terminal 2: Project B
cd ~/projects/my-api
jc workflow "Add feature Y" --auto-continue
# Terminal 3: Project C
cd ~/projects/website
jc workflow "Add feature Z" --auto-continue
Phone receives:
[jean-claude] Architecture Question (workflow: a3b4c5d6)
[my-api] Database choice? (workflow: f8e2a1b9)
[website] Use REST or GraphQL? (workflow: 2c7d9e4a)
Respond with workflow IDs:
a3b4c5d6: Use pattern from existing code
f8e2a1b9: Use PostgreSQL
2c7d9e4a: Use REST for simplicity
# Check status
jc status
# View logs
jc logs --follow
# Check for agent questions
ls agents/*/INBOX/
# Read messages
cat agents/a3b4c5d6/INBOX/msg-*.json
# Respond via coordinator or manually
bd doctor # Check for issues
bd sync --status # Check sync status
bd sync # Force sync
# Rebuild from JSONL logs
jc doctor --rebuild-events
# Verify integrity
sqlite3 .jc/events.db "PRAGMA integrity_check"
# Check SSE connection
curl http://localhost:8000/events
# Restart dashboard
pkill -f "jc dashboard"
jc dashboard
# Test topic
curl -d "Test message" ntfy.sh/your-topic
# Check environment variables
echo $JEAN_CLAUDE_NTFY_TOPIC
echo $JEAN_CLAUDE_NTFY_RESPONSE_TOPIC
# Test from CLI
jc test-ntfy "Test escalation"
# Check workflow costs
jc status --json | jq .costs
# Use cheaper models
jc workflow "..." --coder-model haiku
# Reduce iterations
jc workflow "..." --max-iterations 5
a3b4c5d6)agents/{workflow-id}/state.json - single source of truthbd close task1 task2 task3 (efficient)βββββββββββββββββββ
β Workflow Start β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Initializer β (Opus, once)
β - Analyze scope β
β - Create list β
β - Write state β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Coder Loop β (Sonnet, N times)
β For each feat: β
β - Read state β
β - Fresh context β
β - Implement β
β - Test β
β - Update state β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Verification β
β - All tests passβ
β - Features done β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Workflow End β
βββββββββββββββββββ
ββββββββββββββ ββββββββββββββββ βββββββββββββββ
β Workflow ββββββΆβ Event ββββββΆβ SQLite DB β
β Action β β Emission β β + JSONL β
ββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
βΌ
ββββββββββββββββ
β Snapshot β (every 100 events)
β Creation β
ββββββββββββββββ
β
βΌ
ββββββββββββββββ
β Dashboard β (SSE stream)
β Update β
ββββββββββββββββ
βββββββββββββββ
β Subagent β
β needs help β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββ
β ask_user() β
β writes to INBOX β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Coordinator ββββββ
β reads INBOX β β 90% auto-answer
ββββββββ¬βββββββββββ β from codebase
β βββββββββββββββ
β 10% escalate β
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββ
β ntfy.sh β β write to β
β notification β β OUTBOX β
ββββββββ¬βββββββββββ ββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Human phone β
β responds β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Coordinator β
β polls response β
β writes to β
β OUTBOX β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Subagent reads β
β OUTBOX β
β continues work β
βββββββββββββββββββ
Documentation: docs/ directory
two-agent-workflow.md - OpusβSonnet pattern detailsauto-continue-workflow.md - Error recovery loopscoordinator-pattern.md - Agent communicationevent-store-architecture.md - Event sourcing designbeads-workflow.md - Issue tracker integrationstreaming-implementation-summary.md - SSE architectureTemplates: src/jean_claude/templates/
beads_spec.md - Jinja2 template for Beads tasksSkills: .claude/skills/
jean-claude-cli/ - This skillProject Config: .jc-project.yaml - Project-specific settings
Remember: Jean Claude orchestrates workflows, not just tasks. The two-agent pattern provides strategic planning with tactical execution. Event sourcing ensures auditability. The coordinator pattern scales agent autonomy while keeping humans in the loop for critical decisions.