[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48E7949A-F137-4412-8F96-B4BC2F915206@kernel.org>
Date: Sat, 26 Jul 2025 09:36:08 -0700
From: Kees Cook <kees@...nel.org>
To: Mario Limonciello <superm1@...nel.org>, Sasha Levin <sashal@...nel.org>,
workflows@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
CC: rostedt@...dmis.org, konstantin@...uxfoundation.org, corbet@....net,
josh@...htriplett.org
Subject: Re: [RFC 0/2] Add AI coding assistant configuration to Linux kernel
On July 26, 2025 2:07:40 AM PDT, Mario Limonciello <superm1@...nel.org> 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
Powered by blists - more mailing lists