claude-cli
Files
Install
npx skills add alisonaquinas/llm-shared-skills --skill 'claude-cli' -g -y
/plugin install shared-skills@llm-skills
npx skills when you only want this skill, or install the bundle once to make every included skill available through the plugin marketplace flow. Browse the full skill bundle repository at github.com/alisonaquinas/llm-shared-skills.Invoke
/shared-skills:claude-cli
SKILL.md
name: claude-cli description: "Use when the user wants to install, set up, update, configure, manage, or troubleshoot the Claude Code CLI tool. Triggers include install claude code, update claude, claude command not found, set up CLAUDE.md, configure permissions, add an MCP server, claude won't start, change the model, set up hooks, run claude non-interactively, pipe to claude, resume a session, or any hands-on operational task with the claude CLI binary. For documentation lookups use claude-cli-docs."
Claude CLI
Operational skill for installing, configuring, managing, and troubleshooting the
claude CLI binary. For deep documentation lookups, use the claude-cli-docs skill.
Intent Router
| Task | Action |
|---|---|
| Install / first run | See Install below |
| Update | See Update below |
| Auth / login issues | See Auth below |
| Configure CLAUDE.md | See Configuration below |
| Permissions & tools | See Permissions below |
| MCP servers | See MCP below |
| Non-interactive / scripting | See Scripting below |
| Troubleshooting | See Troubleshooting below |
| Advanced / docs lookup | Use claude-cli-docs skill |
Quick Start
claude --version || claude doctor
claude auth status --text
claude update
claude -p "summarize this repository"
If the task asks for exact flags or evolving behavior, switch to claude-cli-docs and verify the current docs before answering.
Install
# macOS / Linux / WSL (recommended — auto-updates)
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell (auto-updates)
irm https://claude.ai/install.ps1 | iex
# Windows CMD (auto-updates)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
# Homebrew (does NOT auto-update)
brew install --cask claude-code
# Homebrew latest channel (does NOT auto-update)
brew install --cask claude-code@latest
# WinGet (does NOT auto-update)
winget install Anthropic.ClaudeCode
Native Windows works in PowerShell or CMD. Git for Windows is recommended so the Bash tool is available; WSL2 is better when Linux-native tooling or sandboxing is required.
First run:
cd your-project
claude # prompts for login on first use
Update
Native installs (curl/PowerShell) auto-update in the background. Manual update:
# Native installer
claude update
# Homebrew
brew upgrade claude-code
brew upgrade claude-code@latest
# WinGet
winget upgrade Anthropic.ClaudeCode
# Check current version
claude --version
claude doctor
Auth
Login is prompted automatically on first run. To re-authenticate:
claude auth login # opens browser to log in
claude auth login --console # Anthropic Console billing/API usage
claude auth login --sso # force SSO flow
claude auth logout # sign out
claude auth status # JSON status; add --text for human-readable output
For long-lived CI tokens:
claude setup-token
For API-key, Bedrock, Vertex, or Microsoft Foundry setup, use claude-cli-docs.
Configuration
CLAUDE.md
CLAUDE.md at the project root (or ~/.claude/CLAUDE.md for global defaults) is read
at the start of every session. Put coding standards, build commands, and conventions here.
# My Project
## Commands
- Build: `npm run build`
- Test: `npm test`
## Conventions
- TypeScript strict mode
- Tests required for all public APIs
Claude walks up from the current directory to find CLAUDE.md files.
Settings file
~/.claude/settings.json controls global defaults (model, permissions, hooks, etc.).
For the full settings schema, use claude-cli-docs or visit
https://code.claude.com/docs/en/settings.
Permissions
claude --permission-mode acceptEdits # auto-approve file edits, prompt for commands
claude --permission-mode auto # auto mode classifier
claude --permission-mode dontAsk # avoid interactive permission prompts
claude --permission-mode bypassPermissions # skip all prompts (use with care)
claude --permission-mode plan # plan mode: propose changes, don't apply
Restrict or expand which tools are available:
claude --allowedTools Bash,Read,Write
claude --disallowedTools Bash
MCP
Add an MCP server interactively:
claude mcp add <name> -- <command> [args...]
# Example: local stdio server
claude mcp add my-server -- node /path/to/server.js
# Add from npm
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /tmp
List / remove servers:
claude mcp list
claude mcp remove <name>
For full MCP configuration options, use claude-cli-docs.
Scripting
Non-interactive (CI/automation) usage:
# Print mode — outputs to stdout, no interaction
claude -p "explain this function"
# Pipe input
echo "what does this do?" | claude -p
git diff main | claude -p "summarize these changes"
# Limit agentic turns
claude -p --max-turns 5 "fix the failing tests"
# Output as JSON
claude -p --output-format json "list all API endpoints"
# Resume a session
claude --continue # resume most recent
claude --resume <session-id> # resume by ID
# Faster scripted call: skip auto-discovery of hooks, skills, plugins, MCP, memory
claude --bare -p "summarize this repo"
# One-off extra instructions while preserving built-in behavior
claude -p --append-system-prompt "Use terse bullet points" "review this diff"
Troubleshooting
| Symptom | Fix |
|---|---|
command not found: claude | Re-run the install script; check $PATH |
| Login loop / auth fails | claude auth logout then claude auth login |
| Slow / no response | Check internet connection; try --verbose |
| Model not available | Verify subscription tier; use --model to override |
| Wrong CLAUDE.md loaded | Run claude --verbose to see which files are loaded |
| MCP server not connecting | claude mcp list; check server logs with --verbose |
| Permission denied on files | Check --allowedTools / --disallowedTools flags |
| Hooks not firing | Verify settings with /hooks; use --debug "hooks" |
Enable verbose logging for any issue:
claude --verbose "your task here"
claude --debug "api,mcp,hooks" "your task here"
Official troubleshooting page: https://code.claude.com/docs/en/troubleshooting
For issues not covered here, use the claude-cli-docs skill to look up the relevant documentation page.