What Is Claude Code: The AI Assistant for the Command Line
AI generated
Claude
>_
Claude AI · Developer Tools · CLI · Agentic Coding
What Is Claude Code
The AI Assistant for the Command Line

Claude Code is an agentic command-line assistant that reads and writes files, runs commands, and uses tools on its own to complete development tasks directly in the terminal. This article explains what technically sets Claude Code apart from a chat assistant, how a first session actually unfolds, and which PHP and Magento tasks genuinely benefit from using it.

16 min. read Agentic CLI · Tool Use · Terminal Claude Code · Permissions · CLAUDE.md

1. What Claude Code actually is

Claude Code is a command-line application from Anthropic that connects the Claude language model with an agentic execution layer. The model does not just generate text, it can also use clearly defined tools to read and write files on its own, run shell commands, and search the codebase with tools like Grep and Glob. The term "agentic" describes something concrete: Claude Code breaks a task into steps, executes one step, reads the actual result, such as an error message or test output, and adjusts the next step accordingly, without a human having to manually trigger every intermediate step.

Claude Code is installed via npm, runs locally in the terminal, and connects to the Anthropic API or a compatible provider such as Amazon Bedrock or Google Vertex AI. Unlike plain code completion in an editor, Claude Code is built for multi-step tasks: finding and fixing a bug that spans several files, implementing a feature from a specification, or validating a refactor by running the test suite afterward. The core idea is not a different language model, but a new execution environment built around an existing one.

2. Agentic CLI vs. chat assistant: the key difference

A classic chat assistant returns text as its answer. A developer pastes code into the chat window, gets a suggestion back as text, manually pastes it back into the file, runs the command themselves, and reports an error message back into the chat if something goes wrong. Every one of these steps is a manual interruption. Claude Code closes exactly this loop: within a permission boundary it has direct access to the file system and shell, executes the proposed change itself, immediately observes the result through the tool output, and continues the work on its own.

The second major difference concerns context. A chat assistant only knows what has been manually pasted in. Claude Code can search the codebase with Grep, load a CLAUDE.md file, follow imports across multiple files, and run the test suite. This shifts the kind of tasks the tool is suited for, away from pure question answering ("how do I do X") toward actually completing work ("do X in this repository and verify that it works"). This capability also comes with responsibility, because giving a tool execution rights means those rights need to be deliberately scoped, more on that in the permissions section.

3. Installation and initial setup

Installation happens via npm as a global package, after which the claude command is available system-wide in the terminal. On first launch, Claude Code asks for authentication, either through a login with a Claude account (Pro or Max plan) or through an API key billed based on token usage. Both paths work technically the same way but differ in billing: a subscription has a fixed monthly allowance, while an API key is charged based on actual consumption.

After logging in, Claude Code automatically detects the root of a Git repository once it is started inside a project folder. An optional .claudeignore file works similarly to .gitignore and excludes directories such as vendor/ or var/ from file search, which noticeably improves response speed in large Magento installations with many generated files. Configuration files live at the project level under .claude/settings.json and globally under ~/.claude/, so team-wide and personal settings stay cleanly separated.


#!/usr/bin/env bash
# Install Claude Code globally via npm
npm install -g @anthropic-ai/claude-code

# Start Claude Code inside a project directory
cd ~/development/mironsoft/src
claude

# Alternative: authenticate once via the Claude Code login flow
claude login

# Check installed version and update to the latest release
claude --version
claude update

4. A realistic first session

In practice, a first session usually looks like this: a developer opens the terminal in the project directory, starts claude, and describes the problem in natural language, for example a checkout error involving coupon codes with special characters. Claude Code then searches the codebase with Grep for relevant class names, reads the affected plugin file in full, and proposes a concrete change. Before that change is actually written, a confirmation prompt appears, unless the operation has already been allowed through the permission settings.

After confirmation, Claude Code writes the change and then runs the matching test command on its own to check whether the fix actually works. If the test fails, Claude Code reads the error message and adjusts the change again, without the developer having to copy the error message themselves. Every single tool call is visibly logged in the terminal, so the entire process stays traceable and can be interrupted at any point if the proposed direction is not right.


# Interactive session started inside the Magento project root
$ claude
> The checkout throws an exception when a coupon code containing
> special characters is applied. Please find the root cause and fix it.

# Claude Code searches the codebase for the relevant plugin
[tool] Grep: pattern="applyCoupon" path="app/code/Mironsoft"
[tool] Read: app/code/Mironsoft/Checkout/Plugin/CouponValidatorPlugin.php

# It proposes a fix and asks for permission before writing to disk
[tool] Edit: app/code/Mironsoft/Checkout/Plugin/CouponValidatorPlugin.php
> Apply this change? (y/n)

