A command management system for Claude Code that enables you to create and update custom slash commands directly from within Claude Code.
The core feature of cc-commands is that it includes commands to manage commands themselves:
/g:command:create- Create new commands without leaving Claude Code/g:command:update- Update existing commands using the latest best practices
This means you can build your command library iteratively while working, without ever leaving your Claude Code session!
In Claude Code, slash commands use colon (:) separators, not slashes:
- ✅ Correct:
/g:command:create - ❌ Wrong:
/g/command/create
The file system uses slashes (.claude/commands/g/command/create.md), but when invoking commands in Claude Code, always use colons.
From your project root (where .claude directory exists):
curl -fsSL https://raw.githubusercontent.com/LongTermSupport/cc-commands/main/setup.sh | bashThis installs the complete command system including:
- Command management tools (
/g:command:create,/g:command:update,/g:command:sync) - GitHub integration tools (
/g:gh:issue:plan,/g:gh:push) - Workflow planning tools (
/g:w:plan)
-
Clone this repository into your
.claudedirectory:git clone git@github.com:LongTermSupport/cc-commands.git .claude/cc-commands
-
Create a symlink for the global commands:
ln -s "$(pwd)/.claude/cc-commands/export/commands/g" .claude/commands/g -
Add cc-commands to your
.claude/.gitignore:echo "cc-commands/" >> .claude/.gitignore
Once installed, you can create commands in two ways:
Type /g:command:create and answer the prompts:
You: /g:command:create
Claude: Please provide:
1. Command name (use : for namespacing, e.g., git:commit, db:migrate)
2. Primary purpose (one clear sentence)
3. Makes changes? (yes/no)
Pass all requirements at once:
You: /g:command:create test:integration "Run integration tests with database setup. Should set up test database, run all integration tests, and clean up after. Needs mysql and phpunit."
Claude: [Creates the command immediately with all requirements]
The format is: /g:command:create [name] "[full requirements description]"
Your new command is instantly available and supports similar patterns!
Update existing commands with new features or improvements:
/g:command:update test:integration
/g:command:update test:integration "Add support for running specific test files as arguments. Also add a --coverage flag to generate code coverage reports."
The update process:
- Reads the existing command
- Extracts core functionality
- Applies your requested changes
- Regenerates using latest best practices
- Preserves existing behavior while adding new features
Pre-installed commands available to all projects:
/g:command:create- Create new commands with best practices and safety features/g:command:sync- Synchronize cc-commands repository with intelligent commit generation/g:command:update- Update existing commands to latest standards while preserving functionality
/g:gh:issue:plan- Create comprehensive plans from GitHub issues/g:gh:project:summary- Generate project summaries from GitHub repository data/g:gh:push- Smart Git push with GitHub Actions monitoring and failure diagnosis
/g:w:execute- Execute previously created plans with workflow-based approach and status verification/g:w:plan- Generate comprehensive project plans with progress tracking
/g:symfony:create:command- Create new Symfony console commands with best practices
Organize your commands with meaningful namespaces:
/db:migrate- Database operations/test:unit- Run unit tests/test:integration- Run integration tests/deploy:staging- Deploy to staging/git:release- Create a release
All commands in the cc-commands repository include:
- Bash permission system - Commands declare what bash commands they need with risk categorization
- Fail-fast validation - Comprehensive precondition checks with clear error messages
- User confirmations - For any destructive operations with detailed impact explanations
- Non-interactive commands only - Prevents hanging on user input with Task blocks for interaction
- Error recovery guidance - Specific instructions for common failure scenarios
- Progress tracking - Clear status updates with structured output formats
- Error handling - Graceful failures with recovery instructions and troubleshooting steps
- Documentation - Each command is self-documenting with comprehensive
--helpsupport - Project integration - Commands can reference and analyze your project's documentation
- Flexible invocation - Support both interactive and full argument modes for efficiency
- GitHub integration - Native support for GitHub CLI and Actions monitoring
- Full argument support - Pass all requirements at invocation time for automation
- Interactive fallback - Prompts for missing information with intelligent defaults
- Tool restrictions - Commands only get access to tools they need for security
- Workflow patterns - Dry-run modes, progressive execution, real-time monitoring
- Smart commit generation - Automatic commit message creation based on actual changes
- Repository synchronization - Built-in sync capabilities for sharing commands across projects
All commands support the --help argument:
/g:command:create --help
/g:command:update --help
/g:gh:issue:plan --helpHelp documentation includes:
- Description and purpose
- Usage patterns
- Available arguments
- Examples
- Preconditions
- Safety notes
You: /g:command:create
Claude: Please provide:
1. Command name: db:reset
2. Primary purpose: Reset database to clean state with test data
3. Makes changes? yes
Claude: [Gathers more requirements about preconditions, safety checks, etc.]
Claude: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ BASH COMMAND PERMISSIONS REQUIRED ⚠️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Your command requires permission to execute:
🟡 MEDIUM RISK (2 commands):
• mysql - Database queries
• php - Run migrations
Do you approve these permissions? (yes/no)
You: yes
Claude: [Creates the command with all safety checks and best practices]
Claude Code is Anthropic's official CLI coding assistant. It enables:
- Interactive coding sessions with Claude
- File system access and modification
- Running commands and scripts
- Custom workflows via slash commands
Learn more:
- Start simple - Create basic commands first, then enhance them
- Use namespaces - Organize related commands (e.g., all test commands under
test:) - Document assumptions - Be clear about what your command expects
- Test thoroughly - Run your commands in different scenarios
- Share useful ones - Submit PRs to add helpful commands to the global namespace
The cc-commands repository is actively maintained. To get the latest updates:
/g:command:syncThis command:
- Commits any local changes you've made
- Pulls the latest updates from the repository
- Pushes your changes to share with other projects
- Handles merge conflicts gracefully
To see all available commands:
find .claude/commands -name "*.md" | sed 's|.claude/commands/||' | sed 's|\.md$||' | sed 's|/|:|g'- Check syntax - use colons:
/g:command:createnot/g/command/create - Verify installation:
ls -la .claude/commands/g
- Check permissions - ensure your
.claude/settings.local.jsonallows required bash commands - Restart Claude Code - new commands need session restart for tab completion
- Permission denied: Check bash permissions in
.claude/settings.local.json - Command not found: Verify symlink exists:
ls -la .claude/commands/g - Git issues: Ensure you have push access to the cc-commands repository
- Sync failures: Check network connection and GitHub authentication
Every command supports detailed help:
/g:command:create --help
/g:command:sync --help
/g:gh:push --helpTo contribute global commands:
- Fork this repository
- Use
/g:command:createto create your command locally - Test it thoroughly
- Copy it to the appropriate location in
export/commands/g/ - Submit a PR
GitHub: https://github.com/LongTermSupport/cc-commands
MIT License - Feel free to use, modify, and share!
- Issues: GitHub Issues
- Claude Code Docs: docs.anthropic.com
- Slash Commands Guide: Claude Code Slash Commands
To contribute global commands:
- Fork this repository
- Use
/g:command:createto create your command locally - Test it thoroughly in different scenarios
- Use
/g:command:syncto commit and share your changes - Submit a PR with your new command
All contributions should follow the established patterns and include comprehensive help documentation.
Building better Claude Code workflows, one command at a time. 🚀