Building and Operating a CLI-Based LLM Coding Assistant

anthropic · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: CLI coding agents

Anthropic needed Claude Code to expose powerful coding-agent capabilities through a terminal-native interface that power users could compose, automate, and supervise safely.

Constraints:

Architecture

Claude Code is a Unix-utility-like CLI agent with raw access to Claude in the terminal. It can read files, run commands, edit code with permission gates, compose through tmux and non-interactive mode, use simple memory/compaction primitives, render through React Ink, compile/test with Bun, and rely on humans for review and high-stakes decisions.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  human-reviewer[Human Reviewer] --> terminal-cli[Terminal CLI]
  terminal-cli --> claude-agent[Claude Agent]
  terminal-cli --> react-ink-renderer[React Ink Renderer]
  claude-agent --> file-system[File System]
  claude-agent --> bash-tool[Bash Tool]
  claude-agent --> compaction[Compaction]
  permission-system[Permission System] --> claude-agent[Claude Agent]
  permission-system --> human-reviewer[Human Reviewer]
  bash-tool --> permission-system[Permission System]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Terminal CLI Primary user interface and composable Unix-style surface. Claude Agent, Permission System, React Ink Renderer
Claude Agent Model-driven coding agent with file, command, and coding capabilities. Terminal CLI, File System, Bash Tool, Compaction
Permission System Controls file edits, tests, bash commands, and allow/deny lists. Claude Agent, Human Reviewer
File System Project files that Claude can read and, when allowed, edit. Claude Agent
Bash Tool Command execution surface with higher safety risk than reads. Claude Agent, Permission System
Compaction Summarizes prior conversation/tool history to manage long sessions. Claude Agent
React Ink Renderer Terminal UI renderer built on React translated to ANSI output. Terminal CLI
Human Reviewer Reviews, corrects, and remains responsible for merged code. Terminal CLI, Permission System, Claude Agent

Data flow

A user invokes Claude Code in a terminal, grants or denies tool permissions, lets the agent inspect files and run commands, optionally composes multiple sessions through tmux or non-interactive mode, and reviews resulting code changes before merge.

“There is desktop, there's web, and yeah, Claude Code, it runs in your terminal. Because it runs in the terminal, it has access to a bunch of stuff that you just don't get if you're running on the web or on desktop or whatever.”article, stated
“the model's always allowed to read files or read anything. And then it's up to the user to say, hey, it's about to edit files”article, stated

Why this architecture

Anthropic intentionally made Claude Code a bare-bones Unix utility to maximize composability and raw model access. The team favors simple primitives like markdown memory and model-written summaries, while adding permissions where tool use can cause real harm.

“Since we covered all three of the first categories, today’s guests are Boris and Cat, the lead engineer and PM for Claude Code. If you only take one thing away from this episode, it’s this piece from Boris: Claude Code is not a product as much as it’s a Unix utility.”article, stated
“a lot more raw. Mm-hmm. Like I said, there isn't this kind of big, beautiful UI on top of it. It's raw access to the model. It's as raw as I get. So if you want to use a power tool that lets you access the model directly and use Claude for automating, you know, big workloads, you know, for”article, stated

Models used: Claude · Sonnet 3.7 · Claude Code

Scale

Alternatives considered (roads not taken)

Build an IDE-like, broad-market coding product.

Rejected because: Anthropic intentionally chose an earlier-curve terminal product rather than another Cursor/Windsurf-style tool.

“if we want some product that has, like, very broad a product market fit today, we would build, you know, a cursor or a wind serve”article, stated

Build complex memory architecture.

Rejected because: ClaudeMD used a simple auto-read markdown file as the smallest useful memory primitive.

“the thing we did is ship the simplest thing, which is, you know, it's a file that has some stuff. And it's auto-read into context.”article, stated

Build tmux-style parallel workflow management into Claude Code.

Rejected because: The CLI can be composed with existing tools rather than owning every workflow.

