Skip to content

Add CLAUDE.md agent file#676

Open
jakecorrenti wants to merge 1 commit into
containers:mainfrom
jakecorrenti:add-agent-file
Open

Add CLAUDE.md agent file#676
jakecorrenti wants to merge 1 commit into
containers:mainfrom
jakecorrenti:add-agent-file

Conversation

@jakecorrenti
Copy link
Copy Markdown
Member

@jakecorrenti jakecorrenti commented May 13, 2026

Add a CLAUDE.md file to give Claude persistent context about libkrun. This includes project structure, coding standards, and workflows we prefer.

This was initially generated by running /init inside of Claude Code. I took some sections from
https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md?plain=1 and
https://github.com/openai/openai-agents-python/blob/f20aa40f56ec374841dfe6e4f3d6118c8e32fb2b/AGENTS.md.

This should be a living document that we adjust and modify as time goes on to better improve the agentic workflow.

I would love to get some discussion going about a couple things:

  • What would people like to add
  • What would people like to remove
  • How is the formatting
  • How do we handle multiple agent files? Claude doesn't support AGENTS.md, but we could have one AGENTS.md that we symlink to from the other files.

@jakecorrenti
Copy link
Copy Markdown
Member Author

I've also been using the Superpowers Claude plugin which has been useful.

I also want to experiment with Personas to see if that has any workflow improvement as well. If anyone has any other cool plugins/configurations I'd be interested to hear about those here as well.

Copy link
Copy Markdown
Collaborator

@mtjhrc mtjhrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project overview and information about running tests is definitely something we should have in a commited AGENTS.md and looks useful!

I am not a fan of committing some the general Claude "workflow" sections here however.

Also imagine someone want to override them, because they don't like them for some reason or it doesn't work well with their LLM, then it will become super annoying for them to not be able to use the project provided AGENTS.md at all and having to configure something to ignore them.

How do we handle multiple agent files? Claude doesn't support AGENTS.md, but we could have one AGENTS.md that we symlink to from the other files.

I would strongly prefer AGENTS.md and point CLAUDE.md to it. I think you can just put @AGENTS.md into a CLAUDE.md file and it would work.

Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
Comment thread AGENTS.md Outdated
Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
@jakecorrenti jakecorrenti force-pushed the add-agent-file branch 2 times, most recently from 89d9514 to e347e47 Compare May 14, 2026 15:58
Add a CLAUDE.md file to give Claude persistent context about libkrun.
This includes project structure, coding standards, and workflows we
prefer.

This was initially generated by running /init inside of Claude Code. I
took some sections from
https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md?plain=1
and
https://github.com/openai/openai-agents-python/blob/f20aa40f56ec374841dfe6e4f3d6118c8e32fb2b/AGENTS.md.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
Comment thread AGENTS.md
Comment on lines +130 to +135
Creating stubs to make code compile causes silent runtime failures:
- **EventFd**: Don't create new `EventFd::new()` - propagate existing ones (via `Arc<EventFd>` or `.try_clone()`). New `EventFd`s are never signaled -> deadlock.
- **Queues**: Don't create empty queues - pass existing ones through. Empty queues -> nothing received.
- **Files**: Don't create dummy files for `include_bytes!()`. Ask the user how to build/obtain them.

**Principle**: When something is wired into the system, propagate it. Don't create disconnected instances. If a build fails due to missing dependencies, ask the user rather than stubbing.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this section comes from my CLAUDE.md, but I am not sure if we should include it fully verbatim in the committed version.

This is also perhaps bit of workflow thing too. Though it's also a bit specific to things I found Claude (at least in the past) struggle with in libkrun. But if you test the code you submit you, you would notice your change doesn't actually work and just deadlocks immediately.

The more I think about this I realize there is sort of a tradeoff here. If we put a lot of these guidelines here it could be annoying for people that have their own guidelines like this. However it would be really beneficial for people with default agents configuration especially if they are inexperienced or don't notice the issues produced by the agent - I can see this improving the quality of random drive-by PRs.

Maybe a middle-ground could be to keep this section but shorten it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakecorrenti Have you noticed Claude or other LLMs also struggle with this? If not maybe we should hold off on this for now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I've run into that personally. The one thing I've been running into a lot is the agent basically liking to hear itself talk. i.e.

fn foo() {
    bar();
}

fn bar() {
   foobar();
}

fn foobar() {
    println!("Hello, world!");
}

@lstocchi
Copy link
Copy Markdown
Contributor

@jakecorrenti have you read this best practice doc? There are some interesting tips related to the AGENTS file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants