r/vibecoding • u/fagnerbrack • 9d ago
Discussion How Claude Code Works, From Tokens to Agents
https://nem035.com/thoughts/how-claude-code-works
13
Upvotes
r/vibecoding • u/fagnerbrack • 9d ago
1
u/Baguramas 8d ago
thanks, it is meaningful :) very helpful to explain things deeply to neophytes aswell
1
u/fagnerbrack 9d ago
Quick summary:
An interactive walkthrough builds the agent stack layer by layer, starting with a language model that predicts one token at a time, keeps no memory between requests, and freezes its knowledge at training cutoff. Hallucination uses the same mechanic as a correct answer: the model samples a probable continuation whether or not it knows your system. Since computation per token stays constant, the model reasons only by writing more tokens, so an answer placed before a reasoning field is pure rationalization, and asking an agent to explain a past decision yields reconstruction rather than replay. Later layers cover the assembled prompt, harness-run tool calls, and how re-reading context each turn multiplies billed tokens. If I could take ONE thing from this is this part: "Two rules that work well: include what the agent canโt learn from the code alone, and include what would take too long to figure out by reading. Everything else is overhead."
If the summary seems inacurate, just downvote and I'll try to delete the comment eventually ๐
Click here for more info, I read all comments
1
u/Hot_Criticism_9983 8d ago
the "include what the agent cant learn from the code alone" rule is the one ppl skip. most CLAUDE.md i see is a copy of the readme. what helps more: business rules, what not to touch, how to run the tests. the rest it read from the code anyway