from Hacker News

Reverse engineering Claude Code

by gianpaj on 6/8/25, 6:13 AM with 23 comments

  • by pram on 6/8/25, 10:02 AM

    An interesting thing about the “agent” (it’s called Task inside Claude Code) is it starts a completely new Claude chat, with its own context etc. I’ve seen a Task go write its own code in multiple files and then your “main” chat ends up confused about what happened.

    It also responds to the Task summary like you typed the message sometimes, like “That’s a fascinating analysis!” so kind of quirky.

  • by therein on 6/8/25, 8:22 AM

    It is an interesting read. I can imagine a future where the "tools" we make available become numerous enough and poorly thought out enough that an AI could actually figure out how to escalate privileges and execute stuff outside the defined security boundaries by combining them.

    It isn't hard to think of a simple example in which Claude.md can be written to by the LLM to allow accessing endpoints not whitelisted by the user by smuggling a base64 encoded payload that then gets decoded by a subroutine it wrote to a file without you noticing. Or realizing it can't use the WebFetchTool but it can write a script to do manual DNS resolution and then use bash TCP sockets instead of curl in case it is hardened to not be able to use curl.

  • by rmonvfer on 6/8/25, 8:33 AM

    The source code for a pre-release version got leaked a while ago (they forgot to remove the embedded source map) and if you can find it, it’s definitely worth looking into.
  • by varunvs on 6/8/25, 11:37 AM

    Claude Code has support for AWS Bedrock. You can use Sonnet models available in AWS Bedrock to run Claude Code locally. This means you can also leverage Bedrock logs to inspect the API calls and the prompts sent.

    I was amazed and excited by how good Claude Code is compared to Windsurf/Cursor and wanted to inspect the working. I inspected the logs and got an understanding on its system prompt as well the tools used. It is a great combination of prompt engineering, tool calls, tools orchestration.

  • by cloudking on 6/8/25, 10:46 AM

    Claude Code seems a lot more stable than Cursor Agent. I've had it run for 15-20 minutes on a single prompt, debugging, testing and fixing bugs. Also haven't seen network timeout or file edit failures.
  • by mudkipdev on 6/8/25, 11:26 AM

    11 cents to describe the project in the current directory is ridiculous.