Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/agents/agentica-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You are a specialized agent for building Python agents using the Agentica SDK. Y
Before starting, read the SDK skill for full API reference:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/agentica-sdk/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/agentica-sdk/SKILL.md
```

## Step 2: Understand Your Task
Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/braintrust-analyst.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ You are a specialized analysis agent. Your job is to run Braintrust analysis scr
Read the braintrust-analyze skill:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/braintrust-analyze/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/braintrust-analyze/SKILL.md
```

## Step 2: Execute Analysis

Run analysis IMMEDIATELY using Bash tool:

```bash
cd $CLAUDE_PROJECT_DIR && uv run python -m runtime.harness scripts/braintrust_analyze.py --last-session
cd $CLAUDE_OPC_DIR && uv run python -m runtime.harness scripts/braintrust_analyze.py --last-session
```

Other analyses (run as needed):
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/debug-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You are a specialized debugging agent. Your job is to investigate issues, trace
Before starting, read the debug skill for methodology:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/debug/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/debug/SKILL.md
```

Follow the structure and guidelines from that skill.
Expand Down
10 changes: 5 additions & 5 deletions .claude/agents/memory-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You receive:

```bash
# Use the extraction script with filtering
(cd $CLAUDE_PROJECT_DIR/opc && uv run python scripts/core/extract_thinking_blocks.py \
(cd $CLAUDE_OPC_DIR && uv run python scripts/core/extract_thinking_blocks.py \
--jsonl "$JSONL_PATH" \
--filter \
--format json) > /tmp/perception-blocks.json
Expand All @@ -42,7 +42,7 @@ This extracts only thinking blocks containing perception signals (actually, real
### Step 2: Check Stats

```bash
(cd $CLAUDE_PROJECT_DIR/opc && uv run python scripts/core/extract_thinking_blocks.py \
(cd $CLAUDE_OPC_DIR && uv run python scripts/core/extract_thinking_blocks.py \
--jsonl "$JSONL_PATH" \
--stats)
```
Expand Down Expand Up @@ -80,7 +80,7 @@ For each extracted perception change, use the mapped type from Step 3:

```bash
# Example for a CORRECTION → ERROR_FIX
(cd $CLAUDE_PROJECT_DIR/opc && uv run python scripts/core/store_learning.py \
(cd $CLAUDE_OPC_DIR && uv run python scripts/core/store_learning.py \
--session-id "$SESSION_ID" \
--type "ERROR_FIX" \
--context "what this relates to" \
Expand All @@ -90,7 +90,7 @@ For each extracted perception change, use the mapped type from Step 3:
--json)

# Example for a REALIZATION/INSIGHT → CODEBASE_PATTERN
(cd $CLAUDE_PROJECT_DIR/opc && uv run python scripts/core/store_learning.py \
(cd $CLAUDE_OPC_DIR && uv run python scripts/core/store_learning.py \
--session-id "$SESSION_ID" \
--type "CODEBASE_PATTERN" \
--context "what this relates to" \
Expand All @@ -100,7 +100,7 @@ For each extracted perception change, use the mapped type from Step 3:
--json)

# Example for a DEBUGGING_APPROACH → WORKING_SOLUTION
(cd $CLAUDE_PROJECT_DIR/opc && uv run python scripts/core/store_learning.py \
(cd $CLAUDE_OPC_DIR && uv run python scripts/core/store_learning.py \
--session-id "$SESSION_ID" \
--type "WORKING_SOLUTION" \
--context "debugging methodology" \
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/plan-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You are a specialized planning agent. Your job is to create detailed implementat
Before creating any plan, read the planning skill for methodology and format:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/create_plan/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/create_plan/SKILL.md
```

Follow the structure and guidelines from that skill.
Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/scribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Before creating documentation, read the relevant skills:

```bash
# For handoffs
cat $CLAUDE_PROJECT_DIR/.claude/skills/create_handoff/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/create_handoff/SKILL.md

# For ledger updates
cat $CLAUDE_PROJECT_DIR/.claude/skills/continuity_ledger/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/continuity_ledger/SKILL.md
```

Follow the structure and guidelines from those skills.
Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/session-analyst.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ You analyze Claude Code session data from Braintrust and provide insights.
Read the skill file first:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/braintrust-analyze/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/braintrust-analyze/SKILL.md
```

## Step 2: Run Analysis

Run the appropriate command based on user request:

```bash
cd $CLAUDE_PROJECT_DIR
cd $CLAUDE_OPC_DIR
uv run python -m runtime.harness scripts/braintrust_analyze.py --last-session
```

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/validate-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You are a specialized validation agent. Your job is to validate a technical plan
Before validating, read the validation skill for methodology and format:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/validate-agent/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/validate-agent/SKILL.md
```

Follow the structure and guidelines from that skill.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/commit/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You are tasked with creating git commits for the changes made during this sessio
- Show the result with `git log --oneline -n [number]`

5. **Generate reasoning (after each commit):**
- Run: `bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <commit-hash> "<commit-message>"`
- Run: `bash "$CLAUDE_CC_DIR/.claude/scripts/generate-reasoning.sh" <commit-hash> "<commit-message>"`
- This captures what was tried during development (build failures, fixes)
- The reasoning file helps future sessions understand past decisions
- Stored in `.git/claude/commits/<hash>/reasoning.md`
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/commit/SKILL.v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ eta |-> generate_reasoning(hash, message)
```bash
git add <file1> <file2> ...
git commit -m "message"
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <hash> "<message>"
bash "$CLAUDE_CC_DIR/.claude/scripts/generate-reasoning.sh" <hash> "<message>"
git log --oneline -n N
```

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/describe_pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You are tasked with generating a comprehensive pull request description followin

4b. **Gather reasoning history (if available):**
- Check if reasoning files exist: `ls .git/claude/commits/*/reasoning.md 2>/dev/null`
- If they exist, aggregate them: `bash "$CLAUDE_PROJECT_DIR/.claude/scripts/aggregate-reasoning.sh" main`
- If they exist, aggregate them: `bash "$CLAUDE_CC_DIR/.claude/scripts/aggregate-reasoning.sh" main`
- This shows what approaches were tried before the final solution
- Save the output for inclusion in the PR description

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/git-commits/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ When you see these in user prompts, use the commit skill:

The skill will prompt you to run:
```bash
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <hash> "<message>"
bash "$CLAUDE_CC_DIR/.claude/scripts/generate-reasoning.sh" <hash> "<message>"
```

Then push if requested:
Expand Down
16 changes: 8 additions & 8 deletions .claude/skills/math-unified/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For formal proofs, use `/prove` instead.

### SymPy (Symbolic Math)
```bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" <command> <args>
uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/sympy_compute.py" <command> <args>
```

| Command | Description | Example |
Expand Down Expand Up @@ -83,7 +83,7 @@ uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" <co

### Z3 (Constraint Solving)
```bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" <command> <args>
uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/z3_solve.py" <command> <args>
```

| Command | Use Case |
Expand All @@ -96,7 +96,7 @@ uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" <command

### Pint (Units)
```bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert <value> <from_unit> <to_unit>
uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/pint_compute.py" convert <value> <from_unit> <to_unit>
```

Example: `convert 5 miles kilometers`
Expand All @@ -105,7 +105,7 @@ Example: `convert 5 miles kilometers`

### Math Router (Auto-Route)
```bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/math_router.py" route "<natural language request>"
uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/math_router.py" route "<natural language request>"
```

Returns the exact command to run. Use when unsure which script.
Expand Down Expand Up @@ -154,28 +154,28 @@ I decide based on your request:
### Solve Equation
```
User: Solve x² - 5x + 6 = 0
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" solve "x**2 - 5*x + 6" --var x
Claude: uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/sympy_compute.py" solve "x**2 - 5*x + 6" --var x
Result: x = 2 or x = 3
```

### Compute Eigenvalues
```
User: Find eigenvalues of [[2, 1], [1, 2]]
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" eigenvalues "[[2,1],[1,2]]"
Claude: uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/sympy_compute.py" eigenvalues "[[2,1],[1,2]]"
Result: {1: 1, 3: 1} (eigenvalue 1 with multiplicity 1, eigenvalue 3 with multiplicity 1)
```

### Prove Inequality
```
User: Is x² + y² ≥ 2xy always true?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" prove "x**2 + y**2 >= 2*x*y"
Claude: uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/z3_solve.py" prove "x**2 + y**2 >= 2*x*y"
Result: PROVED (equivalent to (x-y)² ≥ 0)
```

### Convert Units
```
User: How many kilometers in 26.2 miles?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert 26.2 miles kilometers
Claude: uv run python "$CLAUDE_OPC_DIR/scripts/cc_math/pint_compute.py" convert 26.2 miles kilometers
Result: 42.16 km
```

Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/recall-reasoning/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This searches handoffs with post-mortems (what worked, what failed, key decision
### Secondary: Reasoning Files (build attempts)

```bash
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/search-reasoning.sh" "<query>"
bash "$CLAUDE_CC_DIR/.claude/scripts/search-reasoning.sh" "<query>"
```

This searches `.git/claude/commits/*/reasoning.md` for build failures and fixes.
Expand All @@ -50,7 +50,7 @@ uv run python scripts/core/artifact_query.py "implement agent" --outcome SUCCEED
uv run python scripts/core/artifact_query.py "hook implementation" --outcome FAILED

# Search build/test reasoning
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/search-reasoning.sh" "TypeError"
bash "$CLAUDE_CC_DIR/.claude/scripts/search-reasoning.sh" "TypeError"
```

## What Gets Searched
Expand Down
16 changes: 8 additions & 8 deletions .claude/skills/skill-developer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ To create a new MCP chain script and wrap it as a skill:
Copy the multi-tool-pipeline template:

```bash
cp $CLAUDE_PROJECT_DIR/scripts/multi_tool_pipeline.py $CLAUDE_PROJECT_DIR/scripts/my_pipeline.py
cp $CLAUDE_OPC_DIR/scripts/multi_tool_pipeline.py $CLAUDE_OPC_DIR/scripts/my_pipeline.py
```

Reference the template pattern:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/skills/multi-tool-pipeline/SKILL.md
cat $CLAUDE_PROJECT_DIR/scripts/multi_tool_pipeline.py
cat $CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md
cat $CLAUDE_OPC_DIR/scripts/multi_tool_pipeline.py
```

### Step 2: Customize the Script
Expand Down Expand Up @@ -140,8 +140,8 @@ Add to `.claude/skills/skill-rules.json`:
For full details, read:

```bash
cat $CLAUDE_PROJECT_DIR/.claude/rules/skill-development.md
cat $CLAUDE_PROJECT_DIR/.claude/rules/mcp-scripts.md
cat $CLAUDE_CC_DIR/.claude/rules/skill-development.md
cat $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md
```

## Quick Checklist
Expand All @@ -157,7 +157,7 @@ cat $CLAUDE_PROJECT_DIR/.claude/rules/mcp-scripts.md
Look at existing skills for patterns:

```bash
ls $CLAUDE_PROJECT_DIR/.claude/skills/
cat $CLAUDE_PROJECT_DIR/.claude/skills/commit/SKILL.md
cat $CLAUDE_PROJECT_DIR/.claude/skills/firecrawl-scrape/SKILL.md
ls $CLAUDE_CC_DIR/.claude/skills/
cat $CLAUDE_CC_DIR/.claude/skills/commit/SKILL.md
cat $CLAUDE_CC_DIR/.claude/skills/firecrawl-scrape/SKILL.md
```
2 changes: 1 addition & 1 deletion .claude/skills/tldr-stats/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Show a beautiful dashboard with token usage, actual API costs, TLDR savings, and

1. Run the stats script:
```bash
python3 $CLAUDE_PROJECT_DIR/.claude/scripts/tldr_stats.py
python3 $CLAUDE_CC_DIR/.claude/scripts/tldr_stats.py
```

2. **Copy the full output into your response** so the user sees the dashboard directly in the chat. Do not just run the command silently - the user wants to see the stats.
Expand Down
29 changes: 21 additions & 8 deletions opc/scripts/setup/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,34 +866,47 @@ async def run_setup_wizard() -> None:
else:
console.print(" Skipped integration installation")

# Set CLAUDE_OPC_DIR environment variable for skills to find scripts
console.print(" Setting CLAUDE_OPC_DIR environment variable...")
# Set CLAUDE_OPC_DIR and CLAUDE_CC_DIR environment variables
# CLAUDE_OPC_DIR = opc/ directory (Python scripts, MCP runtime)
# CLAUDE_CC_DIR = repository root (contains .claude/scripts/, .claude/skills/)
console.print(" Setting environment variables...")
shell_config, shell_type = get_shell_config()

opc_dir = _project_root # Use script location, not cwd (robust if invoked from elsewhere)
cc_dir = opc_dir.parent # Repository root
# Ensure fish config directory exists (fish creates it lazily)
if shell_config and shell_type == "fish" and not shell_config.exists():
shell_config.parent.mkdir(parents=True, exist_ok=True)
shell_config.touch()
if shell_config and shell_config.exists():
content = shell_config.read_text()
changed = False
if shell_type == "fish":
export_line = f'set -gx CLAUDE_OPC_DIR "{opc_dir}"'
export_opc = f'set -gx CLAUDE_OPC_DIR "{opc_dir}"'
export_cc = f'set -gx CLAUDE_CC_DIR "{cc_dir}"'
else:
export_line = f'export CLAUDE_OPC_DIR="{opc_dir}"'

export_opc = f'export CLAUDE_OPC_DIR="{opc_dir}"'
export_cc = f'export CLAUDE_CC_DIR="{cc_dir}"'
if "CLAUDE_OPC_DIR" not in content:
with open(shell_config, "a") as f:
f.write(f"\n# Continuous-Claude OPC directory (for skills to find scripts)\n{export_line}\n")
console.print(f" [green]OK[/green] Added CLAUDE_OPC_DIR to {shell_config.name}")
f.write(f"\n# Continuous-Claude directories (for skills to find scripts)\n{export_opc}\n{export_cc}\n")
changed = True
elif "CLAUDE_CC_DIR" not in content:
with open(shell_config, "a") as f:
f.write(f"\n# Continuous-Claude root directory\n{export_cc}\n")
changed = True
if changed:
console.print(f" [green]OK[/green] Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR to {shell_config.name}")
else:
console.print(f" [dim]CLAUDE_OPC_DIR already in {shell_config.name}[/dim]")
console.print(f" [dim]CLAUDE_OPC_DIR and CLAUDE_CC_DIR already in {shell_config.name}[/dim]")
elif sys.platform == "win32":
console.print(" [yellow]NOTE[/yellow] Add to your environment:")
console.print(f' set CLAUDE_OPC_DIR="{opc_dir}"')
console.print(f' set CLAUDE_CC_DIR="{cc_dir}"')
else:
console.print(" [yellow]NOTE[/yellow] Add to your shell config:")
console.print(f' export CLAUDE_OPC_DIR="{opc_dir}"')
console.print(f' export CLAUDE_CC_DIR="{cc_dir}"')

# Step 8: Math Features (Optional)
console.print("\n[bold]Step 9/15: Math Features (Optional)[/bold]")
Expand Down