Twitter/X

Author @adxtyahq (published 2026-07-16) frames the prompt “design Claude Code…

Brief

Author @adxtyahq (2026-07-16) proposes an eight-step design for an AI coding agent in response to the “design Claude Code from scratch” interview prompt: use ASTs and dependency graphs for program understanding, embeddings+graph traversal for targeted retrieval, explicit planning and minimal diffs for edits, continuous validation (lint/type/tests), callable tools (search/terminal/git), session memory, and explicit explanations for each change. The author adds this may not reflect Claude Code’s real implementation.

Why it matters

Author @adxtyahq (published 2026-07-16) frames the prompt “design Claude Code from scratch” as an Anthropic interview question and presents an eight-step blueprint, while noting “Probably not how Claude Code is actually built.”

Key details

  • Core technical steps: build an AST + dependency graph to extract symbols/imports and cross-file relationships; use embeddings + graph traversal to retrieve only relevant files (don’t send full codebase); plan edits by identifying which files need changes and breaking tasks into small executable steps; produce minimal diffs to preserve architecture, naming, and formatting.
  • Operational practices: validate every change with linting, type checks, and tests (failed validation triggers another reasoning pass); treat search, terminal, git, and diagnostics as callable tools; maintain session memory of past edits/decisions; and explain each edit with tool outputs and validation results to build developer trust.
Source evidence

"design Claude Code from scratch"

apparently this was asked in an Anthropic interview round. came across it somewhere on the internet and honestly it's a much more interesting AI systems problem than most classic distributed systems questions

  1. understand the repository
  • build an AST + dependency graph
  • extract symbols, imports and cross-file relationships instead of relying on raw text
  1. retrieve only relevant context
  • use embeddings + graph traversal to fetch the right files
  • sending an entire codebase to the model doesn't scale
  1. plan before writing code
  • identify which files need changes
  • break the task into small executable steps before generating edits
  1. edit incrementally
  • generate minimal diffs instead of rewriting files
  • preserve existing architecture, naming conventions and formatting
  1. validate every change
  • run linting, type checks and tests after each edit
  • failed validation should trigger another reasoning pass
  1. use tools, not just the model
  • search, terminal, git and diagnostics become tools the agent can call whenever needed
  1. remember context across the session
  • keep track of previous edits and architectural decisions
  • avoid repeatedly solving the same problem
  1. explain every edit
  • show why each file changed
  • surface tool outputs and validation results so developers can trust the agent

Probably not how Claude Code is actually built, but this is how I'd structure the system based on what I've learned about AI coding agents.