Claude Code Unpacked : A visual guide (ccunpacked.dev)

by autocracy101 400 comments 1128 points
Read article View on HN

400 comments

[−] autocracy101 45d ago
Author here. I built this in a few hours after the Claude Code leak.

I've been working on my own coding agent setup for a while. I mostly use pi [0] because it's minimal and easy to extend. When the leak happened, I wanted to study how Anthropic structured things: the tool system, how the agent loop flows, A 500K line codebase is a lot to navigate, so I mapped it visually to give myself a quick reference I could come back to while adapting ideas into my own harness and workflow.

I'm actively updating the site based on feedback from this thread. If anything looks off, or you find something I missed, lmk.

[0] https://pi.dev/

[−] lateforwork 44d ago
How about releasing your own source code? It is a beautiful site, love the UX as well as functionality.
[−] azinman2 44d ago
It screams vibe coding. This is the anthropic look. Just ask Claude and give it a screenshot.
[−] cowlby 44d ago
Vibe coding is also why this was released hours after leak instead of days/weeks.
[−] lateforwork 44d ago
Of course I expect it is vibe coding. It would be insane to code anything by hand these days. But that doesn't mean there is no creative input by the author here.
[−] zeroq 44d ago

>> It would be insane to code anything by hand these days.

I strongly disagree, but it made me chuckle a bit, thinking about labeling software as "handmade" or marketing software house as "artisanal".

[−] alistairmayo 44d ago
There's a lot of errors you can miss by coding by hand, even as a seasoned developer. Try taking Claude Code, point it at your repo, and ask it to find bugs. I bet it will.

Claude is actually a crazy good vuln researcher. If you use it that way, your code might just be more secure than written purely by hand.

[−] duskdozer 43d ago
Sure, just like drug-sniffing dogs. Whether they've actually found something or are just pleasing the operator is another story.
[−] hyhmrright 34d ago
[dead]
[−] eric_cc 44d ago
Depends on what you’re building and whether it’s recreational or not. Complex architecture vs a ui analysis tool, for example. For a ui analysis tool, the only reason you code by hand is for the joy of coding by hand. Even though you can drive a car or fly in a plane there are times to walk or ride a bike still.
[−] small_scombrus 44d ago
Our organic artisanal code is written by free-range developers
[−] Viliam1234 44d ago
"free-range" means fully remote, right?
[−] bobthepanda 44d ago
Depending on your standards and what company is making it you could even have “cruelty free.”
[−] kitsune1 44d ago
[dead]
[−] archagon 44d ago
You well on the path to AI-fueled psychosis if you genuinely believe this.
[−] lateforwork 44d ago
I genuinely believe this. Even if you're inventing a new algorithm it is better to describe the algorithm in English and have AI do the implementation.
[−] joquarky 44d ago
At least it's more productive than AI Derangement Syndrome.
[−] codexstar 43d ago
Yes, it is vibecoded, had to get it like in 10-15 minutes. I did not know how to write a piece of code 4-5 months back.
[−] QuantumGood 44d ago
Must everything be artisanal for some people?
[−] smrtinsert 44d ago
As a cynical modern eng look for landing page skills
[−] kordlessagain 44d ago
Guess what? People have ZERO reason to Open Source anything now.
[−] DustinKlent 44d ago
One reason, beside basic altruism, is so you can put the projects on your resume. This is especially helpful if the project does very well or gets lots of stars.
[−] pixl97 44d ago
This said Jeavon's Paradox will likely mean far more code is open sourced simply due to how much code will get written in total.
[−] joquarky 44d ago
We should be applauding the promotion of science and useful arts that genAI is fueling.

But egos are involved.

[−] vntok 44d ago
Why would you think that?
[−] saulpw 44d ago
I'm a committed open source dev and I've flipped my own switch from "default public" to "default private".
[−] kordlessagain 44d ago
Because nobody wants their shit stolen by some punk.
[−] boomskats 45d ago
This is nice, I really like the style/tone/cadence.

The only suggestion/nit I have is that you could add some kind of asterisk or hover helper to the part when you talk about 'Anthropic's message format', as it did make me want to come here and point out how it's ackchually OpenAI's format and is very common.

Only because I figure if this was my first time learning about all this stuff I think I'd appreciate a deep dive into the format or the v1 api as one of the optional next steps.

[−] ontouchstart 44d ago
I’m using pi and cc locally in a docker container connected to a local llama.cpp so the whole agentic loop is 100% offline.

I had used pi and cc to analyze the unpacked cc to compare their design, architecture and implementation.

I guess your site was also coded with pi and it is very impressive. Wonderful if you can do a visualization for pi vs cc as well. My local models might not be powerful enough.

Thanks for the hard work!

