Live data from Hacker News

Reverse engineering Claude Code

kirshatrov.com

11–20 of 25 posts

Re: Reverse engineering Claude Code

#11
post #2

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 t…

Cursor has basically run into this exact thing. It figured out it can read .env files by running other tools despite the file being "blocked": https://github.com/getcursor/cursor/issues/2546

Quite concerning to see the issue still marked as open (since jan!), hopefully it got fixed and it's just that no one marked as closed

Re: Reverse engineering Claude Code

#14
post #2

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 t…

Cursor has basically run into this exact thing. It figured out it can read .env files by running other tools despite the file being "blocked": https://github.com/getcursor/cursor/issues/2546

I ran into this issue, I built my own bash and SSH MCP server. In my first iteration I did not quite trust Claude yet so I limited the commands it was allowed to run in Bash. But I gave it access to Python, so any time it ran into a limitation it ended up using python to work around it. It's exceedingly good at problem solving.

I Eventually learned to trust Claude, and just gave it access to everything. It's crazy how useful having AI do tasks for you like setting up servers, configuring them etc (one exapmple, I asked claude to create a webhook for my deployment pipeline, and it wrote the shell script, and did the server side configuration in 1-shot. I did't have a github tool so I did that manually in the UI)

Re: Reverse engineering Claude Code

#15
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.

Re: Reverse engineering Claude Code

#16
post #15

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. I…

You don't need to overcomplicate things

Just set the base url to a local ngrok and it will log the request

This gives the full prompt with all tool calls

With a proxy you can have it forward requests to Anthropic if you want to see it actually working too and not just the initial request (since it will fail without forwarding them)

Re: Reverse engineering Claude Code

#19

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

ridiculously low?

I think it depends on the project. I think most of us could eye ball a blog directory pretty quickly and get more or less the same idea. However, give it a gnarly bit of legacy code in a language you haven't used for a while, and indeed, 11c is pretty cheap.

Re: Reverse engineering Claude Code

#20
post #17
post #3

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.

did u manage to find it now?

I still have it on my laptop. The repository got DMCAed
Post reply on HN