# After approval it verifies the fix by running the existing test suite
[tool] Bash: bin/cli vendor/bin/phpunit --filter CouponValidatorPluginTest

5. The tools in detail: Read, Edit, Bash, Grep

The agentic behavior of Claude Code does not come from a different model, it comes from the tools made available to the model. Read and Write, or Edit, allow reading files and making targeted changes without overwriting the rest of the file. The Bash tool runs arbitrary shell commands, such as build scripts, test runs, or Git commands, and returns the full output including the exit code back to the model. Grep and Glob handle fast search across large codebases without needing to read every file individually.

Beyond these core tools, specialized skills and subagents can be plugged in, for example for code reviews or deployment workflows, each using their own narrower set of tools. It's important to understand that Claude Code decides on its own which tool makes sense for a given sub-step, based on how the tools are described in the system context. That choice is not always optimal, which is why it's worth reviewing the actual tool calls being executed, especially for security-relevant changes to production systems.

6. Permissions and the security model

By default, Claude Code follows the principle "read without asking, write and execute with confirmation." Read-only operations such as Grep, Glob, or Read run without interruption because they don't change any state. As soon as a file is about to be written or a shell command is about to run, a confirmation prompt appears, unless that specific command or path has already been explicitly allowed in settings.json. These allowances can be expressed as patterns, for example allowing every call to bin/phpcs while still blocking destructive commands like rm -rf.

It's important to understand that CLAUDE.md instructions only provide context for the model, they are not a hard security boundary. Actual enforcement happens through the permission system, not through text instructions in a markdown file. Running Claude Code with very broad allowances, such as blanket approval for all Bash commands, means giving up part of the control over potentially destructive actions. A narrower allow list combined with a deny list for risky patterns is the safer starting point for production use in real projects.


{
  "permissions": {
    "allow": [
      "Bash(bin/magento cache:flush)",
      "Bash(bin/phpcs *)",
      "Bash(bin/analyse *)",
      "Read(//home/mir/development/mironsoft/src/**)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push --force*)",
      "Read(//home/mir/development/mironsoft/.env)"
    ]
  }
}

7. Steering project context with CLAUDE.md

A CLAUDE.md file in the project root is automatically loaded as context on every start and typically contains coding conventions, project-specific wrapper commands such as bin/magento instead of php bin/magento, and architectural rules such as preferring ViewModels over block classes. Because the file is checked into the repository as a plain markdown file, the entire team shares the same baseline configuration instead of every developer repeating individual, invisible instructions in their own chat.

Nested CLAUDE.md files in subdirectories extend the rules from the parent file with local specifics, for example special conventions for a single module. It's important to understand that CLAUDE.md is advisory context fed into the prompt, not a rule engine with forced enforcement. Contradictory or vaguely worded instructions won't be followed reliably as a result. The more specific and concise the rules are, the more consistently Claude Code follows them in practice.

8. Typical use cases for PHP and Magento developers

Claude Code is especially well suited to tasks with an objectively checkable success criterion. A refactor that requires renaming an interface across several vendor modules can be fully captured with Grep, instead of manually missing individual occurrences. Debugging sessions benefit from Claude Code being able to read real log files via bin/log and cross-reference them with the source code, instead of relying on a manually pasted error message. Writing PHPUnit tests against existing code also works well, because the test can be run right afterward and iteratively corrected if needed.

Another strong scenario is static analysis: running bin/analyse app/code/Mironsoft/SeoSuite --level=5, reading the reported PHPStan errors, and fixing them until the run passes cleanly. Repetitive but pattern-based tasks, such as creating declarative schema (db_schema.xml) or di.xml entries that follow existing conventions in the project, also fit well. Less suited are tasks without a checkable outcome, such as purely design-driven decisions or complex business-logic questions where there is no "right" or "wrong" that can be verified automatically.


#!/usr/bin/env bash
# Typical multi-step task Claude Code can drive end to end

# 1. Reproduce: run the failing test to see the actual error
bin/cli vendor/bin/phpunit --filter CouponValidatorPluginTest

# 2. Static analysis before touching production code
bin/analyse app/code/Mironsoft/Checkout --level=5

# 3. After the fix, clean caches and re-run the test
bin/cache-clean
bin/cli vendor/bin/phpunit --filter CouponValidatorPluginTest

# 4. Let Claude Code stage only the relevant files, never the whole tree
git add app/code/Mironsoft/Checkout/Plugin/CouponValidatorPlugin.php
git commit -m "Fix coupon validation for codes with special characters"

9. Limitations, risks, and a comparison overview

Claude Code has no inherent knowledge of the actual state of a running production system, only what becomes visible through files, commands, and logs. Given ambiguous instructions, the model can confidently make a plausible but wrong assumption and keep building on it. Because commands run with the rights of the invoking user, overly broad allow lists are a real risk, particularly in environments with access to production data. Costs also scale with actual token usage, which can add up noticeably during long sessions with repeated failures.

