Skip to main content
Claude Code Tutorial: From First Command to Custom Workflows

Chat Assistant vs. Agentic CLI: Architecture and Workflow

Same model, different architecture. Chat assistants see only what you paste; Claude Code reads your entire codebase and decides its own next steps. This lesson explores the mechanical differences and when to use each.

Beginner15 minBy ToolDix Editorial

Learning objectives

  • Understand the architectural difference between a chat assistant and an agent
  • Recognize why the same model behaves differently in each interface
  • Identify when to use chat versus Claude Code
  • Trace a concrete workflow end-to-end in both systems

ToolDix original visual

Claude Code Tutorial practice loop
1

Frame

Name the outcome and constraints.

2

Build

Try one bounded workflow.

3

Review

Keep evidence, revise, and share.

Same model, different architecture

Claude is the language model. Claude.com (web chat) and Claude Code (CLI/desktop/IDE) are two different architectures around that model. The model is identical; the architecture determines what the system can do.

Chat architecture:

User input → Model → Text response → User (user decides next step)

Claude Code architecture:

User input → Model → Tool call → Execute tool → Get result →
Model (observes result) → Decide next step → Loop until done → User (reviews final result)

In chat, the model outputs text and stops. You read the output, decide what to do, and type the next question. The loop is between you and the model; it's slow because you are in it.

In Claude Code, the loop is between the model and the tools. The model observes the result of each action (a test failure, a file read, a command output) and decides the next action without waiting for you. You remain present but not in the critical path.

Concrete architectural comparison

AspectChat AssistantClaude Code
Access to your codeOnly what you paste into the chat. No access to your filesystem or git history.Entire codebase. Reads files on demand, understands structure, sees git branches and history.
Ability to executeNone. Cannot run tests, builds, or commands. Cannot edit files.Full. Runs tests, shell commands, edits files, commits to git, calls APIs (with permission).
Knowledge of current stateTraining data only. Does not know if your API is running, if a test passes, or if a deployment succeeded.Real-time. Runs a test, gets the result, knows exactly what is failing.
Iteration speedSlow. You copy output, run it, encounter error, paste error back, wait for new suggestion.Fast. Model runs test, sees error immediately, proposes fix, runs test again, all without your intervention.
Permanence of changesYou are responsible. You copy code from chat and paste it into your editor. Edits are manual.Claude Code proposes and executes. You review diffs, approve, and changes are written directly.
Suitability for environments outside codeExcellent. Can reason about concepts, images, documents, research, learning.Designed for code. Limited to what the CLI can see: code, logs, test output.

The key insight: chat is a knowledge interface, Claude Code is an action interface. Chat is faster for answering questions; Claude Code is faster for making changes that depend on environment-specific facts.

ToolDix original diagram
Chat: Single-turn vs. Claude Code: Multi-turn loop
Chat Assistant (single-turn)
You ask
Paste code or question
Model responds
Text only, no action
You iterate
Copy, paste, re-ask
Feedback loop: you are the intermediary
Claude Code (multi-turn agent loop)
You ask
Goal (e.g., 'fix test')
Model → Tool
Read file, run test, etc.
Observe result
Model sees actual state
Decide next
Loop or stop
Feedback loop: model observes results directly
Chat: you wait for output, interpret it, decide next step. Claude Code: model reads output, decides next step, you only review final result.

Worked example: adding a database migration

Scenario: Your application needs to drop a column from the users table.

In chat:

You: "Add a database migration to drop the user_email column from users."

Claude (chat): [Suggests migration code based on common patterns]

You: Copy the suggested code
     Save it to a new file in migrations/
     Run `npm run migrate`
     Get an error: "Migration failed: foreign key constraint"

     Paste error back into chat...

Claude (chat): [Suggests adding CASCADE]

You: Edit migration, run again...
     [Process repeats until it works]

Feedback loops: Minimum 3 (likely more if your schema is non-standard) Human work: Copy-paste, save file, run command, interpret error, repeat Time: 5-10 minutes

In Claude Code:

You: claude

Prompt: "Add a migration to drop the user_email column from users."

Claude Code (turn 1):
  - Lists migrations/ directory to see naming convention
  - Reads existing migrations to understand your team's style
  - Reads the users table schema to check for foreign keys
  - Observes: the email column is referenced by a sessions table

