Installation Problems
Symptoms:
cortex-tms: command not found- npm/pnpm installation failures
- Permission errors (EACCES)
cortex-tms initfailures
Welcome to the Cortex TMS troubleshooting guide. This page provides a systematic approach to diagnosing and resolving common issues you might encounter when using Cortex TMS. Whether you are experiencing installation problems, validation errors, or AI agent integration issues, this guide will help you identify and fix the problem quickly.
Use this quick checklist to identify the category of your issue. Click on the relevant category to jump to detailed troubleshooting steps.
Installation Problems
Symptoms:
cortex-tms: command not foundcortex-tms init failuresValidation Errors
Symptoms:
cortex-tms validate fails.cortexrc configuration issuesAI Agent Issues
Symptoms:
Git Integration
Symptoms:
Quick Fix: Check git is installed: git --version
Problems that occur when installing or initializing Cortex TMS.
Common issues:
Full troubleshooting guide: Installation Issues →
Problems that occur when running cortex-tms validate.
Common issues:
Full troubleshooting guide: Validation Errors →
Problems with Claude Code, GitHub Copilot, or Cursor integration.
Common issues:
Full troubleshooting guide: AI Agent Issues →
Follow this systematic workflow to diagnose any Cortex TMS issue:
What exactly is failing? Be specific:
cortex-tms init shows error: EACCES: permission denied”cortex-tms validate reports: NEXT-TASKS.md exceeds 200 lines”Before diving into complex troubleshooting, verify these fundamentals:
Environment Check:
# Check Node.js version (requires 18.x or higher)node --version
# Check npm versionnpm --version
# Check cortex-tms installationcortex-tms --version
# Check git installation (required for init)git --version
# Verify you're in a project directorypwdExpected output:
v20.10.010.2.32.6.0git version 2.43.0/home/user/my-projectFile System Check:
# Check if mandatory files existls -la CLAUDE.md NEXT-TASKS.md .cortexrc
# Check file permissionsls -l CLAUDE.md
# Check directory structuretree -L 2 docs/Expected output:
-rw-r--r-- 1 user staff 2048 Jan 15 10:30 CLAUDE.md-rw-r--r-- 1 user staff 1024 Jan 15 10:30 NEXT-TASKS.md-rw-r--r-- 1 user staff 512 Jan 15 10:30 .cortexrc
docs/├── archive/│ └── sprint-2025-01.md└── core/ ├── ARCHITECTURE.md ├── PATTERNS.md └── DECISIONS.mdMost Cortex TMS commands support a --verbose flag for detailed output:
# Verbose initializationcortex-tms init --verbose
# Verbose validationcortex-tms validate --verbose
# Verbose migrationcortex-tms migrate --verboseExample verbose output:
$ cortex-tms validate --verbose
🔍 Cortex TMS Validation
Project Context: Git repository: Yes Package.json: Yes Package manager: pnpm Existing TMS files: NEXT-TASKS.md, CLAUDE.md, .cortexrc
Placeholder Replacements: [Project Name] → my-awesome-project [project-name] → my-awesome-project [Description] → A modern web application
📋 Mandatory Files ✓ NEXT-TASKS.md exists ✓ CLAUDE.md exists ✓ .github/copilot-instructions.md exists
⚙️ Configuration ✓ .cortexrc configuration exists
📏 File Size Limits (Rule 4) ✓ NEXT-TASKS.md is within size limits 150/200 lines ⚠ ARCHITECTURE.md exceeds recommended line limit Current: 650 lines | Limit: 500 lines | Overage: 150 lines
📊 Summary
Total Checks: 12 ✓ Passed: 10 ⚠ Warnings: 2 ✗ Errors: 0
✨ Validation passed! Your TMS project is healthy.Once you’ve identified the issue category, consult the relevant guide:
Installation Issues
npm/pnpm/yarn installation, command not found, permission errors, Windows issues
Validation Errors
File size limits, missing files, placeholder errors, .cortexrc issues
AI Agent Issues
Claude Code, GitHub Copilot, Cursor integration problems
Cortex TMS requires UTF-8 encoding for all files. Some editors save files with different encodings, causing parsing errors.
# Check file encoding (Linux/macOS)file CLAUDE.md
# Expected output:# CLAUDE.md: UTF-8 Unicode text
# Convert to UTF-8 if needediconv -f ISO-8859-1 -t UTF-8 CLAUDE.md -o CLAUDE.md# Check encodingfile *.md
# Convert all .md files to UTF-8for f in *.md; do iconv -f ISO-8859-1 -t UTF-8 "$f" -o "$f.utf8" mv "$f.utf8" "$f"done# Check encoding in PowerShell[System.Text.Encoding]::GetEncoding((Get-Content CLAUDE.md -Encoding Byte)[0..2])
# Convert to UTF-8 using VS Code# File → Save with Encoding → UTF-8If .cortexrc is causing errors, validate its JSON syntax:
# Validate .cortexrc JSON syntax (Node.js)node -e "console.log(JSON.parse(require('fs').readFileSync('.cortexrc', 'utf-8')))"
# Validate .cortexrc JSON syntax (Python)python3 -m json.tool .cortexrc
# Validate .cortexrc JSON syntax (jq)jq empty .cortexrcCommon JSON errors:
{ "version": "1.0.0", "scope": "standard", "paths": { "docs": "docs/core" }, // ❌ Trailing comma not allowed in JSON}Fix: Remove the trailing comma:
{ "version": "1.0.0", "scope": "standard", "paths": { "docs": "docs/core" }}{ version: "1.0.0", // ❌ Keys must be quoted scope: "standard"}Fix: Add quotes to all keys:
{ "version": "1.0.0", "scope": "standard"}{ "version": "1.0.0", "paths": { "docs": "docs/core" // ❌ Missing closing brace}Fix: Close all braces:
{ "version": "1.0.0", "paths": { "docs": "docs/core" }}Windows uses CRLF (\r\n) line endings while Linux/macOS use LF (\n). Git can auto-convert these, causing file size discrepancies.
# Check line endingsfile NEXT-TASKS.md
# Output (Windows CRLF):# NEXT-TASKS.md: ASCII text, with CRLF line terminators
# Output (Linux/macOS LF):# NEXT-TASKS.md: ASCII textFix:
# Set Git to auto-convert CRLF to LF on commitgit config --global core.autocrlf true
# Re-checkout files to apply conversiongit rm --cached -r .git reset --hardCreate .editorconfig in your project root:
root = true
[*]end_of_line = lfinsert_final_newline = truecharset = utf-8
[*.{js,ts,json,md}]indent_style = spaceindent_size = 2Most editors respect EditorConfig automatically.
# Convert CRLF to LF (Linux/macOS)dos2unix *.md
# Convert CRLF to LF (Windows Git Bash)sed -i 's/\r$//' *.mdIf Cortex TMS behaves erratically, perform a clean reinstall:
# Uninstall cortex-tmsnpm uninstall -g cortex-tms
# Clear npm cachenpm cache clean --force
# Reinstall cortex-tmsnpm install -g cortex-tms
# Verify installationcortex-tms --versionIf you have exhausted all troubleshooting steps and still encounter issues, here is how to get help:
cortex-tms --version and compare to latest releasecortex-tms validate --verbose and save the outputWhen filing a bug report, include:
Required information:
**Environment:**- OS: macOS 14.2 (or Windows 11, Ubuntu 22.04, etc.)- Node.js version: 20.10.0- npm version: 10.2.3- cortex-tms version: 2.6.0- Package manager: npm (or pnpm, yarn)
**Steps to reproduce:**1. Run `cortex-tms init --scope standard`2. Edit CLAUDE.md to add custom content3. Run `cortex-tms validate`4. Error occurs
**Expected behavior:**Validation should pass
**Actual behavior:**Error: ENOENT: no such file or directory, open '.cortexrc'
**Full error output:**(paste complete error message with stack trace)
**Additional context:**- Using Git version 2.43.0- Project is a TypeScript monorepo- Using pnpm workspacesOptional but helpful:
cortex-tms validate --verbose.cortexrc (sanitize sensitive data)GitHub Discussions:
GitHub Issues:
Documentation:
Avoid common issues by following these best practices:
Run Validation Regularly
Run cortex-tms validate before committing changes. Catch issues early before they compound.
# Add to pre-commit hookcortex-tms validate --strictKeep Files Under Limits
Archive completed tasks regularly. File size limits exist to keep AI context windows manageable.
Trigger: When NEXT-TASKS.md exceeds 150 lines, archive completed tasks.
Update Dependencies
Keep cortex-tms updated to get bug fixes and new features.
npm update -g cortex-tmsUse Version Control
Commit TMS files to Git. If something breaks, you can always revert to a working state.
git add CLAUDE.md NEXT-TASKS.md .cortexrcgit commit -m "docs: update TMS files"Document Custom Patterns
Update docs/core/PATTERNS.md when you establish new conventions. AI agents will follow them automatically.
Test AI Integration
After updating documentation, test AI agents to ensure they read the new content correctly.
Quick reference for diagnostic commands:
# Environment diagnosticsnode --version # Node.js versionnpm --version # npm versiongit --version # Git versioncortex-tms --version # Cortex TMS version
# File diagnosticsls -la CLAUDE.md NEXT-TASKS.md # Check files existfile CLAUDE.md # Check file encodingwc -l NEXT-TASKS.md # Count lines
# Validation diagnosticscortex-tms validate --verbose # Detailed validation outputcortex-tms validate --strict # Treat warnings as errors
# Configuration diagnosticscat .cortexrc # View configurationjq empty .cortexrc # Validate JSON syntaxnode -e "console.log(require('./.cortexrc'))" # Parse config in Node
# Git diagnosticsgit status # Check working treegit log --oneline -5 # Recent commitsgit config --list # Git configuration
# Package manager diagnosticsnpm list -g cortex-tms # Check global installationnpm cache clean --force # Clear npm cacheNow that you understand the troubleshooting workflow:
cortex-tms validate failures