On July 26, 2025 2:07:40 AM PDT, Mario Limonciello <[email protected]> wrote:
>> Example patch creation with Claude Code:
>> 
>>      $ claude -p "Fix the dont -> don't typo in 
>> @Documentation/power/opp.rst. Commit the result"
>>      Done! The typo has been fixed and committed.
>
>Is this actually how people use AI agents?  I've never thought of asking an 
>agent to write a whole patch and commit the result.

Yeah! I've been using the interactive modes (e.g. just the "claude" command). 
The insight by a friend of mine is to have the agent update its own knowledge 
base regularly. For example, for a first time session, using Claude I would run 
"claude" in the root of the kernel tree, and then write:


/init
Find and read the coding style and submitting patches documentation in the 
Documentation/ directory
Always use a build output directory, like "claude-build". This must always be 
specified with the O= option for make
This is a big build machine, so also always use the -j128 option for make
Perform a build of the kernel
Save anything new you've learned in your CLAUDE.md file
Keep all new .md files and temp files in the agentic/ directory
Examine git history of commits by Kees Cook over the last 5 years and write out 
a new .md file that describes his commit log writing style
Use this for any commit messages we write
Figure out how to run KUnit tests, the docs are in Documentation/
Run the fortify KUnit tests
Update your CLAUDE.md with anything new you've learned


(Note that I run the agent as an entirely separate user in a Docker container.)

The agent acts like an intern who reads VERY quickly, but forgets things 
regularly. So it has to be both reminded to save new stuff it learns (I break 
things into separate .md files), and then read them back again after it starts 
forgetting.

It still needs extensive hand-holding, and it's rare that I'm happy with its 
commit logs, but it is pretty helpful so far. That said I've been focusing on 
some smaller refactoring work just to feel out how to use it. I have some hints 
that it would struggle with doing very large scale refactoring on its own, but 
it's nice to toss it at a huge patch I generated via Coccinelle and say "build 
this across all our configured archs and fix any compilation failures you 
encounter" and then go have lunch. ;)

-Kees

-- 
Kees Cook

Reply via email to