Forge Fate
Today I Learned

2026-10-06 Practical Claude Code Commands for Developers

4 min read

The right action when Claude Code gets stuck depends on the situation: choosing an implementation direction, condensing a long conversation, or reviewing already changed code. This is a situational reference, not a sequence that requires running every command.

Documentation checked: 2026-10-24

Official documentation was checked for terminal-based Claude Code. Examples illustrate usage; they are not execution records from a particular project or measurements of productivity gains.

First distinguish where to enter a command

Commands beginning with claude go in the terminal shell:

bash
claude --versionclaude

The first checks the installed version; the second starts an interactive session. Slash commands such as /plan and /compact go inside that session. CLI reference

Type / to see available commands. Availability can depend on version, platform, plan, and environment, so check the local menu if a command is absent. Command reference

NeedCommands/input
Create or inspect project instructions/init, /memory
Establish scope before implementation/plan
Resume a conversationclaude -c, /resume
Inspect context usage or summarize/context, /compact
Start a separate task/clear
Stop the current responseEsc
Restore earlier code/conversation/rewind
Inspect and review changes/diff, /code-review

1. Project instructions: /init and /memory

/init inspects a codebase to draft CLAUDE.md, or suggests improvements if it already exists. /memory lets you inspect or edit instruction and memory files. Memory documentation

text
/init

Review the draft against the project, especially build/test commands and working directories, included/excluded scope, and rules not obvious from code. A test command without its execution directory can be insufficient; record required dependencies and environment too.

Unverified commands written as facts can propagate bad assumptions. Separate established rules from open questions. CLAUDE.md supplies model instructions; it is not enforcement equivalent to permission settings. How instructions apply

2. Unclear change scope: /plan

For a cross-file change, first identify affected areas. /plan enters planning mode for investigation and an implementation plan. Command reference

A hypothetical status-filter request:

text
/plan I want to add a status filter to the list screen.First identify:1. Files responsible for querying and filtering the list.2. What needs changing and what must stay unchanged.3. How to check existing behavior still works.Do not implement yet. Separate verified findings from assumptions.

Judge a plan by concrete scope, preserved behavior, and verification, not length. “Change relevant files and test” is insufficient. A clearly scoped typo need not follow the same process; use investigation to reduce actual uncertainty. Official guidance also allows skipping planning for small tasks. Best practices

3. Resume, summarize, or start a different conversation

These actions serve different purposes.

Resume earlier work

bash
claude -c

This continues the most recent conversation in the current directory. Inside a session, /resume selects an earlier one. CLI reference, session management

Resuming a conversation does not restore repository files to their earlier state. If other edits occurred, request a fresh inspection:

text
Files may have changed since the previous conversation.Inspect current changes and identify discrepancies with the remaining work.

Continue the same task with a long conversation

Use /context to inspect usage and /compact to summarize:

text
/context
text
/compact Preserve the current goal, prohibited changes, modified files,checks actually run and their results, and unresolved items.

Summarization does not preserve every detail verbatim. Check that important constraints remain and restate them when needed. Context and compaction

Begin a separate task

text
/clear

/clear starts a fresh conversation while retaining project instructions. Earlier conversations remain accessible through /resume; it does not undo file changes. Command reference

Do not base this choice on a fixed failure count. Continue if prior investigation remains relevant; start fresh for unrelated work.

4. Separate stopping work from restoring state

Stop the current response with Esc

Esc can interrupt an ongoing response or tool call. Completed changes remain, so inspect current state before redirecting. Ctrl+C also interrupts active work, but with no active work can clear input or exit; its meaning is context-dependent. Keyboard behavior

A specific redirection:

text
The existing API response format must remain unchanged.Inspect files changed so far and explain changes that violate that condition.

Restore an earlier state with /rewind

text
/rewind

The menu can restore code, conversation, or both. Code-restoration options appear when the selected checkpoint contains tracked file changes. Double Esc also opens it when input is empty.

Restoration has boundaries: files edited through Claude's editing tools are tracked; later Bash edits to those tracked files can be included; files changed only through Bash are not tracked and remain. Do not assume whole-project restoration. Inspect the diff afterward and maintain Git separately. Checkpointing

5. Separate diff inspection, review, and execution checks

QuestionMethod
What changed?/diff
What might be wrong?/code-review and direct review
Does required behavior work?Appropriate tests, execution, or screen checks

/diff: Inspect the changes

text
/diff

The working-tree view can include preexisting user edits, so do not attribute every displayed change to the current Claude task. Diff documentation

Check for unrequested files, changes to interfaces or behavior that must be preserved, and unrelated cleanup mixed into the feature.

/code-review: Obtain findings and evidence

text
/code-review

Current documentation says the no-target command reviews current-branch and uncommitted changes for correctness; depending on model and effort, it can include cleanup suggestions. --fix additionally requests applying findings. Use the plain command when reviewing evidence first. /review is currently an alias but was a separate command in earlier versions. Local code review

Assess triggering inputs, the causal code, whether a finding violates requirements or is optional, and side effects of the proposed fix.

Execution: Record what was actually established

A clean review does not replace behavior checks. Official guidance recommends providing verification suited to the work. Best practices

text
Perform the checks needed for this change and report:- Commands and execution directories.- Success or failure.- Behavior each check establishes.- Checks not run or still unresolved.Do not present expected results as observed execution results.

Passing tests and satisfying every requirement differ. A status-filter query test may not verify that the screen preserves the selected value.

6. Example: Adding a list status filter

This is an illustrative workflow, not a performed task:

  1. Read existing project instructions; use /init only if a draft is needed.
  2. Use /plan to investigate querying, UI, and checks, separating confirmed files from assumptions.
  3. Request implementation within the agreed scope and preserved behavior. Interrupt scope drift and inspect current changes.
  4. Inspect /diff, then evaluate /code-review findings by their triggers and evidence.
  5. Check required behavior with a filter, without one, and with no results. Record completed checks and gaps separately.

Use /compact if this conversation grows long, /clear for a different task, and /resume to return. Add more commands in response to recurring problems: identifying the stage that causes difficulty makes the relevant feature easier to choose.

Report an error or share feedback

Open a draft with this article’s title and URL. Review the message and recipient before sending.

To: [email protected]

Open email draft

If no email app opens, copy these details into your usual email service.

Contact information