[−] order-matters 44d ago
what level of success are you getting with a 100% offline loop (and on what hardware if you dont mind sharing)?
[−] ontouchstart 44d ago
[−] nashadelic 43d ago
wow, the pi version looks... better v. cc?
[−] yoe 42d ago
yeah true, its looks a bit cleaner and more readable
[−] couscouspie 44d ago
I thought that early coding assistants came to be written in some Java/TypeScript, because AI companies just had web-devs playing around and then made it a product even though the languages being such a misfit for terminal. Why did you decide for TypeScript?
[−] haliliceylan 45d ago
Can you give me more info about your own agentic setup ?
[−] dev-divi 44d ago
Hi, Autocracy. I took your site and built Clyde: https://github.com/dev-divi/choice-agent-clyde
[−] sensei85 40d ago
Could you share what your agent setup and harness looks like with PI with what you've learnt from the Claude leak.
[−] hatmanstack 44d ago
Thank you for this brother, well done
[−] tipoffdosage904 44d ago
This is actually a GREAT example of vibe-coding + skill.
[−] andoando 44d ago
Is there any nice themes for pi?
[−] throwatdem12311 44d ago
I know it seems counter-intuitive but are there any agent harnesses that aren’t written with AI? All these half a million LoC codebases seem insane to me when I run my business on a full-stack web application that’s like 50k lines of code and my MvP was like 10k. These are just TUIs that call a model endpoint with some shell-out commands. These things have only been around in time measured in months, half a million LoC is crazy to me.
[−] __s 44d ago
[−] rkozik1989 44d ago
Who cares about LoC? Its a metric that hasn't mattered since we measured productivity in it in the 1980s. For all we know they made these design choices so they could more easily reuse the code in other codebases. Ideally you'd build the library to do that at the same time, but this is start up time constraints to repay loans and shit.
[−] jimbokun 44d ago
Bugs and vulnerabilities are roughly linear to lines of code in a project.
[−] imdoxxingme 44d ago
"Who cares how much concrete we used in this bridge?"
[−] nojs 44d ago
That would be a sensible comparison if concrete was free
[−] lossyalgo 44d ago
Since when are tokens free?
[−] acedTrex 44d ago
Opencode actually has a pretty solid codebase quality wise. I have done brief pokes and its been largely fine.
[−] raincole 44d ago

> just TUIs

For starters, CC's TUI is React-based.

[−] ale 44d ago
Somebody somewhere is bragging to someone about using React to render a grid of ASCII characters.
[−] GoatInGrey 44d ago
https://x.com/trq212/status/2014051501786931427

" Most people's mental model of Claude Code is that "it's just a TUI" but it should really be closer to "a small game engine".

For each frame our pipeline constructs a scene graph with React then -> layouts elements -> rasterizes them to a 2d screen -> diffs that against the previous screen -> finally uses the diff to generate ANSI sequences to draw

We have a ~16ms frame budget so we have roughly ~5ms to go from the React scene graph to ANSI written. "

[−] xendo 44d ago
You can argue that any UI is like a game engine in that sense. Some make sensible choices and don't need to pretend they have to render at 60fps.
[−] throwatdem12311 44d ago
60fps is pathetic for a TUI when most terminals worth their salt are GPU accelerated and displays can be up to 240fps or even more. But let’s be real if I can play Quake at >500 fps they have no excuse.
[−] thinkling 44d ago
Do they reconstruct the scene graph for each frame?! Maybe I'm overinterpreting the phrasing. Someone take a peek at the source?
[−] joquarky 44d ago
Not reliably.
[−] JDups 44d ago
[dead]
[−] TacticalCoder 44d ago

> These are just TUIs that call a model endpoint with some shell-out commands.

Claude Code CLI is actually horrible: it's a full headless browser rendering that's then converted in real-time to text to show in the terminal. And that fact leaks to the user: when the model outputs ASCII, the converter shall happily convert it to Unicode (no latter than yesterday there was a TFA complaining about Unicode characters breaking Unix pipes / parsers expecting ASCII commands).

It's ultra annoying during debugging sessions (that is not when in a full agentic loop where it YOLOs a solution): you can't easily cut/paste from the CLI because the output you get is not what the model did output.

Mega, mega, mega annoying.

What should be something simple becomes a rube-goldberg machinery that, of course, fucks up something fundamental: converting the model's characters to something else is just pathetically bad.

Anyone from Anthropic reading? Get your shit together: if you keep this "headless browser rendering converted to text", at least do not fucking modify the characters.*

[−] user34283 44d ago
No it is not. Ink does not use a browser.
[−] justin_vin 44d ago
[flagged]
[−] amangsingh 45d ago
A 500k line codebase for an agent CLI proves one thing: making a probabilistic LLM behave deterministically is a massive state-management nightmare. Right now, they're great for prompting simple sites/platforms but they break at large enterprise repos.

