Skip to content

fix: correct script path references in skills and agents#138

Open
tkavelli wants to merge 1 commit intoparcadei:mainfrom
tkavelli:fix/script-path-references
Open

fix: correct script path references in skills and agents#138
tkavelli wants to merge 1 commit intoparcadei:mainfrom
tkavelli:fix/script-path-references

Conversation

@tkavelli
Copy link
Copy Markdown

@tkavelli tkavelli commented Feb 12, 2026

Summary

  • Added CLAUDE_CC_DIR environment variable export in wizard (CC repository root)
  • Updated 7 skills and 8 agents to use $CLAUDE_CC_DIR or $CLAUDE_OPC_DIR instead of $CLAUDE_PROJECT_DIR for CC-internal script references

Problem

$CLAUDE_PROJECT_DIR is set by Claude Code to the user's current working project (e.g. /Users/x/myapp). Multiple skills and agents use it to locate CC's own scripts (e.g. generate-reasoning.sh, cc_math/*.py), which only works if the user happens to be working inside the CC repo itself.

For any other project, scripts are not found:

bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" ...
# Expands to: /Users/x/myapp/.claude/scripts/generate-reasoning.sh
# But script is at: /Users/x/Continuous-Claude-v3/.claude/scripts/generate-reasoning.sh

Fix

  • Wizard now exports CLAUDE_CC_DIR (CC repo root = parent of CLAUDE_OPC_DIR)
  • Skills use $CLAUDE_CC_DIR/.claude/scripts/ for shell scripts
  • Skills use $CLAUDE_OPC_DIR/scripts/ for Python scripts (cc_math, etc.)
  • Agents use $CLAUDE_CC_DIR for skill file reads and $CLAUDE_OPC_DIR for runtime scripts

Path mapping

Old path New path Used for
$CLAUDE_PROJECT_DIR/.claude/scripts/*.sh $CLAUDE_CC_DIR/.claude/scripts/*.sh Reasoning scripts
$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/ $CLAUDE_OPC_DIR/scripts/cc_math/ Math compute scripts
$CLAUDE_PROJECT_DIR/.claude/scripts/tldr_stats.py $CLAUDE_CC_DIR/.claude/scripts/tldr_stats.py Stats script
$CLAUDE_PROJECT_DIR/.claude/skills/*/SKILL.md $CLAUDE_CC_DIR/.claude/skills/*/SKILL.md Agent skill reads
$CLAUDE_PROJECT_DIR/opc $CLAUDE_OPC_DIR OPC runtime scripts

Files changed (17)

Wizard: opc/scripts/setup/wizard.py — add CLAUDE_CC_DIR export

Skills (7): commit, commit/v6, git-commits, describe_pr, recall-reasoning, tldr-stats, math-unified, skill-developer

Agents (8): braintrust-analyst, session-analyst, memory-extractor, agentica-agent, plan-agent, validate-agent, scribe, debug-agent

Test plan

  • Run wizard — verify both CLAUDE_CC_DIR and CLAUDE_OPC_DIR are exported to shell config
  • From a non-CC project, run /commit — verify generate-reasoning.sh is found
  • From a non-CC project, run /tldr-stats — verify tldr_stats.py is found
  • Verify echo $CLAUDE_CC_DIR and echo $CLAUDE_OPC_DIR are set after sourcing shell config

Fixes #106

Summary by CodeRabbit

  • Chores
    • Updated environment variable path references throughout the system for improved directory organization
    • Enhanced setup wizard to automatically configure multiple environment variables during initial setup

WHAT CHANGED:

1. opc/scripts/setup/wizard.py:
   - Added CLAUDE_CC_DIR env var export (CC repository root)
   - CLAUDE_CC_DIR = parent of CLAUDE_OPC_DIR
   - WHY: Skills reference scripts at $CC_DIR/.claude/scripts/
     but only CLAUDE_OPC_DIR was exported

2. Skills (7 files):
   - commit, git-commits: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
     for generate-reasoning.sh
   - describe_pr: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
     for aggregate-reasoning.sh
   - recall-reasoning: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
     for search-reasoning.sh
   - tldr-stats: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
     for tldr_stats.py
   - math-unified: $CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/
     → $CLAUDE_OPC_DIR/scripts/cc_math/
   - skill-developer: mixed $CLAUDE_PROJECT_DIR → $CLAUDE_OPC_DIR
     (scripts) and $CLAUDE_CC_DIR (.claude/ resources)

3. Agents (8 files):
   - braintrust-analyst, session-analyst: $CLAUDE_PROJECT_DIR
     → $CLAUDE_OPC_DIR for runtime.harness and braintrust scripts
   - memory-extractor: $CLAUDE_PROJECT_DIR/opc → $CLAUDE_OPC_DIR
     for core extraction scripts
   - agentica-agent, plan-agent, validate-agent, scribe,
     debug-agent: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR for
     skill file reads (cat SKILL.md)

CONTEXT:
$CLAUDE_PROJECT_DIR is set by Claude Code to the user's current
working project (e.g. /Users/x/myapp). Skills and agents were
using it to locate CC's own scripts, which only works if the user
happens to be working inside the CC repo itself. This breaks for
any user who installed CC in a different directory.

Fixes parcadei#106
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 12, 2026

PR author is not in the allowed authors list.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

This PR updates environment variable references throughout agent and skill configuration files from CLAUDE_PROJECT_DIR to CLAUDE_CC_DIR and CLAUDE_OPC_DIR, and extends the setup wizard to export and manage these new variables during installation.

Changes

Cohort / File(s) Summary
Agent Configuration
.claude/agents/agentica-agent.md, braintrust-analyst.md, debug-agent.md, plan-agent.md, scribe.md, session-analyst.md, validate-agent.md
Updated skill file references and execution paths to use CLAUDE_CC_DIR for CC skills and CLAUDE_OPC_DIR for opc directory execution contexts.
Memory Extraction Agent
.claude/agents/memory-extractor.md
Changed all uv run python command paths from CLAUDE_PROJECT_DIR/opc to CLAUDE_OPC_DIR across Steps 1, 2, and Store Learning examples.
Skill Documentation – Scripts
.claude/skills/commit/SKILL.md, commit/SKILL.v6.md, describe_pr/SKILL.md, git-commits/SKILL.md, recall-reasoning/SKILL.md, tldr-stats/SKILL.md
Updated script invocation paths from CLAUDE_PROJECT_DIR to CLAUDE_CC_DIR for reasoning and utility scripts.
Math and Developer Skills
.claude/skills/math-unified/SKILL.md, skill-developer/SKILL.md
Replaced CLAUDE_PROJECT_DIR with CLAUDE_CC_DIR and CLAUDE_OPC_DIR in computation script examples and MCP pipeline setup references.
Setup Wizard
opc/scripts/setup/wizard.py
Added export logic for CLAUDE_OPC_DIR and CLAUDE_CC_DIR environment variables; integrated both into shell configuration file management with unified messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • #100: Introduces and manages the same environment variable pattern (CLAUDE_OPC_DIR and CLAUDE_CC_DIR) with overlapping changes to setup wizard and skill/agent path references.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: correcting script path references in skills and agents by replacing environment variables.
Linked Issues check ✅ Passed The PR successfully addresses issue #106 by replacing CLAUDE_PROJECT_DIR references with CLAUDE_CC_DIR and CLAUDE_OPC_DIR, enabling skills to locate scripts correctly regardless of current project.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing script path references as required by issue #106; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
opc/scripts/setup/wizard.py (1)

839-868: ⚠️ Potential issue | 🟡 Minor

Misleading status message when only CLAUDE_CC_DIR is appended.

When CLAUDE_OPC_DIR already exists in the shell config but CLAUDE_CC_DIR does not (the elif branch at line 861), only CLAUDE_CC_DIR is appended. However, line 866 always prints "Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR", which is inaccurate for that case.

Proposed fix
         if "CLAUDE_OPC_DIR" not in content:
             with open(shell_config, "a") as f:
                 f.write(f"\n# Continuous-Claude directories (for skills to find scripts)\n{export_opc}\n{export_cc}\n")
-            changed = True
+            console.print(f"  [green]OK[/green] Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR to {shell_config.name}")
         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}")
+            console.print(f"  [green]OK[/green] Added CLAUDE_CC_DIR to {shell_config.name}")
         else:
             console.print(f"  [dim]CLAUDE_OPC_DIR and CLAUDE_CC_DIR already in {shell_config.name}[/dim]")
.claude/skills/skill-developer/SKILL.md (1)

85-85: ⚠️ Potential issue | 🟡 Minor

Fix duplicate step numbering.

Line 85 has "Step 2" but this should be "Step 3" since there's already a "Step 2" at line 69. This creates confusion in the documentation flow.

📝 Proposed fix
-### Step 2: Create the Skill
+### Step 3: Create the Skill
🤖 Fix all issues with AI agents
In @.claude/skills/skill-developer/SKILL.md:
- Around line 143-144: The SKILL.md references two missing docs
(.claude/rules/skill-development.md and .claude/rules/mcp-scripts.md); either
add those markdown files under .claude/rules/ with the expected content or
update the references in SKILL.md (lines that call `cat
$CLAUDE_CC_DIR/.claude/rules/skill-development.md` and `cat
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md`) to point to the correct existing
file paths or filenames; ensure the referenced filenames exactly match the
created file names and commit the new files or the updated SKILL.md references.
- Around line 59-67: Update .claude/skills/skill-developer/SKILL.md so
referenced template/example files and headings are correct: replace or remove
references to nonexistent paths
($CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md,
$CLAUDE_CC_DIR/.claude/rules/skill-development.md,
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md, commit/SKILL.md,
firecrawl-scrape/SKILL.md) and point them to existing files (or add the missing
template files), and fix the duplicate section heading "### Step 2" at line ~85
to "### Step 3"; verify wizard.py environment vars are still used but do not
rely on nonexistent files so users won't hit file-not-found errors.

Comment on lines +59 to 67
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
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find template files that the review comment references

# Check for multi_tool_pipeline.py in any scripts directory
fd --type f 'multi_tool_pipeline.py'

# Check for multi-tool-pipeline SKILL.md
fd --type f --path '*multi-tool-pipeline*' 'SKILL.md'

# List structure around scripts directories
fd --type d 'scripts' | head -20

Repository: parcadei/Continuous-Claude-v3

Length of output: 371


🏁 Script executed:

#!/bin/bash
# Read the actual SKILL.md file to verify the changes mentioned in the review
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '55,70p'
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '80,90p'
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '140,165p'

Repository: parcadei/Continuous-Claude-v3

Length of output: 1559


🏁 Script executed:

#!/bin/bash
# Check if CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined/exported
fd --type f 'wizard' | head -10
fd --type f -e 'sh' -e 'bash' | xargs grep -l 'CLAUDE_CC_DIR\|CLAUDE_OPC_DIR' 2>/dev/null | head -10

Repository: parcadei/Continuous-Claude-v3

Length of output: 100


🏁 Script executed:

#!/bin/bash
# Check for all referenced template files

# Check for multi-tool-pipeline skill documentation
fd 'multi-tool-pipeline' --type d

# Check for rules files
fd 'skill-development.md' --type f
fd 'mcp-scripts.md' --type f

# Check for example skills
fd 'SKILL.md' --type f | grep -E '(multi-tool-pipeline|commit|firecrawl-scrape)'

Repository: parcadei/Continuous-Claude-v3

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Check if CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined in wizard.py
cat -n opc/scripts/setup/wizard.py | grep -E 'CLAUDE_CC_DIR|CLAUDE_OPC_DIR' | head -20

Repository: parcadei/Continuous-Claude-v3

Length of output: 1059


🏁 Script executed:

#!/bin/bash
# Verify the file structure exists
ls -la .claude/skills/ 2>/dev/null | head -20
ls -la .claude/rules/ 2>/dev/null | head -20

Repository: parcadei/Continuous-Claude-v3

Length of output: 2337


🏁 Script executed:

#!/bin/bash
# More specific check for multi-tool-pipeline
find .claude/skills -type d -name "*multi*" 2>/dev/null

# Check all SKILL.md files to see what exists
fd 'SKILL.md' --type f

Repository: parcadei/Continuous-Claude-v3

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Check what's actually in .claude/rules
cat -n .claude/rules/*.md | head -30

Repository: parcadei/Continuous-Claude-v3

Length of output: 1214


Multiple referenced files do not exist; instructions are broken.

The path updates use correct environment variables (confirmed: CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined in wizard.py), but the referenced files are missing:

  • Line 65: $CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md — directory does not exist
  • Line 143: $CLAUDE_CC_DIR/.claude/rules/skill-development.md — file does not exist (actual rules are: agent-memory-recall.md, agent-model-selection.md, claim-verification.md, etc.)
  • Line 144: $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md — file does not exist
  • Lines 161-162: Example skills commit/SKILL.md and firecrawl-scrape/SKILL.md — neither directory exists

Additionally, line 85 has a duplicate heading: "### Step 2" should be "### Step 3".

Users following these instructions will encounter file-not-found errors. Either create the missing template/example files or correct the references.

🤖 Prompt for AI Agents
In @.claude/skills/skill-developer/SKILL.md around lines 59 - 67, Update
.claude/skills/skill-developer/SKILL.md so referenced template/example files and
headings are correct: replace or remove references to nonexistent paths
($CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md,
$CLAUDE_CC_DIR/.claude/rules/skill-development.md,
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md, commit/SKILL.md,
firecrawl-scrape/SKILL.md) and point them to existing files (or add the missing
template files), and fix the duplicate section heading "### Step 2" at line ~85
to "### Step 3"; verify wizard.py environment vars are still used but do not
rely on nonexistent files so users won't hit file-not-found errors.

Comment on lines +143 to +144
cat $CLAUDE_CC_DIR/.claude/rules/skill-development.md
cat $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify reference documentation files exist

echo "=== Searching for skill-development.md ==="
fd --type f --full-path '.claude/rules/skill-development.md$' 2>&1 || echo "Not found"

echo ""
echo "=== Searching for mcp-scripts.md ==="
fd --type f --full-path '.claude/rules/mcp-scripts.md$' 2>&1 || echo "Not found"

echo ""
echo "=== All files under .claude/rules directory ==="
fd --type f '.claude/rules/' 2>&1 || echo "Directory not found"

Repository: parcadei/Continuous-Claude-v3

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Broader search to understand the structure

echo "=== Checking if .claude/rules directory exists ==="
fd . '.claude/rules/' 2>&1 | head -20

echo ""
echo "=== Finding SKILL.md file ==="
fd --type f 'SKILL.md$' 2>&1

echo ""
echo "=== All files under .claude directory ==="
fd . '.claude/' 2>&1 | head -30

echo ""
echo "=== Searching for skill-development or skill development files ==="
fd --type f -i 'skill.*development' 2>&1

echo ""
echo "=== Searching for mcp-scripts files ==="
fd --type f -i 'mcp.*scripts' 2>&1

Repository: parcadei/Continuous-Claude-v3

Length of output: 1560


🏁 Script executed:

#!/bin/bash
# More comprehensive search for SKILL.md

echo "=== Recursive search for any SKILL.md file ==="
find . -type f -name 'SKILL.md' 2>/dev/null

echo ""
echo "=== Searching in skill-developer directory ==="
fd . 'skill-developer' 2>&1 | head -30

echo ""
echo "=== All markdown files in .claude ==="
find .claude -type f -name '*.md' 2>/dev/null | sort

Repository: parcadei/Continuous-Claude-v3

Length of output: 17131


🏁 Script executed:

#!/bin/bash
# Check the specific lines in skill-developer SKILL.md

echo "=== Lines around 143-144 in ./.claude/skills/skill-developer/SKILL.md ==="
sed -n '140,150p' ./.claude/skills/skill-developer/SKILL.md

echo ""
echo "=== Total line count ==="
wc -l ./.claude/skills/skill-developer/SKILL.md

Repository: parcadei/Continuous-Claude-v3

Length of output: 468


Create missing reference documentation files or update paths to existing documentation.

The referenced files do not exist at the specified paths:

  • .claude/rules/skill-development.md — does not exist
  • .claude/rules/mcp-scripts.md — does not exist

Either create these files in .claude/rules/ or update the paths in lines 143-144 to reference existing documentation.

🤖 Prompt for AI Agents
In @.claude/skills/skill-developer/SKILL.md around lines 143 - 144, The SKILL.md
references two missing docs (.claude/rules/skill-development.md and
.claude/rules/mcp-scripts.md); either add those markdown files under
.claude/rules/ with the expected content or update the references in SKILL.md
(lines that call `cat $CLAUDE_CC_DIR/.claude/rules/skill-development.md` and
`cat $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md`) to point to the correct
existing file paths or filenames; ensure the referenced filenames exactly match
the created file names and commit the new files or the updated SKILL.md
references.

Comment on lines 870 to +872
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}"')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The setup wizard provides set command instructions for Windows, which is incorrect for PowerShell users and will cause environment variables not to be set correctly.
Severity: MEDIUM

Suggested Fix

Detect if the user is on Windows and provide PowerShell-specific instructions using $env:VARIABLE="value" for session variables and [Environment]::SetEnvironmentVariable("VARIABLE", "value", "User") for persistent variables. Alternatively, the script could provide instructions for both cmd.exe and PowerShell.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: opc/scripts/setup/wizard.py#L870-L872

Potential issue: The setup wizard prints instructions for setting environment variables
on Windows using the `set VARIABLE="value"` syntax. This is valid for `cmd.exe` but not
for PowerShell, which is a recommended shell for Windows users. In PowerShell, `set` is
an alias for `Set-Variable`, which only sets a session-local variable, not a persistent
environment variable. Consequently, when a PowerShell user follows these instructions,
the `CLAUDE_OPC_DIR` and `CLAUDE_CC_DIR` variables will not be available in subsequent
sessions or processes, causing skills that rely on these paths to fail at runtime.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills reference $CLAUDE_PROJECT_DIR/.claude/scripts/ but scripts are at ~/.claude/scripts/

1 participant