Listing commands
Most useful in daily development
Example workflow for Laravel or microservice project
Best commands for your type of work
Claude Code Commands with Practical Coding Usage
Practical Daily Workflow for Laravel Project
Listing commands
| No. | Claude Command | Use |
| --: | --------------------- | --------------------------------------------------- |
| 1 | `/init` | Create initial `CLAUDE.md` project instruction file |
| 2 | `/memory` | Add or edit long-term project instructions |
| 3 | `/clear` | Clear current conversation context |
| 4 | `/compact` | Compress long conversation context |
| 5 | `/context` | Check current context usage |
| 6 | `/usage` | Check token/usage details |
| 7 | `/model` | Change Claude model |
| 8 | `/effort` | Adjust reasoning effort |
| 9 | `/plan` | Ask Claude to first make a plan before coding |
| 10 | `/review` | Review current code changes |
| 11 | `/permissions` | Manage what Claude can read/write/run |
| 12 | `/agents` | Create or manage specialized agents |
| 13 | `/mcp` | Manage MCP servers/tools |
| 14 | `/resume` | Continue old Claude Code conversation |
| 15 | `/help` | Show help and available commands |
| 16 | `/status` | Show current Claude Code session status |
| 17 | `/doctor` | Diagnose Claude Code setup issues |
| 18 | `/config` | View or update Claude Code configuration |
| 19 | `/login` | Login/authenticate Claude Code |
| 20 | `/logout` | Logout from Claude Code |
| 21 | `/update` | Update Claude Code |
| 22 | `/bug` | Report bug or issue |
| 23 | `/vim` | Enable/disable Vim mode |
| 24 | `/terminal-setup` | Configure terminal integration |
| 25 | `/install-github-app` | Install GitHub integration |
| 26 | `/cost` | Check estimated session cost |
| 27 | `/export` | Export conversation/session |
| 28 | `/ide` | Connect or manage IDE integration |
| 29 | `/hooks` | Manage hooks for automated actions |
| 30 | `/plugins` | Manage plugins/extended features |
Most useful in daily development
For normal IT project work, these are the commands you will use again and again:
/init
/plan
/review
/clear
/compact
/memory
/permissions
/agents
/model
/resume
Example workflow for Laravel or microservice project
claude
/init
/plan
Then ask:
Read the project structure and CLAUDE.md.
Analyze the bug first.
Do not change code until you explain the root cause.
After approval, implement safely and show files changed.
After long work:
/compact
/review
For a fresh task:
/clear
Best commands for your type of work
For your Laravel, Keycloak, Git, and microservice projects, the most important commands are:
/init
/memory
/plan
/review
/permissions
/compact
/clear
/agents
/mcp
/resume
These help Claude Code follow project rules, avoid unnecessary changes, review code safely, and continue work without losing important context.
Claude Code Commands with Practical Coding Usage
/init
Use this when starting Claude Code inside a new project.
cd /opt/lampp/htdocs/motoshare.asia/motoshare-web
claude
/init
It creates a CLAUDE.md file. This file tells Claude about your project rules.
Example instruction to add in CLAUDE.md:
# Project Rules
- This is a Laravel microservice.
- Do not change production .env.
- Do not run migration without permission.
- Before code changes, analyze the issue first.
- After changes, run php -l and git diff.
Best use:
Read CLAUDE.md first. Understand project structure. Do not edit code yet. First explain the issue and implementation plan.
2. /memory
Use this when you want Claude to remember project-level rules.
/memory
Practical example:
Remember: In this project Keycloak is the central identity provider. Use keycloak_user_id for ownership. Do not use email as primary owner except fallback.
Useful for:
Laravel microservices
Keycloak rules
Git workflow
Testing rules
Production safety rules
- /clear
Use this when one task is finished and you want a fresh session.
/clear
Example:
You fixed login issue. Now you want to work on sitemap issue.
/clear
Then start fresh:
Now analyze sitemap generation issue in this Laravel project. Read routes, controllers, and services first.
/clear resets the conversation context, while previous sessions can still be resumed separately depending on setup.
4.** /compact**
Use this when conversation becomes too long but you do not want to lose important context.
/compact
Better practical usage:
/compact Keep only Laravel auth flow, changed files, error root cause, and pending test checklist.
Use when:
Long debugging session
Large microservice analysis
Many files changed
Claude starts forgetting earlier instructions
Claude docs describe /compact as a way to compact conversation history.
5./context
Use this to check how much context Claude is using.
/context
Practical use:
Before starting new feature, run /context. If context is high, run /compact.
Example workflow:
/context
/compact Keep current bug, changed files, and pending commands.
- /usage
Use this to check token or usage details.
/usage
Practical use:
Use this during long coding sessions to understand usage before continuing with large refactoring.
- /model
Use this to switch Claude model.
/model
Practical example:
For normal coding:
Use faster model for reading files and simple edits.
For complex bug:
Switch to stronger reasoning model for Passport/Keycloak auth debugging.
Example workflow:
/model
Then select the model available in your Claude Code setup.
- /effort
Use this to control reasoning depth.
/effort
Practical usage:
For simple UI change:
Low/medium effort is enough.
For complex production bug:
Use high effort. Analyze root cause before edit.
Example prompt:
Use high reasoning effort. This is a production Laravel Passport issue. Do not guess. Trace route, middleware, config, and token generation flow.
- /plan
Use this before allowing Claude to edit files.
/plan
Practical example:
Plan the fix for Keycloak logout issue across core, doctor, and hospital microservices. Do not modify files. Give step-by-step implementation plan first.
Very useful for:
Production bug fixing
Security changes
Database migration
Microservice integration
Large refactoring
- /review
Use this after Claude changes code.
/review
Practical example:
Review all current code changes. Check for security issues, broken routes, missing validation, and Laravel best practices.
Use before commit:
/review
git diff --stat
git diff
- /permissions
Use this to control what Claude can do.
/permissions
Practical use:
Allow safe commands:
php -l
git diff
git status
composer dump-autoload
php artisan route:list
Block risky commands:
php artisan migrate
rm -rf
git push
composer update
Example project safety rule:
Claude can edit files and run read-only commands. Claude must ask before running migration, delete, push, or production cache commands.
- /agents
Use this to create specialized agents for different tasks.
/agents
Practical examples:
Laravel Security Reviewer
Frontend UI Reviewer
Database Migration Reviewer
DevOps Deployment Checker
SonarQube Issue Fixer
Example agent instruction:
Create a Laravel Security Reviewer agent. It should check validation, authorization, CSRF, mass assignment, SQL injection, file upload, and ownership logic.
Claude docs mention /agents for managing subagents that can help with delegated tasks.
- /mcp
Use this to manage MCP tools.
/mcp
Practical use:
Connect GitHub MCP
Connect database MCP
Connect browser testing MCP
Connect documentation MCP
Example:
Use MCP to inspect GitHub issue, then analyze related Laravel files locally.
MCP is useful when Claude needs external tools or connected services.
- /resume
Use this to continue an older Claude Code session.
/resume
Practical example:
Yesterday you worked on Keycloak implementation. Today:
/resume
Then:
Continue from previous Keycloak ownership fix. Show pending tasks and files already modified.
- /help
Use this when you forget available commands.
/help
Practical use:
Check command list inside your installed Claude Code version.
Because available slash commands can depend on version and configuration, /help or typing / is the safest way to confirm.
- /status
Use this to check Claude Code session status.
/status
Practical use:
Check current model, account, version, and connection status.
Use when:
Claude Code behaves strangely
Wrong model selected
Login issue
Session not connected
- /doctor
Use this to diagnose Claude Code installation problems.
/doctor
Practical use:
Claude Code not opening
Auth problem
Permission issue
Node/npm issue
Terminal integration problem
Example:
claude
/doctor
Then follow the diagnostic output.
- /config
Use this to open or update Claude Code configuration.
/config
Practical use:
Change default model
Change approval behavior
Change editor setting
Check tool configuration
- /login
Use this to authenticate Claude Code.
/login
Practical use:
New laptop setup
Server setup
Claude Code logged out
Token expired
Example:
claude
/login
- /logout
Use this to logout from Claude Code.
/logout
Practical use:
Shared machine
Compromised laptop
Changing account
Security cleanup
Example:
claude
/logout
- /update
Use this to update Claude Code.
/update
Practical use:
Get latest bug fixes
New slash commands
Improved agent support
MCP improvements
Before updating on production server, prefer doing it on local machine first.
- /bug
Use this to report a Claude Code bug.
/bug
Practical use:
Claude Code crashes
Tool call fails repeatedly
Wrong file editing behavior
Terminal issue
Example:
Report this issue: Claude Code freezes after reading large Laravel log file.
- /vim
Use this if you prefer Vim-style editing.
/vim
Practical use:
Enable Vim mode in Claude Code input.
Useful for developers already comfortable with Vim navigation.
- /terminal-setup
Use this for terminal integration.
/terminal-setup
Practical use:
Configure shell integration
Improve command execution
Fix terminal shortcut behavior
Example:
claude
/terminal-setup
- /install-github-app
Use this to connect Claude Code with GitHub.
/install-github-app
Practical use:
Review PRs
Work with GitHub issues
Understand repository history
Create better commit/PR summaries
Example workflow:
Read GitHub issue #42. Analyze related code. Prepare fix locally but do not push.
- /cost
Use this to check estimated session cost.
/cost
Practical use:
Useful during long refactoring or multi-hour debugging.
Example:
/cost
Then decide whether to continue, compact, or start fresh.
- /export
Use this to export a Claude Code conversation.
/export
Practical use:
Save bug investigation
Share debugging report with team
Create documentation from session
Keep record before clearing context
Example:
/export keycloak-auth-debug-report.md
- /ide
Use this to connect or manage IDE integration.
/ide
Practical use:
Connect Claude Code with VS Code or supported IDE.
Useful when:
You want Claude to understand open files
You want smoother code navigation
You want IDE-based development workflow
- /hooks
Use this to manage automated hooks.
/hooks
Practical use:
Run commands automatically after edits.
Example hook idea:
After editing PHP files, run php -l.
Before final answer, run git diff --stat.
After changing routes, run php artisan route:list.
This is useful for maintaining quality in Laravel projects.
- /plugins
Use this to manage plugins or extended features.
/plugins
Practical use:
Enable extra Claude Code capabilities
Manage installed extensions
Add workflow-specific tools
Practical Daily Workflow for Laravel Project
Use this workflow when fixing bugs in a Laravel microservice:
cd /opt/lampp/htdocs/project-name
claude
/init
/permissions
/plan
Then give this prompt:
Read CLAUDE.md and project structure.
Task:
Fix the login issue where users are redirected incorrectly after Keycloak login.
Rules:
- Do not change .env.
- Do not run migration.
- Do not push code.
- First analyze routes, middleware, controller, and config.
- Explain root cause before editing.
- After editing, run php -l and git diff --stat.
After Claude makes changes:
/review
Then ask:
Review all changed files. Check security, route compatibility, fallback behavior, and production risk.
Finally:
git status
git diff --stat
git diff
Practical Workflow for Git Conflict or
Top comments (0)