If you don't have a rigid, external state machine governing the workflow, you have to brute-force reliability. That codebase bloat is likely 90% defensive programming; frustration regexes, context sanitizers, tool-retry loops, and state rollbacks just to stop the agent from drifting or silently breaking things.

The visual map is great, but from an architectural perspective, we're still herding cats with massive code volume instead of actually governing the agents at the system level.

[−] ttcbj 44d ago
I find it really strange that there is so much negative commentary on the _code_, but so little commentary on the core architecture.

My takeaway from looking at the tool list is that they got the fundamental architecture right - try to create a very simple and general set of tools on the client-side (e.g. read file, output rich text, etc) so that the server can innovate rapidly without revving the client (and also so that if, say, the source code leaks, none of the secret sauce does).

Overall, when I see this I think they are focused on the right issues, and I think their tool list looks pretty simple/elegant/general. I picture the server team constantly thinking - we have these client-side tools/APIs, how can we use them optimally? How can we get more out of them. That is where the secret sauce lives.

[−] sunir 44d ago
It’s not surprising. There has been quite a bit of industrial research in how to manage mere apes to be deterministic with huge software control systems, and they are an unruly bunch I assure you.
[−] comboy 44d ago
It's hard to tell how much it says about difficulty of harnessing vs how much it says about difficulty of maintaining a clean and not bloated codebase when coding with AI.
[−] Andebugulin 45d ago
If it was 2020, it would be hard to imagine that after some hours/days you getting a visual representation of the leak with such detailed stats lol
[−] ernst_klim 45d ago

> 500k lines of code

Isn't it a simple REPL with some tools and integrations, written in a very high level language? How the hell is it so big? Is it because it's vibecoded and LLMs strive for bloat, or is it meaningful complexity?

[−] brauhaus 45d ago
Even today, I'm still astounded that there are people capable of building a gorgeous and interesting site like this in less than 2 days...
[−] stingraycharles 45d ago
I guess they really do eat their own dogfood and vibe code their way through it without care for technical debt? In a way, it’s a good challenge, but it’s fairly painful to watch the current state of the project (which is about a year old now, so it should be in prime shape).
[−] wklm 45d ago
Here's a codeberg repo with the leaked source: https://codeberg.org/wklm/claude-code
[−] bsgeraci 44d ago
Dang! Glad to see others doing this. I totally made this site yesterday like 11 hours ago :/ but did not get the traction.

I love your implementation.

Here was my first stab:

https://news.ycombinator.com/item?id=47595140

https://brandonrc.github.io/journey-through-claude-code/

[−] jedisct1 45d ago
I'm developing an agent focused on A2A, support for small models, and privacy (https://swival.dev).

I looked at the leaked code expecting some "secret sauce", but honestly didn't found anything interesting.

I don't get the hype around Claude Code. There's nothing new or unique. The real strength are the models.

[−] dheerajmp 45d ago
Feel free to add this to Awesome Claude code. https://github.com/rosaboyle/awesome-cc-oss
[−] euphetar 44d ago
Appreciate the effort, but this is very basic and nothing you need the source code to understand. I was expecting a deep dive into what specific decisions they made, but not how an loop of tool calls works
[−] jamalawd 44d ago
I built a site that lets you explore and browse all the Claude Code prompts in a structured way:

https://ccprompts.info

[−] restlessforge 45d ago
Okay those "hidden features" are amazing, especially the cross-session referencing. I hope we can look forward to that in the future

Also I definitely want a Claude Code spirit animal

[−] jatins 45d ago
There's this weird thing about AI generated content where it has the perfect presentation but conveys very little.

For example the whole animation on this website, what does it say beyond that you make a request to backend and get a response that may have some tool call?

[−] swyx 45d ago

> also related:

https://www.ccleaks.com

This deployment is temporarily paused

[−] sibtain1997 45d ago
Kairos and auto-dream are more interesting than anything in the agent loop section. Memory consolidation between sessions is the actual unsolved problem. The rest is just plumbing tbh
[−] WaterRun 45d ago
Thanks to Claude Code, we got such a beautifully polished and dazzling website that gives a complete introduction to itself the very moment the leak happened :)
[−] apeace 44d ago
Pardon me, but I think it's rather obvious that it worked this way?

The real value of Anthropic is in the models that they spent hundreds of millions training. Anyone can build a frontend that does a loop, using the model to call tools and accomplish a task. People do it every day.

Sure, they've worked hard to perfect this particular frontend. But it's not like any of this is revolutionary.

[−] techpression 45d ago
519K lines of code for something that is using the baseline *nix tools for pretty much everything important, how do they even manage to bloat it this much? I mean I know how technically, but it's still depressing. Can't they ask CC to make it good, instead of asking it to make it bigger?
[−] jen729w 45d ago
Is it just me or do I not find the Claude Code application that fascinating?

