Person/Kristian Fagerlie/YouTube/25/05/5 AMAZING Claude Code Commands You MUST Know About
00:00 Introduction & Overview
- "Today I want to go over five different commands you probably haven't used yet in Claude Code."
- Presenter is a big fan of Claude Code and uses it frequently.
- The video will demonstrate commands that save time and make working with Claude Code easier.
- Claude Code is used for automating tasks, saving time, and improving workflow.
00:27 Command 1: Project Rules with claude.md
- Use
/init to create a claude.md file for project guidance. - Example rules for
claude.md:- 1. Always write secure, best-practice Python code
- 2. Write and execute tests for each function; iterate based on results
- 3. Delete test scripts if tests pass
- 4. Commit after each new function
- Demonstrates editing
claude.md and connecting to GitHub via MCP server. - Shows workflow:
- Create a new repo for the project
- Add rules to
claude.md - Test automation: write, test, commit, clean up
- Example workflow:
- Write an email input validator function in
CC.py - Claude Code automatically writes a test, runs it, and deletes the test if it passes
- Commits the changes to GitHub
- Repeat for additional functions (e.g., date input validator)
- Using
claude.md ensures best practices are followed and saves time on repetitive tasks - Key Insight: Setting up
claude.md enforces best practices and automates much of the coding workflow
04:48 Command 2: Custom Command Files & Documentation Lookup
- Create custom command files (project or global) to store frequently used commands or documentation.
- Example:
claude docs.md for storing API documentation. - Use user commands to query documentation files directly (e.g., "Give me a code example of Claude AI API").
- Claude Code fetches relevant info from the referenced file, making it easy to access documentation without leaving the editor.
- #Example: Using a custom docs file to answer API questions quickly.
- Tip: Store API docs locally for quick reference and efficiency.
07:37 Command 3: Using Images in Claude Code
- Drag and drop images (e.g., screenshots) into Claude Code to extract text and use it as context.
- Example: Screenshot code, extract text, and ask Claude to write Py code based on it.
- Useful for extracting data from images for further processing or coding tasks.
- Claude can process images, extract relevant information, and help automate workflows.
08:55 Command 4: One-Shot Mode & File-Specific Queries
- Use
-p (oneshot mode) for single commands and quick queries. - Pipe file content into Claude Code for focused analysis (e.g.,
cat file.txt | claude -p 'What model is used here?'). - Saves tokens and time by narrowing context to a specific file.
- Key Insight: Use oneshot mode for targeted, efficient queries and to save on compute costs.
11:02 Command 5: Output Formatting & Extended Thinking, Conclusion
- Use
output-format to specify result format (e.g., JSON, XML) for Claude's output. - Example: Generate a currency rates dataset in JSON or XML.
- Extended thinking: Use prompts like "think deeply about" for more thorough, step-by-step plans.
- Example: Ask Claude to "think deeply about a step-by-step plan to calculate arbitrage trading from currency rates.json"; Claude generates a plan, implements algorithms (e.g., Bellman-Ford), and analyzes results.
- Key Insight: Prompting for deeper thinking can yield more comprehensive solutions.
- Recap of favorite commands:
claude.md for project rules, -p for file-specific queries, images for context, output formatting, and extended thinking.