How to Use Claude Code: Terminal Workflows, Subagents and Real Projects

Claude Code runs in your terminal and edits real projects. Here is the setup, the explore-plan-change-check loop, subagents, and habits that keep code safe.

By Galactic News Editorial · Published 2026-11-26T10:39:38+00:00 · Updated 2026-11-26T10:39:38+00:00

How to use Claude Code terminal workflows subagents and real projects guide

How to Use Claude Code: Terminal Workflows, Subagents and Real Projects

Claude Code is Anthropic's terminal-first coding agent. It runs in your terminal, reads your codebase, edits files, runs commands, and uses git. This guide covers the setup, the everyday workflow, subagents, and the habits that keep real projects safe.

What Claude Code is

Claude Code is a command-line tool, not a chat window in a browser. You start it inside a project folder. It sees your files, your git history, and your terminal. You describe a change in plain language. It explores the code, proposes a plan, makes the edits, and runs the tests.

The key idea is context. A chat assistant only knows what you paste. Claude Code knows the whole project. It can trace a bug across five files, find every caller of a function, and check the change against the test suite. That is why it works best on real codebases, not toy examples.

How to use Claude Code: the first setup

  1. Install it. Run npm install -g @anthropic-ai/claude-code in your terminal. Check the version with claude --version.
  2. Sign in. Run claude and follow the sign-in flow to connect your Claude account. You need a paid Claude plan or API access to run it.
  3. Open your project. Change into the project folder with cd, then run claude. Claude Code starts in that directory and reads the project.
  4. Explore first. Ask it to explain the codebase before you change anything. Try: explain how authentication works in this project. You learn the layout, and it learns the code.
  5. Use plan mode for big changes. Press Shift+Tab, or start with /plan, or run claude --permission-mode plan. Plan mode tells Claude to research and propose changes without making them. Edits stay blocked until you approve the plan.
  6. Review every diff. Read the changes before you accept them. Ask Claude to explain anything unclear. Never approve a diff you do not understand.
  7. Run the tests. Tell Claude the command to run the test suite. A change is done when the tests pass, not when the code looks right.

The everyday workflow: explore, plan, change, check

Anthropic's documentation describes a simple loop for everyday work: explore the codebase, plan the change, make the change, and check it. Each step has a recipe.

Explore an unfamiliar codebase. Start Claude Code in the project root. Ask for an overview, then drill into one area at a time. For large searches, delegate the exploration to a subagent, so only the findings come back into your main conversation.

Fix a bug. Share the error message. Ask for fix recommendations first, then apply the fix. Give Claude the command to reproduce the bug, so it can confirm the fix works. A fix you cannot reproduce is a guess.

Refactor and test. Describe the goal, not the method. Say what the code should do after the change. Let Claude propose the shape of the refactor. Then run the full test suite and fix what breaks.

Subagents: your specialist workers

Subagents are specialized assistants that handle one kind of task. Each subagent runs in its own context window, with its own system prompt, tool access, and permissions. Use one when a side task would flood your main conversation with search results, logs, or file contents you will not reference again. The subagent does the work and returns only the summary.

A subagent is a Markdown file with YAML frontmatter. Only two fields are required: name and description. The description is the routing rule. Claude decides when to delegate by matching your task against it, so write it clearly. Save project subagents in .claude/agents/ and personal ones in ~/.claude/agents/. Claude Code picks up new files within seconds, with no restart.

---
name: code-reviewer
description: Reviews code for quality and best practices. Use proactively after any change that touches src/.
tools: Read, Grep, Glob
model: sonnet
---
Review the changed files for bugs, security issues, and style problems. Explain each issue and show the fix.

Claude Code ships with built-in subagents. Explore is a fast read-only agent for searching code. Plan does read-only research while you are in plan mode. General-purpose handles multi-step tasks with every tool. You can also define your own, restrict their tools, pick their model, and let them spawn their own subagents, nested up to three layers deep by default.

Running work in parallel

Real projects need more than one thing at once. Claude Code offers three ways to parallelize.

Git worktrees. Each worktree is a separate checkout on its own branch. Start one with claude --worktree followed by a name. Edits in one worktree never collide with edits in another. This is the safest way to run two features at once.

Non-interactive mode. Pass -p to run Claude Code from scripts and CI, for example claude -p "run the linter and fix what it flags". Use claude --continue to resume a session that spans several sittings.

Dynamic workflows. A dynamic workflow is a JavaScript script that orchestrates many subagents at once. The plan moves out of Claude's head and into code, so the context holds only the final answer. Try the bundled /deep-research workflow first: it fans out web searches across several angles, cross-checks the sources, and returns a cited report. Dynamic workflows launched as a research preview in June 2026 and need version 2.1.154 or later. They run on every paid plan.

Real projects: habits that keep it safe

Claude Code can edit and delete files. Treat it like a fast junior developer with full repo access. These habits keep it safe.

Bottom line

Start with explore and plan mode. Let Claude Code learn your codebase before you let it change anything. Add one custom subagent for the task you repeat most, such as code review or test running. Use worktrees when two features run at once. The tool is powerful, but the discipline is yours: small tasks, reviewed diffs, and a test command for every change.