I use it all day and love it. Don't get me wrong. But it's a terminal-based app that talks to an LLM and calls local functions. Ooookay…

[−] JoostBoer 44d ago
I have no engineering background. I build websites and tools for a living. Claude Code changed what's possible for me in a way that's hard to overstate.

I can't evaluate the source code architecture. What I can say is that before this, I had ideas I couldn't execute without hiring a developer. Now I ship them myself. Not prototypes, not demos. Real products that people use and pay for.

The leaked internals are interesting to engineers. From where I sit, the interesting part is that it works well enough that someone without a CS degree can build production software with it. That's the actual story.

[−] mtrifonov 44d ago
The interesting thing about agent tool use is how binary it is. The agent either calls the tool or doesn't. The harder problem is social agency, where the AI has to decide whether to participate at all. We built a pre-filter for this (cheap model reads the room before the expensive model runs) and the failure modes are fascinating. The model would reason correctly in its chain-of-thought, 'this person is left hanging, I should respond' and then output the opposite boolean. Turned out Haiku has a systematic false-bias on boolean tool outputs. Had to invert the schema
[−] codexstar 43d ago
Hello everyone! It's me behind the website. I launched the site minutes after the leak, obviously vibecoded it.

Kept working on it day and night to fix all the issues. I was using vercel free plan and did not expect this huge response. The site went down when I took a nap of 3 hours.

Woke up with calls from my team for a meeting. Saw the msgs of people telling me site is down.

Fixed the issue.

And now, I am updating it on regular speed.

Thank you for all the positive and negative feedback, Will consider it all in my future projects.

[−] brandensilva 45d ago
ccleaks.com seems to be "temporarily paused" from Vercel.

Here is another one that goes in depth as well: www.markdown.engineering for anyone going deep on learning.

[−] vivzkestrel 45d ago
would be nice if the transformers code for one of these frontier LLM models got leaked, HN will have a field day with a reveal like that
[−] AJRF 45d ago
This is AI slop.

First command I looked at:

  /stickers:
  
  Displays earned achievement stickers for milestones like first commit, 100 tool calls, or marathon sessions. Stickers are stored in the user profile and rendered as ASCII art in the terminal.

That is not what it does at all - it takes you to a stickermule website.

What is the motivation for someone to put out junk like this?

[−] jbdamask 44d ago
Nice job - I'm a fan. Makes it easy to get the big picture so I know where to dive in.
[−] simple10 44d ago
This tool is useful if you want to see all the internal commands claude agents are making in real-time:

https://github.com/simple10/agents-observe

[−] deskamess 44d ago
I like the Claude desktop interface. The color scheme, presentation, fonts, etc. Is there a CSS I can find for the desktop version - I assume it's using some kind of web rendering engine and CSS is part of it.
[−] samuelknight 44d ago
On the one hand I don't understand why it needs to be half a million lines. However code is becoming machine shaped so the maintenance bloat of titanic amounts of code and state are actually shrinking.
[−] rhofield 45d ago
Really nice visualisation of this, makes understanding the flow at a high levle pretty clear. Also the tool system and command catalog, particularly the gated ones are super interesting.
[−] 0zwan 44d ago
I don't know why people obsess and spend so much time on this codebase. It isn't (and never was)alien technology. It's just mediocre typescript generated by an LLM
[−] MattCruikshank 44d ago
Don't do the "noise" thing this web page does. It hurts my eyes so bad. Why would you purposefully make your page look like a low-quality JPG?
[−] simonreiff 45d ago
Nice site. I might suggest moving SendMessage to the Hidden Features as they don't appear to have implemented a ReadMessage or ListMessages tools.
[−] tallesborges92 44d ago
Please share the prompt/skills used to build it
[−] m132 45d ago
I mean, I get it: vibe-coded software deserves vibe-coded coverage. But I would at least appreciate it if the main part of it, the animation, went at a speed that at least makes it possible to follow along and didn't glitch out with elements randomly disappearing in Firefox...

How is this on the front page?

[−] pandemik09 44d ago
To me the question isn’t “why is the codebase so large,” it’s “why is the model still being asked to do orchestration at all.”
[−] lastdong 45d ago
I hope /Buddy is ported across to OpenCode.
[−] ramon156 44d ago
Has anyone tried USER_TYPE "ant"? I might be crazy, but I have not hit my limit yet after 3 questions.
[−] _pdp_ 44d ago
Btw, the 500K is just the source - it does not include tests. I would imagine there are at least 2-4x tests.
[−] diyseguy 44d ago
I'm just admiring the visualizations this guy built in under a day. Wondering how he did it so fast