Troubleshooting your Command Code

Common issues and solutions for Command Code. If you can't find what you're looking for here, check the FAQs or Error Codes pages.


Command not found after install

Problem: Running cmd returns "command not found"

Solution:

  1. Verify the install succeeded:

    > npm list -g command-code ~/.nvm/versions/node/v<node-version>/lib └── command-code@<command-code-version>
  2. Ensure your global node_modules/.bin is in your PATH:

    npm config get prefix

    The binary directory is <prefix>/bin. Add that to your PATH if it's not already there.

  3. Restart your terminal or source your shell profile:

    source ~/.bashrc # or ~/.zshrc

Login fails or session expired

Problem: cmd login fails or you get unauthorized errors

Solution:

  1. Log out and log back in:

    cmd logout cmd login
  2. Clear cached credentials and retry:

    rm -rf ~/.commandcode/auth.json cmd login
  3. Check that your account is active on Command Code Studio

See also: Unauthorized error

API key or provider issues

Problem: Errors related to API keys or provider authentication

Solutions:

  1. Verify your provider is configured correctly. See Providers
  2. Check your API key is valid and has not expired
  3. Ensure your plan has not exceeded its usage limits. See Usage exceeded

Chrome Local Network Access (LNA) prompt when logging in

Problem: Chrome shows a permission prompt saying a site wants to access devices on your local network during cmd login.

This happens because Command Code runs a temporary local server (e.g. localhost:PORT) to receive the OAuth callback after you authorize in the browser. Chrome's Local Network Access (LNA) feature treats this as a request from a public website to a local network resource and shows a permission prompt.

This is part of Chrome's effort to protect users from cross-site request forgery (CSRF) attacks targeting devices on private networks.

Solutions:

  1. Allow the request — Click "Allow" when Chrome shows the LNA prompt. This is perfectly safe because the local server is started by Command Code on your machine to complete the authentication flow.

The prompt during Command Code auth is expected behavior and safe to allow.


Server won't connect

Problem: MCP server shows a red indicator or fails to connect

Solutions:

  1. Verify the server config:

    cmd mcp get <server-name>
  2. For stdio servers, ensure the command is installed and in your PATH

  3. Use /mcp inside a session to see the specific error message

Authentication with MCP servers

Problem: OAuth or token issues with an MCP server

Solutions:

  1. Re-authenticate:

    cmd mcp auth <server>
  2. Clear and retry:

    cmd mcp auth --clear <server> cmd mcp auth <server>
  3. Check token status:

    cmd mcp auth --status <server>

See the full MCP documentation for more details.


Learn how to troubleshoot issues with Agent Skills in Command Code.

Problem: Skills don't show up in the menu

Solutions:

  1. Check directory structure:

    ls ~/.commandcode/skills/ ls .commandcode/skills/
  2. Verify SKILL.md exists:

    cat ~/.commandcode/skills/my-skill/SKILL.md
  3. Validate frontmatter format:

    --- name: my-skill description: A description ---
  4. Check for YAML syntax errors (missing quotes, invalid characters)

  5. Ensure description is ≤1024 characters

Problem: Pressing Enter in /skills doesn't open the file

Solutions:

  1. Check $EDITOR is set:

    echo $EDITOR
  2. Set $EDITOR if missing (see Setting up your editor)

  3. Verify editor is in PATH:

    which code # or your editor

Problem: Command Code doesn't use a skill even though it's relevant

Solutions:

  1. Make the description more specific with keywords:

    # Better description: Unit testing with Vitest. Use when writing tests, test files, or when user mentions testing, test coverage, or Vitest. # Less effective description: Testing
  2. Ensure the skill instructions are clear and actionable

  3. Ask Command Code explicitly: "Use the testing-patterns skill to write tests"


Slow responses

Problem: Command Code takes a long time to respond

Solutions:

  1. Check your internet connection
  2. If using MCP servers, disconnect any that are not needed — they add overhead
  3. Keep your prompts focused — shorter, specific prompts get faster responses
  4. Check your model provider for any ongoing incidents

High token usage

Problem: Running out of usage faster than expected

Solutions:

  1. Review your usage in Command Code Studio
  2. Use headless mode for scripted tasks to avoid unnecessary back-and-forth
  3. Use plan mode to agree on an approach before writing code
  4. See Pricing Limits for plan details

If you're still stuck, here's how to get help:

  • Discord community: Join our Discord to ask questions and get help from the team and other users
  • GitHub issues: Report bugs or request features on GitHub
  • Email support: Reach out to support@commandcode.ai for account or billing issues
  • Error codes: Check the Error Codes reference for specific error resolution steps
  • FAQs: Browse the FAQs for quick answers to common questions