This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run build- Compile TypeScript to dist/ and make executablenpm run dev- Watch TypeScript files for changes during developmentnpm run clean- Remove the dist directorynpm run link- Link the CLI globally for development testingnpm run prelink- Build before linking (runs automatically)
npm run parse-commands- Parse command markdown files to commands.jsonts-node scripts/parse-commands.ts- Direct script execution for command parsing
- No test framework configured yet (
npm testexits with error)
This is a TypeScript CLI tool for managing Claude commands, configurations, and workflows. The architecture follows a modular manager pattern:
Main Entry Points:
src/index.ts- CLI entry point with command-line argument parsingsrc/cli.ts- Interactive CLI interface (ClaudeCommandCLIclass)
Core Services:
FileSystemManager(src/core/filesystem.ts) - Handles all file operations, directory managementClaudeCommandAPI(src/core/api.ts) - API abstraction for command fetching with caching- Command managers in
src/commands/- Specialized managers for different features
Manager Pattern: Each feature area has its own manager class:
CommandManager- Command installation, search, deletionClaudeMdManager- CLAUDE.md file managementPermissionsManager- Security and permissionsMCPManager- Model Context Protocol serversWorkflowManager- Command workflowsSettingsManager- Configuration managementProjectManager- Project initializationHelpManager- Documentation and help
Hierarchical Configuration:
- Global:
~/.claude/settings.json - Project:
./.claude/settings.json - Local overrides:
./.claude/settings.local.json
Directory Structure:
~/.claude/- Global Claude configuration~/.claude/commands/- Installed commands./.claude/- Project-specific configurationcommands/- Command templates (markdown files)dist/- Compiled output
Command Sources:
- Remote repository: GitHub raw URLs (default)
- Local repository:
commands/commands.json(via --local flag) - 184+ commands available in remote repository
Command Format:
- Commands stored as markdown files
- Parsed to JSON format via
parse-commandsscript - Organized by category (agent, analyze, code, context, docs, git, etc.)
API Design:
- Uses environment variable
CLAUDE_CMD_URLfor command source override - Supports both URL and local file paths
- 5-minute caching for remote command data
Navigation:
- Uses
@inquirer/promptsfor interactive CLI - Global navigation utilities in
utils/navigation.ts - Breadcrumb navigation for submenus
Error Handling:
- Colorized output via
utils/colors.ts - Graceful error handling with user-friendly messages
- Target: ES2022
- Module: CommonJS
- Strict mode enabled
- Path aliases:
@/typesmaps to./src/types - Source maps and declarations enabled
src/index.ts- Entry point and CLI argument parsingsrc/cli.ts- Main interactive interfacesrc/commands/command-manager.ts- Core command management logicsrc/core/filesystem.ts- File system operationssrc/core/api.ts- API and data fetchingcommands/commands.json- Command definitions (generated)scripts/parse-commands.ts- Command parsing logic