Agent Code Academy
Home/Appendices
Appendix B

Essential Commands & CLI Reference

Terminal: pwd, ls, cd, mkdir, touch, cp, mv, rm, cat, less, head, tail, echo, grep, find

Git: git init, git add, git commit, git push, git pull, git branch, git checkout, git merge, git log, git diff, git status, git stash

Claude Code Slash Commands: /help, /compact, /clear, /model, /context, /init, /code-review, /cost, /permissions, /hooks, /agents, /add-dir, /statusline, /fast

npm: npm install, npm run dev, npm run build, npx

CLI Flags Reference (Key Flags)

FlagDescription
-p "query"Print mode — non-interactive, for scripts/CI
-cContinue most recent conversation
-r <session>Resume a specific session by ID or name
--model <name>Set model (alias: sonnet, opus, haiku, or full model ID)
--permission-mode <mode>Start in a permission mode: plan, acceptEdits, dontAsk, bypassPermissions, delegate
--agents '<json>'Define session-level subagents via JSON
--agent <name>Run a named agent as the main thread
--add-dir <path>Add additional working directories
--mcp-config <file>Load MCP servers from JSON file
--strict-mcp-configOnly use MCP servers from --mcp-config
--tools "Bash,Edit,Read"Restrict which built-in tools Claude can use
--disallowedTools "Task(Explore)"Deny specific tools
--allowedTools "Bash(npm run *)"Pre-approve specific tools without prompting
--system-prompt "..."Replace the entire system prompt
--append-system-prompt "..."Append to the default system prompt
--output-format jsonOutput format for -p mode: text, json, stream-json
--json-schema '<schema>'Get validated JSON output matching a schema (-p only)
--max-turns <n>Limit agentic turns (-p only)
--max-budget-usd <n>Maximum dollar spend before stopping (-p only)
--fallback-model <name>Auto-fallback when default model is overloaded (-p only)
--from-pr <number>Resume sessions linked to a GitHub PR
--fork-sessionCreate new session ID when resuming
--chromeEnable Chrome browser integration
--remote "task"Create a web session on claude.ai
--teleportResume a web session in local terminal
--teammate-mode <mode>Agent team display: auto, in-process, tmux
--plugin-dir <path>Load plugins from a directory
--verboseEnable verbose logging
--debugDebug mode with optional category filter
--dangerously-skip-permissionsSkip all permission prompts (use with extreme caution)

Keyboard Shortcuts

ShortcutAction
Ctrl+CCancel current generation
Ctrl+BBackground a running task
Ctrl+OToggle verbose mode (see hook output)
Ctrl+GOpen external editor
Shift+Up/DownSwitch between agent team teammates
EscapeClear current input / exit mode