Execute commands directly in Bash mode without consuming tokens - fast and economical:
# Type in Claude Code
> /bash
# After entering Bash mode, execute commands directly
$ ls -la
$ git status
$ npm install
💡 Bash mode is suitable for simple commands, complex operations still need AI assistance
Press Shift + Tab to toggle auto-accept edit feature:
Press Shift + Tab, see "auto-accept edits on"
Claude Code will automatically create and edit files without manual confirmation
Press Shift + Tab again to turn off the feature
Compared to --dangerously-skip-permissions, this feature is safer, limited to file editing permissions only.
Press Shift + Tab twice to enter plan mode:
plan mode on
Claude will first create a detailed plan:
1. Analyze requirements
2. Design architecture
3. List implementation steps
4. Estimate time
Execute? [Y/n]
Process multiple files at once:
"Please perform the following operations on all .js files in src/ directory:
1. Convert to TypeScript
2. Add type annotations
3. Fix ESLint errors"
Use @ symbol to quickly locate code:
@Button.tsx has issues with onClick handler, please fix
@api/* add error handling to all API files
@**/*.test.ts run all test files
> /clear
# Clear current session context
> /compact
# Compress lengthy conversation history
> /save context-name
# Save current context for later use
Create code generation templates:
"Generate 5 page components based on the following template:
- Layout: Two-column
- Feature: List display
- Style: Use Tailwind
Page names: Users, Products, Orders, Comments, Settings"
"Refactor UserService class:
1. Split into smaller modules
2. Apply SOLID principles
3. Add unit tests
4. Maintain backward compatibility"
"Analyze performance bottlenecks in @pages/Dashboard.tsx:
1. Identify re-rendering issues
2. Find memory leaks
3. Optimize large data rendering
4. Provide specific optimization solutions"
"Generate complete test suite for @services/auth.ts:
- Unit tests: All public methods
- Integration tests: API calls
- Edge cases: Exception scenarios
- Mock data: realistic test data"
"Scan entire project and generate:
1. API documentation (OpenAPI format)
2. Component documentation (Storybook format)
3. README files
4. CHANGELOG"
"Analyze package.json:
1. Find unused dependencies
2. Check outdated packages
3. Identify security vulnerabilities
4. Recommend alternatives"
"Create Git automation script:
1. Format code
2. Run tests
3. Generate commit message
4. Create PR
5. Update CHANGELOG"
"Generate migration based on new data model:
Old model: @models/user.old.ts
New model: @models/user.new.ts
Generate:
- Migration script
- Rollback script
- Data transformation logic"
"Based on @api/openapi.yaml generate:
1. Mock server
2. Test data
3. Postman collection
4. Client SDK"
"Unify code style across entire project:
1. Apply Prettier configuration
2. Fix ESLint issues
3. Standardize naming conventions
4. Organize import statements"
"Perform security audit:
1. Scan for sensitive information leaks
2. Check SQL injection risks
3. Identify XSS vulnerabilities
4. Review access control"
"Add internationalization support to project:
1. Extract all hardcoded text
2. Create language files (EN/CN)
3. Implement language switching
4. Handle date/currency formats"
"Optimize build configuration:
1. Analyze bundle size
2. Implement code splitting
3. Configure tree shaking
4. Optimize loading performance"
"Integrate error monitoring:
1. Add Sentry configuration
2. Set up error boundaries
3. Implement log collection
4. Create alert rules"
"Create complete CI/CD pipeline:
1. GitHub Actions configuration
2. Automated testing
3. Code quality checks
4. Auto-deployment scripts"
"Implement performance monitoring solution:
1. Add performance tracking
2. Collect key metrics
3. Generate performance reports
4. Set performance alerts"
"Help me debug this issue:
[Paste error message]
Please:
1. Analyze error stack
2. Locate problem source
3. Provide multiple solutions
4. Explain root cause
5. Suggest preventive measures"
"Create complete user management system:
1. Design database model
2. Implement CRUD API
3. Create frontend interface
4. Add authentication & authorization
5. Write test cases
6. Generate documentation"
"Refactor legacy project:
1. Analyze existing architecture
2. Identify technical debt
3. Create refactoring plan
4. Implement migration gradually
5. Ensure functionality unchanged
6. Improve test coverage"
"Comprehensively optimize application performance:
1. Frontend performance analysis
2. API response optimization
3. Database query optimization
4. Cache strategy implementation
5. CDN configuration
6. Monitoring alert setup"
| Shortcut | Function | Use Case |
|---|---|---|
| Shift + Tab | Toggle mode | Auto-accept/Plan mode |
| ESC | Stop execution | Emergency stop |
| Ctrl + V | Paste image | Design to code |
| Tab | Code completion | Quick coding |
/clear - Clear context
/compact - Compress history
/save - Save session
/resume - Resume session
/bash - Bash mode
/plan - Plan mode
/auto - Auto mode
/memory - Edit memory
@ - Reference file
@* - Wildcard match
@**/* - Recursive match
Design standard workflows based on project characteristics
Build a library of efficient prompt templates
Let Claude Code handle repetitive work
Stay updated on new features, optimize usage techniques
Share best practices with team
| Feature | Cursor | Claude Code |
|---|---|---|
| Learning Curve | Low | Medium |
| Feature Depth | Medium | Deep |
| Customization | Limited | Powerful |
| Batch Processing | Basic | Advanced |
| Cost Model | Subscription | Pay-as-you-go |
| Use Cases | Daily Development | Complex Tasks |
💡 Summary: After mastering these 23 tips, Claude Code's efficiency can truly be "maxed out". The key is to flexibly apply them according to different scenarios and form your own efficient workflow. Remember: tools are meant to improve efficiency, not to show off. Choose the most suitable technique for the current task to truly unleash Claude Code's power!