Post by Master.dev (Formerly Frontend Masters)

147,080 followers

How Claude Code actually works under the hood (it's simpler than you think) Every time you press enter, something interesting happens: the model itself has zero memory of anything. It starts from scratch, every single call. So how does it "know" your codebase, your conventions, your security rules? Claude Code reassembles the entire context from zero, every time: A system prompt that tells the model who it is, what tone to use, coding conventions, and security rules A tool schema defining every action the model can take on your behalf (reading files, running commands, etc.) The messages array, the running conversation history The model never "reads" any of this as JSON. The API converts it all into tokens, and that's what the model actually sees. Here's the clever part: say you ask it to add a test in utils.cs. The model hasn't been given that file's contents anywhere in the prompt. But because it has a read tool in its schema, it reasons: "I don't have access to this yet, so I should use the read tool to get it." Once that tool call succeeds, the whole prompt gets reassembled again. Now it includes the assistant's message and the tool result (the actual file contents) appended to the conversation. Rinse and repeat. No persistent memory, just a system that rebuilds the full picture from scratch on every turn. It's a good reminder that a lot of what feels like "intelligence" in these tools is really good context engineering.

Post content

Video Content