A fixed workflow is therefore worth adopting: review every change yourself before committing, keep CLAUDE.md current and specific, scope allow lists narrowly, and test new workflows first in a Docker development environment rather than directly against a production system. Hooks such as PreToolUse can additionally be used to automatically block certain risky command patterns before they ever get executed.


{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "scripts/block-dangerous-commands.sh"
          }
        ]
      }
    ]
  }
}
Criterion Chat assistant Claude Code (agentic CLI) Classic autocomplete
File system access No direct access, code has to be copied over Reads/writes files directly via Read/Edit tools Only the currently open file
Running commands Not possible, the user runs commands manually Runs Bash commands itself and reads the output No command access
Multi-step tasks Every step needs a new copy-paste round Plans, executes, checks the result, iterates on its own Only line- or block-level suggestions
Project context Only what is manually pasted into the chat CLAUDE.md and Grep across the entire codebase Local context in the open editor tab
Result verification The user reports errors back manually Runs tests and linters itself and reacts to failures No verification built in

The table shows that these three approaches aren't competing for the same problem, they cover different levels of granularity. Autocomplete is suited to micro-decisions within a single line, a chat assistant is suited to explanations and isolated code snippets, and Claude Code is suited to self-contained, multi-step tasks with a verifiable outcome. In practice, these tools frequently complement each other rather than replacing one another.

Mironsoft

Magento and Hyvä development with Claude Code in daily practice

Want to integrate Claude Code into your development workflow?

We use Claude Code in production on Magento and Hyvä projects, from CLAUDE.md conventions to permission configuration and CI integration, and advise you on where the tool genuinely adds value.

Workflow setup

Setting up CLAUDE.md, permission rules, and wrapper scripts for your project

Security review

Hardening permission configuration and hooks for production use

Team enablement

Hands-on training for development teams using Claude Code in production

10. Summary

Claude Code is not a new AI, it is an agentic execution environment built around the existing Claude model, gaining direct access to the file system and terminal through tools such as Read, Edit, Bash, Grep, and Glob. The key difference from a chat assistant lies in the closed feedback loop: Claude Code executes a proposed change itself, observes the actual result, and keeps iterating on its own, instead of relying on manual copy-paste. A CLAUDE.md file provides project-specific context along the way, without replacing a hard security boundary.

Actual control over destructive actions lives in the permission system of allow and deny rules, which requires confirmation for every write operation by default. Claude Code is well suited to tasks with a checkable success criterion, such as bug fixes accompanied by a test, static analysis, or pattern-based refactors across multiple files. It is less suited to tasks without an objective outcome, where human judgment and architectural decisions take center stage.

What Is Claude Code - The Key Points at a Glance

What Claude Code is

An agentic CLI assistant with direct access to the file system and shell through defined tools.

Difference from chat

A closed feedback loop: execute a change, observe the result, iterate on its own.

Security model

A permission system with allow/deny rules in settings.json, confirmation required for write actions.

Well suited for

Tasks with a checkable success criterion: bug fix with a test, static analysis, pattern-based refactoring.

11. FAQ: What Is Claude Code

1What exactly is Claude Code?
A command-line application from Anthropic connecting Claude with tools to read/write files and run shell commands, so tasks are completed directly in the terminal.
2How does it differ from the chat interface?
Chat returns plain text you have to copy yourself. Claude Code executes changes and commands itself, within a permission system.
3Does it need internet access and an API key?
Yes, it talks to the Anthropic API or compatible providers and needs either a subscription login or an API key billed by token usage.
4Can it run commands without confirmation?
Only if explicitly allowed in settings.json. By default it asks for confirmation before every write and every shell command.
5How do I set up a CLAUDE.md file?
Add a markdown file in the project root with conventions and wrapper commands. Loaded automatically as context, nested files add local rules.
6Is access to production code safe?
Only with carefully configured permission rules. Deny sensitive paths like .env, test production-adjacent actions in a Docker development environment.
7Which languages and frameworks does it support?
Language-agnostic, since it relies on generic tools. For PHP/Magento, wrapper scripts like bin/magento integrate just as easily.
8Does it work with a Mark Shust Docker setup?
Yes, as long as the bin/ wrapper scripts are documented in CLAUDE.md. Claude Code then calls bin/magento or bin/cli instead of direct container commands.
9What does using Claude Code cost?
Via Claude Pro/Max plans or usage-based through the API. Costs scale with tokens processed, not a fixed license fee.
10Does Claude Code replace a developer?
No. It executes tasks but does not validate business logic or architecture decisions. Every change should be reviewed by a developer before committing.