Generates or updates a workspace-level CLAUDE.md file for multi-repository workspaces, providing navigation and context across primary repos, worktrees, dependencies, and reference materials.
Ships in agent-orchestration-and-meta-tooling. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Create or intelligently update a comprehensive workspace-level CLAUDE.md file that provides navigation, context, and development guidelines for multi-repository workspaces containing primary projects and auxiliary repositories.
Smart Mode Detection: This command automatically detects whether you need to create a new workspace CLAUDE.md or update an existing one, preserving your customizations while ensuring completeness and accuracy.
IMPORTANT: This command creates a WORKSPACE-LEVEL CLAUDE.md, which is fundamentally different from project-level CLAUDE.md files:
/init)This command is designed for a specific development pattern where workspaces contain:
project-686-feature, project-690-bugfix).
In jj-colocated repos (where .jj/ is present), parallel chains within the primary repo are handled by default via the diamond workflow's development join (see the jj-version-control skill's tiered-ceremony.md) rather than adjacent worktrees.
An adjacent worktree is still the right structure when something outside the session needs its own filesystem tree — an external agent framework, a long-running build, a side-by-side comparison — under the discipline in jj-version-control §"Worktree interop".workspace-root/
├── CLAUDE.md # Workspace-level navigation (created by this command)
├── primary-project/ # Main development repository
│ ├── CLAUDE.md # Project-specific instructions
│ └── [project files]
├── primary-project-686-feature/ # Git worktree for issue #686
│ └── CLAUDE.md # Worktree-specific context
├── primary-project-690-bugfix/ # Git worktree for issue #690
│ └── CLAUDE.md # Worktree-specific context
├── dependency-lib-1/ # Source code of key dependency
├── dependency-lib-2/ # Another dependency source
├── reference-papers/ # Related research and documentation
└── dev-tools/ # Development utilities
Usage: meta-create-workspace-agents-md [mode] [workspace-name] [primary-repo] [context]
| Parameter | Position | Options | Default | Description |
|---|---|---|---|---|
mode | 1 | create, update, auto | auto | Execution mode - create new, update existing, or auto-detect |
workspace-name | 2 | Any string | Auto-detected | Workspace name used in CLAUDE.md title and descriptions |
primary-repo | 3 | Repository name | Auto-detected | Primary development repository to prioritize |
context | 4 | Theme/description | None | Additional context for categorization and descriptions |
# Auto-detect everything (current behavior)
meta-create-workspace-agents-md
# Auto-detect with workspace name
meta-create-workspace-agents-md auto jax-workspace
# Force create new workspace documentation
meta-create-workspace-agents-md create
# Force create with full specification
meta-create-workspace-agents-md create ai-research-workspace langchain machine-learning
# Force update existing documentation
meta-create-workspace-agents-md update
# Update with additional context
meta-create-workspace-agents-md update planning-workspace docs-framework documentation
# Specify primary repo to help detection
meta-create-workspace-agents-md auto my-workspace pytorch deep-learning-research
The command processes arguments in order, with later parameters providing context for workspace analysis:
Mode Parameter: Determines execution strategy
create: Creates new CLAUDE.md (fails if exists)update: Updates existing CLAUDE.md (fails if missing)auto: Smart detection based on file existence (default)Workspace Name: Used for titles and descriptions instead of auto-detection
Primary Repository: Prioritized during repository identification phase
Context: Enhances repository categorization and cross-repository guidelines
You will generate or update a comprehensive workspace CLAUDE.md file using the enhanced parameter system with explicit mode control and contextual information.
CRITICAL FIRST STEP: Parse command arguments and validate execution mode:
# Parse arguments from $ARGUMENTS
ARGS=($ARGUMENTS)
MODE=${ARGS[0]:-"auto"} # Default to auto if not specified
WORKSPACE_NAME=${ARGS[1]:-""} # Will be auto-detected if empty
PRIMARY_REPO=${ARGS[2]:-""} # Will be auto-detected if empty
CONTEXT=${ARGS[3]:-""} # Optional additional context
echo "=== ARGUMENT PROCESSING ==="
echo "Mode: $MODE"
echo "Workspace Name: ${WORKSPACE_NAME:-'(auto-detect)'}"
echo "Primary Repository: ${PRIMARY_REPO:-'(auto-detect)'}"
echo "Context: ${CONTEXT:-'(none provided)'}"
# Check if CLAUDE.md exists
CLAUDE_EXISTS=false
if [ -f "CLAUDE.md" ]; then
CLAUDE_EXISTS=true
echo "Existing CLAUDE.md found: $(ls -la CLAUDE.md)"
else
echo "No existing CLAUDE.md found"
fi
Mode Validation Logic:
# Validate mode against file existence
case $MODE in
"create")
if [ "$CLAUDE_EXISTS" = true ]; then
echo "⊘ ERROR: CREATE mode specified but CLAUDE.md already exists"
echo " Use 'update' mode to modify existing file, or 'auto' for smart detection"
exit 1
fi
echo "● CREATE MODE: Will generate new CLAUDE.md"
EXECUTION_MODE="CREATE"
;;
"update")
if [ "$CLAUDE_EXISTS" = false ]; then
echo "⊘ ERROR: UPDATE mode specified but no CLAUDE.md found"
echo " Use 'create' mode to generate new file, or 'auto' for smart detection"
exit 1
fi
echo "● UPDATE MODE: Will analyze and update existing CLAUDE.md"
EXECUTION_MODE="UPDATE"
;;
"auto")
if [ "$CLAUDE_EXISTS" = true ]; then
echo "● AUTO MODE: Detected existing CLAUDE.md - switching to UPDATE"
EXECUTION_MODE="UPDATE"
else
echo "● AUTO MODE: No existing CLAUDE.md - switching to CREATE"
EXECUTION_MODE="CREATE"
fi
;;
*)
echo "⊘ ERROR: Invalid mode '$MODE'. Use 'create', 'update', or 'auto'"
exit 1
;;
esac
If no existing CLAUDE.md is found, follow these steps to create one from scratch:
First, gather comprehensive information about the workspace:
# Get current location
pwd
# List all directories
ls -la
# Find all git repositories (up to 2 levels deep)
find . -maxdepth 2 -name ".git" -type d | head -30
# Check for git worktrees
git worktree list 2>/dev/null || echo "No worktrees in current directory"
# For each git repository found, check if it's a worktree
for repo in $(find . -maxdepth 2 -name ".git" -type d | head -10); do
dir=$(dirname "$repo")
echo "Checking $dir:"
cd "$dir" && git worktree list 2>/dev/null | head -1 || git rev-parse --show-toplevel 2>/dev/null
cd - > /dev/null
done
Determine which repository is the primary development focus:
-686-, -690-)Classify each repository into categories, using provided parameters to enhance categorization:
# Use provided context to inform categorization
if [ -n "$CONTEXT" ]; then
echo "Using context '$CONTEXT' to enhance repository categorization"
fi
# Use primary repository hint if provided
if [ -n "$PRIMARY_REPO" ]; then
echo "Prioritizing '$PRIMARY_REPO' as primary development repository"
fi
Repository Categories:
projectname-###-description).md, .qmd, paper/, docs/)Enhanced Categorization with Context:
$CONTEXT to improve repository descriptions (e.g., "machine-learning" context emphasizes ML libraries)$PRIMARY_REPO in identification even if not the largest repositoryUse this concrete template, filling in the discovered information and provided parameters:
# Use provided workspace name or auto-detect
if [ -n "$WORKSPACE_NAME" ]; then
FINAL_WORKSPACE_NAME="$WORKSPACE_NAME"
else
# Auto-detect from directory name or primary repository
FINAL_WORKSPACE_NAME=$(basename "$(pwd)")
fi
echo "Using workspace name: $FINAL_WORKSPACE_NAME"
# $FINAL_WORKSPACE_NAME Workspace Context
## Working Directory Detection
**IMPORTANT**: This workspace contains both the main $PRIMARY_REPO repository and $WORKTREE_COUNT experimental git worktrees, along with $DEPENDENCY_COUNT dependency source repositories. Always check your working directory first:
### If Directed to Work in a Worktree (e.g., `$WORKTREE_EXAMPLE_1`, `$WORKTREE_EXAMPLE_2`)
**Reference the worktree's own CLAUDE.md file** which contains:
- Worktree-specific working directory context
- Correct path references for that worktree
- Branch-specific development instructions
- Complete project configuration (including this workspace context)
\```bash
# Check if you're in a worktree
pwd
# If you see: /Users/.../$WORKSPACE_NAME/$PRIMARY_REPO-NNN-*/
# (where NNN is an issue number like 686, 690, etc.)
# Then you're in a worktree - use that directory's CLAUDE.md file
\```
### If Working in Main Repository (`$PRIMARY_REPO/`)
- Use `$PRIMARY_REPO/CLAUDE.md` for development guidelines
- Continue with the information below for workspace context
### If Working at Workspace Root
- Use this file for workspace overview and cross-repository guidance
- Navigate to the appropriate project directory for specific development work
## Primary Repository
- **`$PRIMARY_REPO/`** - $PRIMARY_DESCRIPTION
- 📖 **See [`$PRIMARY_REPO/CLAUDE.md`]($PRIMARY_REPO/CLAUDE.md)** for $PRIMARY_GUIDELINES
## Git Worktrees (Experimental Branches)
These are git worktrees of the primary repository for parallel development:
$WORKTREE_SECTION
## Dependency Source Repositories
These contain the full source code and documentation for key dependencies:
### Core Dependencies
$CORE_DEPENDENCIES_SECTION
### Additional Libraries
$ADDITIONAL_LIBRARIES_SECTION
## Reference Materials & Documentation
$REFERENCE_SECTION
## Development Tools & Utilities
$TOOLS_SECTION
## Development Context Guidelines
### When Working with $PRIMARY_FRAMEWORK
$PRIMARY_FRAMEWORK_GUIDELINES
### When Working with Worktrees
1. **Check Branch Context**: Each worktree has its own branch and purpose
2. **Reference Worktree CLAUDE.md**: Use the specific CLAUDE.md in that worktree
3. **Maintain Isolation**: Changes in worktrees don't affect other worktrees
4. **Sync When Needed**: Pull changes from main branch when necessary
### Cross-Repository Usage Guidelines
#### When to Reference Dependencies
$DEPENDENCY_REFERENCE_GUIDELINES
#### Key Files to Check Across Repositories
- **Implementation examples**: Check `examples/`, `notebooks/`, or `demo/` directories
- **API patterns**: Look in dependency source for usage patterns
- **Configuration**: Review `pyproject.toml`, `package.json`, build configs
- **Testing patterns**: Examine `tests/` directories for testing approaches
- **Documentation**: Check `docs/`, README files, and inline documentation
#### Search Strategy
Use targeted searches across relevant repositories when:
$SEARCH_STRATEGY_SECTION
## Workspace Organization
\```
$WORKSPACE_NAME/
├── CLAUDE.md # This file - workspace navigation
├── $PRIMARY_REPO/ # Primary development repository
│ ├── CLAUDE.md # Project-specific instructions
│ └── [project structure]
│
├── $WORKTREE_PATTERN/ # Git worktrees for experiments
│ ├── CLAUDE.md # Worktree-specific context
│ └── [branch development]
│
├── [dependency-repos]/ # Source code of dependencies
│ └── [library source]
│
├── [reference-repos]/ # Documentation and references
│ └── [papers, tutorials]
│
└── [tool-repos]/ # Development utilities
└── [scripts, tools]
\```
### Path Reference Strategy
The workspace uses consistent path references:
1. **Absolute Paths (From Workspace Root)**:
- Used when instructing AI agents: `$PRIMARY_REPO/src/module.py`
- Cross-repository references: `dependency-lib/examples/usage.py`
2. **Relative Paths (Within Repositories)**:
- Internal documentation links: `../docs/api.md`
- Local file references: `./src/components/`
This approach ensures both clear AI agent instructions and maintainable documentation links.
CLAUDE.mdAfter creating the file, provide a summary including:
If an existing CLAUDE.md is found, follow these steps to intelligently update it while preserving customizations:
Read and parse the current workspace CLAUDE.md:
# Read the existing file completely
cat CLAUDE.md
# Check file size and structure
wc -l CLAUDE.md
grep -n "^#" CLAUDE.md | head -20
Extract key information from existing file:
Analyze actual workspace state (same as CREATE MODE):
# Get current workspace structure
pwd && ls -la
# Find all git repositories
find . -maxdepth 2 -name ".git" -type d | head -30
# Check worktree status
git worktree list 2>/dev/null || echo "No worktrees in current directory"
# Check each repository for key indicators
for repo in $(find . -maxdepth 2 -name ".git" -type d | head -15); do
dir=$(dirname "$repo")
echo "Analyzing $dir:"
cd "$dir"
echo " - Git status: $(git branch --show-current 2>/dev/null || echo 'not git')"
echo " - Worktree: $(git worktree list 2>/dev/null | wc -l || echo '0') entries"
echo " - README: $(ls README* 2>/dev/null || echo 'none')"
echo " - Config: $(ls package.json pyproject.toml Cargo.toml 2>/dev/null || echo 'none')"
cd - > /dev/null
done
Identify discrepancies between documented and actual workspace state:
Gap Analysis Process:
# Extract repository names from current CLAUDE.md
grep -o '\*\*`[^`]*`\*\*' CLAUDE.md | sed 's/\*\*`\([^`]*\)`\*\*/\1/' | sort > documented_repos.tmp
# Get actual repository directories
find . -maxdepth 2 -name ".git" -type d | dirname | sed 's|\./||' | sort > actual_repos.tmp
# Compare lists
echo "=== NEW REPOSITORIES (not documented) ==="
comm -13 documented_repos.tmp actual_repos.tmp
echo "=== OBSOLETE ENTRIES (documented but missing) ==="
comm -23 documented_repos.tmp actual_repos.tmp
echo "=== COMMON REPOSITORIES (need description verification) ==="
comm -12 documented_repos.tmp actual_repos.tmp
# Cleanup
rm -f documented_repos.tmp actual_repos.tmp
Identify user customizations to preserve:
Preservation Strategy:
Update approach using targeted edits:
Update Repository Sections:
Fix Structure Issues:
Maintain Navigation Logic:
Implementation using Edit tool:
# For each identified issue, use targeted edits
# Example: Add new repository to Dependencies section
Validate the updated content:
Apply final updates using Edit tool for precise modifications while preserving user content.
Provide comprehensive update summary:
If you encounter issues during creation:
If you encounter issues during updates:
If you encounter issues with provided arguments:
create, update, or auto
auto for smart detectionThe newly generated CLAUDE.md should:
The updated CLAUDE.md should:
● **Workspace CLAUDE.md Created Successfully**
**Mode**: CREATE - Generated new workspace documentation
**File**: `/[workspace-path]/CLAUDE.md`
**Size**: [file-size] lines
**Workspace Analysis:**
- **Name**: [workspace-name]
- **Primary Repository**: [primary-repo]
- **Total Repositories**: [count]
- **Worktrees Detected**: [worktree-count]
**Repository Categories:**
- **Primary Development**: [primary-repos]
- **Dependencies**: [dependency-count] repositories
- **Reference/Documentation**: [reference-count] repositories
- **Tools/Utilities**: [tools-count] repositories
**Key Features Added:**
✓ Working directory detection logic
✓ Repository categorization and descriptions
✓ Cross-repository usage guidelines
✓ Development workflow recommendations
✓ Path reference strategy
✓ Search and navigation instructions
**Next Steps:**
1. Review the generated CLAUDE.md for accuracy
2. Customize repository descriptions if needed
3. Add project-specific development patterns
4. Update individual repository CLAUDE.md files to reference workspace context
5. Consider creating specialized commands for common workflows
● **Workspace CLAUDE.md Updated Successfully**
**Mode**: UPDATE - Analyzed and improved existing documentation
**File**: `/[workspace-path]/CLAUDE.md`
**Size**: [old-size] → [new-size] lines
**Analysis Results:**
- **Repositories Analyzed**: [total-analyzed]
- **New Repositories Found**: [new-count]
- **Obsolete Entries Removed**: [removed-count]
- **Structure Issues Fixed**: [structure-fixes]
**Changes Made:**
✓ **Added [new-count] new repositories**:
- [list-of-new-repos]
✓ **Removed [removed-count] obsolete entries**:
- [list-of-removed-repos]
✓ **Updated descriptions** for [updated-count] repositories
✓ **Fixed structure issues**: [list-of-fixes]
✓ **Preserved customizations**: [custom-content-count] user sections maintained
**Content Preserved:**
- Custom repository descriptions: [preserved-count]
- User-added sections: [user-section-count]
- Workflow modifications: [workflow-mods]
- Personal notes and guidelines: [notes-count]
**Validation Results:**
✓ Working directory detection logic verified
✓ All repository references validated
✓ Navigation paths confirmed working
✓ Cross-repository guidelines updated
✓ Template structure compliance verified
**Next Steps:**
1. Review the updated content for accuracy
2. Test navigation logic with current workspace
3. Verify preserved customizations still apply
4. Update any remaining project-specific references
5. Consider documenting new repositories in more detail
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
workspace-configuration, claude-md, multi-repo, project-setup
/agent-orchestration-and-meta-tooling:meta-create-workspace-agents-md [mode] [workspace-name] [primary-repo] [context] | mode: create|update|auto, all optionalfrom agent-orchestration-and-meta-tooling
npx claudepluginhub cameronraysmith/vanixiets --plugin agent-orchestration-and-meta-toolingNone: SKILL.md is the whole skill.
19 skills in this plugin
/herdrControl herdr from inside it. Manage workspaces and tabs, split panes, spawn agents, read output, and wait for state changes — all via CLI commands that talk to the running herdr instance over a local unix socket. Use when running inside herdr (HERDR_ENV=1)./meta-agent-teamsAgent team orchestration conventions for persistent multi-agent coordination via shared task lists and messaging./meta-generate-context-testOther plugins' skills for the same job