“a lot of people use code with, you know, Tmux, for example, to manage a bunch of windows and a bunch of sessions happening in parallel. We don't need to build all of that in.”article, stated

Patterns

tool-use-orchestration (coding agent)

Claude Code uses terminal tools, file reads, file edits, tests, bash, web fetch, and non-interactive mode under user permissions.

“it has access to a bunch of stuff that you just don't get if you're running on the web or on desktop”article, stated

human-in-the-loop-gate (safety)

Humans review merged code and approve dangerous actions, especially bash and file writes.

“there's still a human in the loop for reviewing.”article, stated

safety-policy-enforcement (permissions)

The permission system lets users allow-list or deny-list actions and gate edits/tests/commands.

“there's like a long list of other actions that users can either allow list or deny list based on regex matches with the action.”article, stated

context-compaction (long sessions)

Claude Code asks Claude to summarize previous messages to compact long sessions.

“we actually just did the simplest thing, which is ask Claude to summarize the, you know, the previous messages”article, stated

agent-memory (project memory)

ClaudeMD is a markdown file auto-loaded into context from root, child, or home directories.

“it's a file that has some stuff. And it's auto-read into context.”article, stated

Tradeoffs

Product surface

Chose Bare terminal utility over Polished IDE-style product.

Rationale: Raw access and composability fit power users and fast learning about agent use.

“It's a lot more bare bones. You have raw access to the model because we didn't spend time building all this kind of nice UI”article, stated

Memory design

Chose Markdown file and model summarization over Complex external memory architecture.

Rationale: The team repeatedly chose the simplest useful building block.

“This fits very well with Anthropic’s product principle: “do the simple thing first.””article, stated

Automation safety

Chose Permission gates and human review over Fully autonomous command execution.

Rationale: Some workflows are safe to auto-accept, but bash and broad file changes still need oversight.

“I'll just hit shift tab. Enter auto accept mode and just let it run the tests and iterate on the tests until they pass.”article, stated

Gotchas (what bit them)

Permissionless file writes can silently go wrong.

Root cause: The model may misunderstand the task or follow prompt-injected content from fetched URLs.

Resolution: Gate edits and catch wrong paths early through permission prompts and human review.

“let's say the model fetches a URL and then there's a prompt injection attack in the URL. And then the model writes malicious code to disk”article, stated

Bash commands carry higher safety risk than file reads.

Root cause: Shell commands can be destructive, and LLM systems are nondeterministic.

Resolution: Keep humans in the loop and use explicit tool permissions.

“quad could run, you know, rm, rf, slash. And that would suck. That's not a good thing. So we definitely want people to be in the loop”article, stated

Terminal UI implementation has platform quirks.

Root cause: ANSI behavior varies by terminal and lacks the consistency of modern browser UIs.

Resolution: Use React Ink while accounting for cross-terminal differences.

“Every terminal is a little different. So building in this way, it feels to me a little bit like building for the browser back in the day”article, stated

Compaction can lose original intent.

Root cause: Long conversations and repeated compaction can weaken early instructions.

Resolution: Improve effective context handling and keep the agent on track through summaries and review.

“if you have a very long conversation and you compact a few times, maybe some of your original intent isn't as strongly present”article, stated

Evaluation

Claude Code's evaluation is described through internal adoption, self-use, cost/productivity signals, human review, and observed failure modes that feed model training and product improvements.

Metrics: Internal daily usage · Percentage of Claude Code-authored code · Average daily cost · Productivity lift · Human review outcomes

“Claude Code writes 80% of Claude Code”article, stated
“The two that we're really trying to nail down are, one, decrease in cycle time.”article, stated

Outcomes

The source reports average daily spend, thousands-of-dollars-per-day power automation, 80-90% self-authored code, and 2x anecdotal productivity for one engineer.

“And pretty soon, everyone was... I was using it every day. And I remember we had this DAU chart for internal users. And I was just watching it, and it was vertical”article, stated
“anecdotally for me, it's probably 2x my productivity.”article, stated