Claude Code (turn 2):
  - Shows you a migration file that:
    * Drops the foreign key constraint
    * Drops the email column
    * Uses your exact naming convention and syntax

  You approve with: y

Claude Code (turn 3):
  - Runs the migration against your dev database
  - Gets success: "Migration completed"
  - Observes: goal met
  - Reports: "Migration created and applied successfully"

Feedback loops: 0 (Claude made correct decision because it had the full context) Human work: Approve one diff Time: 30 seconds

Why the same model behaves so differently

The difference is not intelligence; it's context and iteration capacity. Claude in both systems can write correct SQL. But Claude in chat doesn't know if your schema has foreign keys (you didn't paste them), doesn't know your naming conventions (you didn't mention them), and can't run the migration to see if it works (no access to your database).

Claude Code knows all three because it read your codebase. It also has the ability to iterate: if a migration fails, it observes the error, forms a new hypothesis ("maybe I need to drop the FK first"), and tries again. In chat, you are the one iterating -- you read the error, form the hypothesis, and type a new question.

Iteration speed multiplied by iteration count equals total time. Chat loses on both dimensions for environment-specific tasks.

When to use chat

Use Claude.com or a chat interface when:

  • Learning or understanding concepts. "How does OAuth work?" Chat can explain without needing your actual code.
  • Brainstorming before you code. "What's a good architecture for a notification system?" Chat can explore design space.
  • Reasoning about images, PDFs, research. Chat can see and reason about files. Claude Code cannot.
  • Writing in isolation. A function you're designing in a vacuum, not integrated with a codebase yet.
  • Getting feedback on an idea. "Is this a good approach?" Chat is instant and conversational.

Chat is fast for knowledge work. It is slow for changes that require iteration against real environments.

When to use Claude Code

Use Claude Code when:

  • You need to modify your actual codebase. Tests that really fail, files that really exist, environments that are really running.
  • The task requires adaptation to environment-specific facts. "Fix the failing test" depends on what the actual error is.
  • You want to reduce iteration cycles. Claude Code sees test results immediately instead of you copy-pasting errors.
  • You want changes written directly. No copy-paste; diffs are reviewed and applied atomically.
  • You need to run commands as part of the task. Building, testing, deploying, or querying live systems.

Claude Code is fast for action work. It is slower for brainstorming or learning.

Hybrid workflow

The most effective use of both tools:

  1. Chat: Brainstorm the approach. "Should I refactor this service to microservices? What's the tradeoff?" Conversation. Decision.
  2. Claude Code: Execute the plan. "Refactor the service according to [plan we discussed]." Claude Code reads the code, does the work, runs tests.
  3. Chat (optional): Reflect on results. "I did the refactor. Here's what changed [paste summary]. Did I miss anything?"

This leverages each tool's strength. Chat for thought, Claude Code for action, chat for review.

Real example: fixing a broken build

You come in to find your CI/CD pipeline failing. Three approaches:

Approach A (chat only):

  1. Copy the error log into chat
  2. Ask for a fix
  3. Copy suggested code to editor
  4. Run build locally
  5. If it still fails, repeat steps 1-4

Approach B (Claude Code):

  1. Type: claude "fix the failing CI build"
  2. Claude Code reads the error log
  3. Reads the build config and source code
  4. Runs the build locally to see the actual failure
  5. Identifies the issue and fixes it
  6. Runs the build again to verify
  7. You approve and done

Approach C (hybrid, most common):

  1. Chat: Ask "What usually causes [type of build failure]?" for context
  2. Claude Code: Run the fix
  3. Chat (if complex): Verify the approach

The time difference is typically 1-5 minutes of wall clock for simple fixes (Claude Code wins), and 5-15 minutes for complex ones requiring iteration (Claude Code wins even larger because the iteration loop is tighter).

Common mistake

Using Claude Code as if it were chat, or chat as if it were Claude Code. Asking Claude Code to brainstorm architecture without modifying code wastes its strength. Pasting your entire test suite into chat and asking Claude to fix it without running the tests is slow because you become the iteration loop. Choose the tool by the task: if you need to change your real code and see real results, use Claude Code. If you need to think or learn, use chat.

Sources and license context

These references informed the lesson. ToolDix adds its own explanation, workflow, and practice rather than reproducing source material. Every link below leaves ToolDix and opens the publisher's own site in a new tab.

Keep going

Read these next on ToolDix.

Original lessons that build on what you just read.