Usage of Claude Code

Summary

  • Claude Code is used for code editing, terminal execution, and repository workflows directly from the CLI.

Key Points

  • Common flow: start session, describe task, review proposed actions, approve sensitive operations, validate results.
  • It is strongest when tasks include file edits plus command execution (tests, lint, git checks).
  • Keep prompts specific: include target files, expected behavior, and validation command.
  • Use repository instructions (CLAUDE.md) to enforce consistent behavior across sessions.
  • Permission modes: auto-approve (bypass confirmations), default (ask for risky ops), and deny (block destructive actions).
  • Memory: Claude Code reads CLAUDE.md at project root (and ~/.claude/CLAUDE.md for global settings) to persist project context and conventions.
  • MCP: Model Context Protocol servers can extend Claude Code with custom tools (databases, APIs, web fetch, etc.), configured in ~/.claude/settings.json or .claude/settings.json.
  • Pipe input for scripting: echo "summarize this" | claude -p (non-interactive mode with -p).

Examples

  • Start interactive session: claude
  • Run one-shot request: claude "refactor parser and run tests"
  • Ask for scoped work: claude "update AI/Claude Code notes only and keep template format"
  • Non-interactive (pipe): cat error.log | claude -p "what is causing this error?"
  • Continue last session: claude --continue
  • Resume a specific session: claude --resume
  • AI/Claude Code/index
  • AI/Claude Code/Introduction
  • AI/Claude Code/Slash Commands Reference