{"id":7025138,"date":"2026-08-03T14:05:15","date_gmt":"2026-08-03T14:05:15","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/5-hidden-claude-code-cli-commands-you-need-to-know\/"},"modified":"2026-08-03T14:05:15","modified_gmt":"2026-08-03T14:05:15","slug":"5-hidden-claude-code-cli-commands-you-need-to-know","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=7025138","title":{"rendered":"5 Hidden Claude Code CLI Commands You Need to Know"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>I used Claude Code daily for months before realizing that <code>claude --help<\/code> hides many of its most useful capabilities. I kept restarting fresh sessions, repeatedly explaining the same project structure, simply because I did not know a better workflow existed.<\/p>\n<p>While debugging an unrelated issue, I discovered the full CLI reference: <em>dozens of commands and flags that completely changed how I use the tool<\/em>. In this article, I walk through the hidden features that mattered most in practice and how they can make Claude Code significantly more productive.<\/p>\n<p><strong>Note:<\/strong> This article skips installation and beginner setup. If you are new to Claude Code, start with <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/02\/claude-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">Getting Started with Claude Code<\/a> for installation and first-run setup, and <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/07\/what-is-claude-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">Claude Code: Master it in 20 Minutes<\/a> for a quick overview of the tool. Everything below focuses on the less obvious CLI features and is verified against Claude Code v2.1.209 and later; version-specific flags are noted where relevant.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-1-the-first-thing-that-changed-i-stopped-losing-my-sessions\">1. The First Thing That Changed: I Stopped Losing My Sessions<\/h2>\n<p>Claude Code saves every session automatically. It always has. I just never knew how to get back into one. Three flags fix the entire problem:<\/p>\n<pre class=\"wp-block-code\"><code># Continue the most recent session in this directory\nclaude -c\n\n# Name a session when you start it\nclaude -n \"auth-refactor\"\n\n# Come back to it by name, days later\nclaude -r \"auth-refactor\" \"finish the PR description\"<\/code><\/pre>\n<p>The naming part is what makes this actually usable. Without a name you get an auto-generated ID like 7c5dcf5d, which works fine but is impossible to remember. With a name, resuming a piece of work three days later takes one command and Claude already knows everything about it.<\/p>\n<p>There is a fourth flag here worth knowing. If you want to pick up an old session but you are about to try something risky, \u2013fork-session branches it so the original transcript stays untouched:<\/p>\n<pre class=\"wp-block-code\"><code>claude -r auth-refactor --fork-session<\/code><\/pre>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Flag<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>What it actually does for you<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -c<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Picks up your last session in this folder. Full context, no re-explaining.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -n \"name\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Names the session so you can find it later without hunting for an ID.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -r \"name\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Resumes a specific session by name or ID.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --fork-session<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Resumes but branches, so the original session stays as it was.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --from-pr 123<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Opens the session picker filtered to sessions tied to a specific pull request.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><em>Try this now:  Open a project you were working on yesterday and run <\/em><em>claude<\/em><em> -c. If you have ever used Claude Code in that folder, it will pick up exactly where you left off. This one command is the difference between a tool you restart every day and one that remembers your project.<\/em><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-2-the-one-that-changed-my-whole-working-day-background-agents\">2. The One That Changed My Whole Working Day: Background Agents<\/h2>\n<p>If you take one thing from this article, take this one.<\/p>\n<p>Adding <code>--bg<\/code> to any command starts the task as a background agent and hands your terminal straight back to you. Claude keeps working. You keep working. You check on it when you feel like it.<\/p>\n<pre class=\"wp-block-code\"><code>$ claude --bg \"investigate why payments.test.js is flaky\"\nSession started: 7c5dcf5d\nTo attach:    claude attach 7c5dcf5d\nTo view logs: claude logs 7c5dcf5d\nTo stop:      claude stop 7c5dcf5d<\/code><\/pre>\n<p>The moment this clicked for me was a Monday morning. I kicked off a background agent to audit an unfamiliar codebase for security issues, then spent the next forty minutes doing my actual planned work in a second terminal. When I came back, it had a full report waiting. I had not been sitting there watching a spinner.<\/p>\n<p>You can run several at once. My usual pattern now looks like this:<\/p>\n<pre class=\"wp-block-code\"><code># Fire off two long jobs\nclaude --bg \"audit the API surface for missing auth checks\"\nclaude --bg \"find every TODO comment older than six months\"\n\n# Get on with your own work, then check in\nclaude agents<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-managing-them\"><strong>Managing them<\/strong><\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>What it does<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude agents<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Live view of every session, running and finished.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude agents --json<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Same thing as JSON, so you can parse it in a script.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude attach <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Pull a background session into your current terminal.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude logs <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Print recent output without attaching.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude stop <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Stop a running session.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude rm <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Remove it from the list. The transcript stays on disk.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude respawn <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Restart a session with its conversation intact.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude respawn --all<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Restart everything. Useful right after a Claude Code update.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>One more that took me a while to notice. The \u2013exec flag runs a plain shell command as a background job instead of a Claude session, which is surprisingly handy for long test runs:<\/p>\n<pre class=\"wp-block-code\"><code>claude --bg --exec 'pytest -x tests\/'<\/code><\/pre>\n<p>If parallel agents interest you at a bigger scale, Anthropic pushed this much further with Dynamic Workflows, which can coordinate hundreds of parallel subagents in a single session. We covered that in <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2026\/05\/claude-opus-4-8-pricing-and-features\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>our Claude Opus 4.8 article<\/u><\/a>.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-3-the-flag-i-should-have-learned-on-day-one\">3. The Flag I Should Have Learned on Day One<\/h2>\n<p><code>-p<\/code>, short for <code>--print<\/code>. It runs your query, prints the answer, and exits. No interactive session, no waiting for follow-up.<\/p>\n<p>On its own that sounds boring. What makes it interesting is that it turns Claude Code from a thing you sit inside into a thing you can pipe into:<\/p>\n<pre class=\"wp-block-code\"><code># Ask one question, get one answer, back to your shell\nclaude -p \"what does auth.js actually do\"\n\n# Pipe a file straight in instead of asking Claude to find it\ncat error.log | claude -p \"summarise these errors by root cause\"\ncat changes.diff | claude -p \"review this diff for security issues\"\n\n# Continue your last session but just get one answer\nclaude -c -p \"any type errors left?\"<\/code><\/pre>\n<p>The piping is the part I lean on most now. Feeding a log file or a diff directly into Claude is faster than describing where the file is and waiting for it to read from disk, and it works on files outside your project folder.<\/p>\n<p><strong>Try this now:<\/strong>  Find any log file on your machine and run: cat thatfile.log | claude -p \u201cwhat is going wrong here\u201d. It takes about ten seconds and it is the fastest way to understand what -p is for.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-output-formats-once-you-start-scripting\">Output formats, once you start scripting<\/h3>\n<p>Once -p is in your toolkit, output formats become relevant. Text is the default. JSON gives you something parseable. Stream JSON gives you an event stream for real-time pipelines:<\/p>\n<pre class=\"wp-block-code\"><code>claude -p \"list all API routes\" --output-format json\nclaude -p \"query\" --output-format stream-json --verbose<\/code><\/pre>\n<p>And if you are calling Claude Code from a script a lot, <code>--bare<\/code> is worth knowing. It skips auto-discovery of hooks, skills, plugins, MCP servers, and <strong>CLAUDE.md<\/strong> so the call starts faster. Claude still has Bash and file tools, nothing else loads:<\/p>\n<pre class=\"wp-block-code\"><code>claude --bare -p \"quick question about this one file\"<\/code><\/pre>\n<h2 class=\"wp-block-heading\" id=\"h-4-where-i-was-quietly-burning-money\">4. Where I Was Quietly Burning Money<\/h2>\n<p>This section exists because of a bill I did not enjoy looking at.<\/p>\n<p>Claude Code has an effort setting that controls how much reasoning it applies to a task. I had never touched it, which meant every trivial task got the same deep-thinking treatment as a hard architecture problem.<\/p>\n<pre class=\"wp-block-code\"><code>claude --effort low       # small edits, quick questions\nclaude --effort medium    # standard day-to-day coding\nclaude --effort high      # complex refactors, architecture work\nclaude --effort ultracode # xhigh effort with ultracode on (v2.1.203+)<\/code><\/pre>\n<p>Matching effort to the task is the single easiest cost lever in the tool. A one-line fix does not need max effort.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-hard-limits-for-anything-automated\">Hard limits for anything automated<\/h3>\n<p>For scripted or automated runs, two flags stop things getting out of hand. I now treat both as mandatory in any pipeline:<\/p>\n<pre class=\"wp-block-code\"><code># Stop once API spend hits two dollars\nclaude -p --max-budget-usd 2.00 \"large refactor task\"\n\n# Stop after five agentic turns\nclaude -p --max-turns 5 \"investigate this bug\"<\/code><\/pre>\n<p><em>As of v2.1.217, spend from subagents counts toward \u2013max-budget-<\/em><em>usd<\/em><em>, and once the cap is hit Claude Code stops background subagents that are still running. Before that version, subagent spend could quietly overshoot the cap.<\/em><\/p>\n<p>There is a lot more depth on cost control than I can fit here. If this is your concern, <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2026\/05\/tips-for-claude-code-token-saving\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>23 Tips for Claude Code Token Saving<\/u><\/a> goes properly deep on model choice, effort tuning, and reusable subagents, and it is where I picked up most of my own habits.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-5-the-setting-i-had-wrong-for-months\">5. The Setting I Had Wrong for Months<\/h2>\n<p>Permission modes control how much Claude Code does without checking with you first. I ran on the default for a long time, approving every single file edit by hand, and assumed that was the only safe option.<\/p>\n<p>It is not. There are six modes, and picking the right one for the task removes a lot of friction without giving up control where it matters:<\/p>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Mode<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>What it allows<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>When I use it<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>default<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Prompts before every edit and tool use<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Unfamiliar codebases<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>acceptEdits<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Auto-accepts file edits, still asks before Bash<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Most of my actual work<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>plan<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Plans only. Writes nothing, runs nothing.<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Understanding a change before allowing it<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>auto<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Decides for itself what is safe to allow<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Projects I know well<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>dontAsk<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Suppresses prompts but keeps safety checks<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Longer trusted tasks<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>bypassPermissions<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Skips all permission prompts<\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">CI only, in a sandbox<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<pre class=\"wp-block-code\"><code>claude --permission-mode plan\nclaude --permission-mode acceptEdits\n\n# Same as bypassPermissions, deliberately verbose so you notice it\nclaude --dangerously-skip-permissions<\/code><\/pre>\n<p>Plan mode was the real find for me. When I am about to let Claude touch something I do not fully understand yet, I start in plan mode, read what it intends to do, then switch modes and let it run. It costs one extra step and has caught flat-out wrong assumptions more than once.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-restricting-tools-instead-of-modes\">Restricting tools instead of modes<\/h3>\n<p>Separately from permission modes, you can limit which tools Claude has at all:<\/p>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Flag<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Effect<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--tools \"Bash,Edit,Read\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Only these built-in tools are available this session.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--tools \"\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">No tools. Claude can only produce text.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--allowedTools \"Bash(git log *)\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Auto-allow matching calls without prompting.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--disallowedTools \"Bash(rm *)\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Always deny matching calls, tool stays otherwise usable.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--disallowedTools \"mcp__*\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Deny every MCP tool for this session.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-6-mcp-from-the-terminal\">6. MCP From the Terminal<\/h2>\n<p>MCP is what lets Claude reach into your database, GitHub, Slack, and anything else you connect. I am not going to re-explain the setup here because we have a full walkthrough in <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2026\/07\/connect-mcp-servers-claude-desktop-code\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>How to Connect MCP Servers with Claude<\/u><\/a>, covering both Claude Desktop and Claude Code. What I do want to flag are the CLI commands that are easy to miss.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-the-three-i-actually-use\">The three I actually use<\/h3>\n<pre class=\"wp-block-code\"><code># Check what is connected and what is broken\nclaude mcp list\n\n# Authenticate a server showing 'needs authentication'\nclaude mcp login sentry\n\n# Bring over everything already set up in Claude Desktop\nclaude mcp add-from-claude-desktop<\/code><\/pre>\n<p>That last one saved me a tedious afternoon. I had five servers configured in Claude Desktop and was halfway through adding them to Claude Code by hand before I found out one command copies the lot across, on macOS and WSL.<\/p>\n<p>The mcp login and mcp logout commands are newer, from v2.1.186. Before them you had to open the interactive <code>\/mcp<\/code> panel to run an OAuth flow, which was awkward over SSH. Now you can do it from the shell, and <code>--no-browser<\/code> prints the URL for you to paste instead of trying to open a browser on a remote box:<\/p>\n<pre class=\"wp-block-code\"><code>claude mcp login sentry --no-browser<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-reading-the-status-output\">Reading the status output<\/h3>\n<p>When claude mcp list shows something other than connected, the status tells you what to do next:<\/p>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Status<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>What it means and how to fix it<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>connected<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Working. Nothing to do.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>needs authentication<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Reachable but not authorised. Run claude mcp login <name>.<\/name><\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>connected, tools fetch failed<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Connected but could not list tools. Run claude mcp get <name> for the error.<\/name><\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>failed to connect<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Did not start. Run the install command in your own terminal to see the real error.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>pending approval<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">A project-scoped server you have not approved in this session yet.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-7-system-prompts-append-or-replace-and-why-it-matters\">7. System Prompts: Append or Replace, and Why It Matters<\/h2>\n<p>There are four flags for changing the system prompt. Two replace it entirely, two add to it. I got this wrong the first time and it took me a while to work out why the results felt off.<\/p>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Flag<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Behaviour<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--append-system-prompt \"text\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Adds your text after the default prompt.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--append-system-prompt-file f.txt<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Adds file contents after the default prompt.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--system-prompt \"text\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Replaces the entire default prompt.<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>--system-prompt-file f.txt<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Replaces the default prompt with file contents.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Here is the rule I now follow. Use append when Claude should still behave like a coding assistant but also follow an extra rule of yours. Use replace only when the task is not coding at all, like a data extraction step in a pipeline nobody is watching.<\/p>\n<p>Replacing drops everything in the default prompt, including tool guidance and safety instructions. That is the part I had not appreciated. My replaced prompt was shorter, so the model had less to work with, and I could not understand why it had stopped following conventions it had followed all week.<\/p>\n<pre class=\"wp-block-code\"><code># Extend without changing what Claude is\nclaude --append-system-prompt \"Always write a test for any new function\"\n\n# Replace, for a non-coding pipeline step\nclaude --system-prompt \"You are a JSON extraction agent. Output only valid JSON.\"<\/code><\/pre>\n<p>For rules you want on every session in a project, do not pass flags every time. Put them in CLAUDE.md, which loads automatically. And if you find yourself repeating a whole workflow rather than a rule, that is what Skills are for: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2026\/03\/claude-skills-custom-skills-on-claude-code\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>Claude Skills Explained<\/u><\/a> covers building them, and there is a good collection of ready-made ones in <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2026\/03\/github-repositories-to-get-free-claude-code-skills\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>these GitHub repositories<\/u><\/a>.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-8-when-something-breaks\">8. When Something Breaks<\/h2>\n<p>These are the commands I reach for when Claude Code is behaving strangely, in the order I try them.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-start-here\">Start here<\/h3>\n<pre class=\"wp-block-code\"><code># Read-only diagnostic: install health, settings errors, auth state\nclaude doctor<\/code><\/pre>\n<p>claude doctor runs without starting a session and tells you whether your install is healthy, whether your settings files have validation errors, and whether you are authenticated. It has caught a malformed settings.json for me twice, which is not something you would ever guess from the symptoms.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-if-a-customisation-is-the-problem\">If a customisation is the problem<\/h3>\n<pre class=\"wp-block-code\"><code># Start with every customisation disabled\nclaude --safe-mode<\/code><\/pre>\n<p>Safe mode disables CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands, output styles, keybindings, and auto-memory. Authentication, model selection, and built-in tools all still work. If the problem disappears in safe mode, you know it is something you configured rather than the tool itself.<\/p>\n<p><strong>Note:<\/strong> <em>Safe mode and bare mode are not the same thing. Bare mode skips auto-discovery for speed in scripts. Safe mode disables customisations for troubleshooting, and goes further, covering output styles and keybindings that bare mode would still load.<\/em><\/p>\n<h3 class=\"wp-block-heading\" id=\"h-if-a-background-session-is-stuck\">If a background session is stuck<\/h3>\n<pre class=\"wp-block-code\"><code>claude daemon status\n\n# Stop the supervisor but leave the sessions running\nclaude daemon stop --any --keep-workers<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-updating\">Updating<\/h3>\n<pre class=\"wp-block-code\"><code>claude update\n\n# Or pin a specific version\nclaude install 2.1.195\n\n# Restart background sessions so they pick up the new binary\nclaude respawn --all<\/code><\/pre>\n<p>That last line is easy to forget. Background sessions keep running on the old binary until you respawn them, which produces some very confusing behaviour where a new flag works in a fresh terminal but not in a session you started before updating.<\/p>\n<p><strong>A small quality-of-life thing:<\/strong><em> if you mistype a subcommand, Claude Code suggests the closest match rather than failing oddly. claude udpate prints \u2018Did you mean claude update?\u2019 and exits.<\/em><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-quick-reference\">Quick Reference<\/h2>\n<p>Everything above in one place, for when you know what you want and just need the syntax.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-sessions\">Sessions<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Start interactive session<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude \"query\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Start with an initial prompt<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -p \"query\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">One answer, then exit<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -c<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Continue most recent session here<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -n \"name\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Start and name the session<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -r \"name\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Resume by name or ID<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --fork-session<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Resume into a new branch<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-background-agents\">Background agents<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --bg \"task\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Run as a background agent<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude agents<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">View all sessions<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude attach <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Attach to a session<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude logs <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Print session output<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude stop <id\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Stop a session<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude respawn --all<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Restart all running sessions<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --bg --exec 'cmd'<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Run a shell command as a background job<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-cost-and-limits\">Cost and limits<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --effort low|high<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Set reasoning depth<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -p --max-budget-usd 2.00<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Cap API spend<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude -p --max-turns 5<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Cap agentic turns<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --bare -p<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Skip auto-discovery for faster scripted calls<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-permissions\">Permissions<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --permission-mode plan<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Plan only, change nothing<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --permission-mode acceptEdits<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Auto-accept edits<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --dangerously-skip-permissions<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Skip all prompts (CI only)<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --tools \"Bash,Edit,Read\"<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Restrict available tools<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-mcp\">MCP<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude mcp list<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">List servers and status<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude mcp login <name\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Run OAuth for a server<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude mcp add-from-claude-desktop<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Import servers from Claude Desktop<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude mcp remove <name\/><\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Remove a server<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-diagnostics\">Diagnostics<\/h3>\n<div style=\"overflow-x:auto;margin:1em 0;\">\n<table style=\"border-collapse:collapse;width:100%;border:1px solid #cccccc;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Command<\/strong><\/th>\n<th style=\"border:1px solid #cccccc;padding:8px 10px;background-color:#eeeeee;text-align:left;font-weight:bold;vertical-align:top;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude doctor<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Install and settings diagnostic<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude --safe-mode<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Start with all customisations off<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude daemon status<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Background supervisor state<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude update<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Update to latest<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\"><code>claude project purge --dry-run<\/code><\/td>\n<td style=\"border:1px solid #cccccc;padding:8px 10px;vertical-align:top;\">Preview deleting project state<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-what-i-would-tell-myself-six-months-ago\">What I Would Tell Myself Six Months Ago<\/h2>\n<p>Three things, in order of how much time they would have saved me.<\/p>\n<ol class=\"wp-block-list\">\n<li>name your sessions and resume them. <code>claude -n<\/code> on the way in, <code>claude -r<\/code> on the way back. This alone removes the daily re-explaining tax.<\/li>\n<li>use <code>--bg<\/code> for anything that will take more than a couple of minutes. There is no reason to sit and watch a long task finish when you could be doing something else in another terminal.<\/li>\n<li>set <code>--effort<\/code> to match the task, and put <code>--max-budget-usd<\/code> on anything automated. Both take five seconds and both directly affect what you pay.<\/li>\n<\/ol>\n<p>One last thing, and it is the reason this article exists. Run <code>claude --help<\/code>, then go and read the actual reference. The help output is not the full list, and the gap between the two is where most of the useful stuff lives.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"schema-faq wp-block-yoast-faq-block\">\n<div class=\"schema-faq-section\" id=\"faq-question-1785406977205\"><strong class=\"schema-faq-question\">Q1. Why does claude \u2013help not show every flag?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. The documentation says it directly: \u2013help does not list every flag, so a flag\u2019s absence from help output does not mean it is unavailable. Always check the official reference if you are looking for something specific.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1785406977342\"><strong class=\"schema-faq-question\">Q2. What is the difference between claude -c and claude -r?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. -c continues the most recent session in your current directory without asking. -r resumes a specific session by name or ID, or shows an interactive picker if you do not pass one. Use -c when you just want the last thing you were doing, -r when you have several pieces of work going and need a particular one.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1785406977479\"><strong class=\"schema-faq-question\">Q3. Can I run Claude Code in CI without any interactive prompts?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Yes. Combine -p for non-interactive mode, <code>--dangerously-skip-permissions<\/code> to skip approvals, and a token from claude setup-token for auth. Add <code>--max-budget-usd<\/code> and <code>--max-turns<\/code> so a bad run cannot spiral. claude -p \u2013dangerously-skip-permissions <code>--max-budget-usd 5.00 \"run the test suite and report failures\"<\/code><\/p>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"border-top py-3 author-info my-4\">\n<p>Hi , I am Sree Vamsi a passionate Data Science enthusiast currently working at Analytics Vidhya. My journey into data science began with a curiosity for uncovering insights from complex data and has evolved into building end-to-end Generative AI applications, RAG pipelines, agentic AI workflows, and multi-agent systems that solve real-world business problems.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>I used Claude Code daily for months before realizing that claude &#8211;help hides many of its most useful capabilities. I kept restarting fresh sessions, repeatedly explaining the same project structure, simply because I did not know a better workflow existed. While debugging an unrelated issue, I discovered the full CLI reference: dozens of commands and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7025139,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[13259,75810,11230,81990,6320],"dealstore":[],"offerexpiration":[],"class_list":["post-7025138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-claude","tag-cli","tag-code","tag-commands","tag-hidden"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=7025138\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"I used Claude Code daily for months before realizing that claude --help hides many of its most useful capabilities. I kept restarting fresh sessions, repeatedly explaining the same project structure, simply because I did not know a better workflow existed. While debugging an unrelated issue, I discovered the full CLI reference: dozens of commands and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=7025138\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-03T14:05:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=7025138#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"5 Hidden Claude Code CLI Commands You Need to Know\",\"datePublished\":\"2026-08-03T14:05:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138\"},\"wordCount\":2576,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp\",\"keywords\":[\"Claude\",\"CLI\",\"Code\",\"Commands\",\"Hidden\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=7025138#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=7025138\",\"url\":\"https:\/\/fivemor.com\/?p=7025138\",\"name\":\"5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp\",\"datePublished\":\"2026-08-03T14:05:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=7025138#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=7025138\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=7025138#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=7025138#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"5 Hidden Claude Code CLI Commands You Need to Know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=7025138","og_locale":"en_US","og_type":"article","og_title":"5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network","og_description":"I used Claude Code daily for months before realizing that claude --help hides many of its most useful capabilities. I kept restarting fresh sessions, repeatedly explaining the same project structure, simply because I did not know a better workflow existed. While debugging an unrelated issue, I discovered the full CLI reference: dozens of commands and [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=7025138","og_site_name":"Som2ny Network","article_published_time":"2026-08-03T14:05:15+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=7025138#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=7025138"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"5 Hidden Claude Code CLI Commands You Need to Know","datePublished":"2026-08-03T14:05:15+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=7025138"},"wordCount":2576,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=7025138#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp","keywords":["Claude","CLI","Code","Commands","Hidden"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=7025138#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=7025138","url":"https:\/\/fivemor.com\/?p=7025138","name":"5 Hidden Claude Code CLI Commands You Need to Know - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=7025138#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=7025138#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp","datePublished":"2026-08-03T14:05:15+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=7025138#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=7025138"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=7025138#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/08\/image-10-1.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=7025138#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"5 Hidden Claude Code CLI Commands You Need to Know"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/7025138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7025138"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/7025138\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/7025139"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7025138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7025138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7025138"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=7025138"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=7025138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}