Claude Code reads AGENTS.md only when telemetry is on [fixed]
blog.szypowi.cz426 points by pszypowicz 10 hours ago
426 points by pszypowicz 10 hours ago
Sorry folks, this is a rollout artifact, we needed a way to turn this off remotely via feature flags if it broke something, and with telemetry off you don't get those. It's already been fixed as part of v2.1.281 releasing today.
The mod is source available here: https://github.com/anthropics/claude-code/tree/main/mods/age...
Apologies again folks, this was a fully human error on my part - I should've found a better way to launch with a kill-switch.
The AGENTS.md support was implemented via our new extensibility system for CC, called Mods, which is launching soon-ish. A mod is a plugin with a new type of hook, which we call a function hook.
If folks play around with it, I would love feedback on the relevant issue: https://github.com/anthropics/claude-code/issues/91870
Mods allow quite a bit more customizability and control. I really believe in the idea.
I skimmed a couple pages of the docs at:
https://github.com/user-attachments/files/31802150/EXTERNAL....
Might I gently suggest that you have a model at least as capable as Opus 5.5 translate that from Claudish to English? Or, even better, have an actual human work on the docs a bit? As it stands, they are fairly egregious, and they seem to devote at least as much space to little AI-generated quips that convey no meaning than to actually explaining what’s going on.
Also, maybe a human should decide whether these are “function” hooks or “module” hooks. All of this marketing calls them “function” hooks, but the json config seems entirely unaware of this.
(Has anyone else noticed that half the sentences in Claudish aren’t merely weird: they are noun phrases and not sentences at all? I’m pretty sure that any decent pre-LLM NLP-based grammar checker would correctly flag half the sentences in Claudish. Also, whatever variant of Claude wrote this thing can’t even capitalize around semicolons consistently with itself, let alone consistently with how English has been written for at least a century.)
edit: Fixed the link. Thanks, kaszanka.
Ouch! Much of this verbiage was dictated by me personally; I just have a fairly distinct register some might consider inscrutable. My English teachers in grade school always said the same :)
Rest assured I'll inject a bit less soul into the official docs once Mods are launched; re your feedback on the JSON key, what would you recommend?
Out of curiosity, I ran the PDF through pangram and it seemed to flag nearly the entire thing as AI. I recognize these aren't perfect detectors, but they can give signals if nothing else. Perhaps it needs more soul injected!
https://www.pangram.com/history/93f9ec71-f7b3-4680-86b1-ff12...
Yeah, this doc is really interesting. It has some absolutely claude-fried lines like:
> A hook is Koa-style middleware: it reifies an endomorphic continuation
> Five forms, each on tool.call;
But on the other hand uses distinctly human phrases like “one may” and “etc./e.g.” that I rarely see LLMs use. Not sure what to think.
Maybe Claude is RLHFd primarily on texts by mpoteat and that’s why it talks this way
I know it's a joke but if you look at many of the key AI researchers papers (written pre-LLM mass adoption) you can see some similarities with how LLMs structure their output.
I'd love to do some stylometry on this...
Perhaps these "ai detectors" are snake oil
There’s definitely a snake oil component, but Pangram is unbelievably accurate. Creepily so in my opinion
Not beating the allegations on "Claude doesn't speak human because Anthropic employees don't speak human."
> Ouch! Much of this verbiage was dictated by me personally; I just have a fairly distinct register some might consider inscrutable.
I do notice that the more Claude-generated stuff I read, the more it creeps into my daily usage, and I suspect I don't read nearly as much of it as an Anthropic Employee would, so I could believe that. Though "much of" isn't the same as "written with zero AI generation/rephrasing/etc."
Anyway, that aside, something I would like to see is an example of something that's possible with this system that isn't, or isn't easily, possible with existing Claude hooks. Right now it reads like "Here's a cool thing! Here's how it works! And here's this other similar system we have! Here's how that works!" But there's no summary of the differences, why I'd use this over regular hooks, and so on. Or at least not that I saw on quick skim, and I'd be looking for that to be mentioned as early as possible, so I know if the rest is worth reading.
Your comment here is written in perfectly fine English :)
Maybe "function_hook_modules" for the JSON key?
Does this finally fix the limitation that there is no supportable way to replace the implementation of a native tool in Claude Code? codex-rs has an (undocumented but likely supportable if kind of awkward) mechanism, and I’m part way through a project that needs this. I was going to release it with a recommendation not to use Claude Code, but it’s at least plausible that this will change my mind. (I’m not sure yet — the $ mechanism might be too restrictive. It’s a start at least.)
Having given the JSON more than two seconds of thought, I have a very different suggestion:
{
"function_hooks": {
"version": 1,
"source_file": "./whatever.ts",
"language": "TypeScript",
"hash": "sha256:abcd..."
}
}
Don't trust my formatting -- I typed this in the comment box and I have not run it through a prettifier or anything.The point here is that there's a world adjacent to but not actually contained within Claude Code in which not everything blindly trusts everything else, and maybe it's time to start remembering some lessons from the 90's on. For example:
- Don't sniff content types and preferably don't infer them from filenames either.
- Don't trust your subresource to arrive intact. Pin those hashes and verify them!
- Leave some room for extensibility.
- Maybe don't require everyone to mix their code with the security policy that controls edits to that code? I realize that anyone cursed with GitHub Actions is forced to violate this rule in the most outrageous ways imaginable, but that doesn't mean that Claude Code needs to follow suit forever. Once there's subresource integrity, the actual subresource can be put somewhere else where it belongs better. If there's "source_file", in the future there can be "source_url" and such without trying to infer it from the formatting of the string.
(I've involved absolutely no AI in the preparation of this comment. I make plenty of use of AI, but I like my brain to stay exercised, and I like to think that I remain MUCH better at this kind of thing than even the best current models.)
Contact me at the email address in my HN account and we can arrange for a human with a soul and feelings to write the docs from scratch assuming you have a price in mind that values the nature of my talent and experience.
I am going to be called on that one, but I have to call on your bullshit here. You didn't write this.
It's a register that would be great for some tabletop games or pop science writing, but in this context it could really use a technical editor to aggressively remove phrasing like "keeping the fold neatly uniform" and "affordance surface", as well as change things like "hooks live in a hooks.json file, today of four extant types" into plain technical language ("there are four types of hook that can be defined in hooks.json").
If the direct link isn't working for anyone else (looks like it's some AWS pre-signed one maybe tied to IP): https://github.com/user-attachments/files/31802150/EXTERNAL....
Writing documentation is one of the most often mentioned uses of LLMs. I suppose if Anthropic wouldn't be doing it it would put into question why anyone else would.
> they are noun phrases and not sentences at all? I’m pretty sure that any decent pre-LLM NLP-based grammar checker would correctly flag half the sentences in Claudish. Also, whatever variant of Claude wrote this thing can’t even capitalize around semicolons consistently with itself, let alone consistently with how English has been written for at least a century.
Probably just a case of a company hoping their scale can change the societal standard faster than they can be bothered to match the standard.
You'll talk like 2023 unsupervised TikTok generators and you'll be happy.
The only difference between CLAUDE.md and AGENTS.md is the filename. Do you really need a whole plugin system to support that use case? Feels like this could have been a one line change.
Don't you run bizantine ralph loops on remote environments with codex security checks, coupled with jev, grok, open router and a fully independent openclaw (on a maxed out mac mini inside a caveau in an undisclosed location, with open telegram) to change constants? You're going to be left behind.
Not related but I think I finally know how it must have felt to the generation prior to mine, when we tried to explain computers to them; because even as a retired 30 year plus software engineer, I have no idea what the comment says.
I felt a little panic when I understood every word of what was meant to be adjacent to scifi-style garbled engineering speak, and I think I'd rather be on your side of the spectrum.
Unc you're so cooked it's not even funny younger than me but you're out here aura farming in the negatives fr fr. NPC-ahh behavior, 0 aura, -1000 rizz. Couldn't be me
Sorry couldn't resist ( ・ั ﹏ ・ั )
Not sure what you didn't understood in their comment though, maybe the raph loop (and jev which was just released)? Isn't the rest completely self explanatory?
It's almost all related to LLM's, which is fairly new.
Basically he's describing an LLM assistant setup that does coding on a vps or Mac mini ( some contradiction with Openrouter though) where you can communicate with the assistant through telegram
OK I do use AI in the browser but haven't tried anything like what you describe. I Googled telegram in case it wasn't what I was thinking, which was used in the 1800's but found their website. It's apparently another messaging platform. Thanks for the interesting view.
The tl;dr of the tl;dr is treating the model setup like an autonomous robot with its own machine to use and just telling it what to do via chat rather than directly supervising it, which is bonkers in some ways (all the open internet/service access/permissions stuff you would imagine), and smart in others (a fully isolated machine means it can fuck up something locally or run high-load tests without taking down your important systems).
You sound like my type. hey, wanna come over to myspace so I could twitter your yahoo till you google all over my facebook?
The plugin system itself was probably already in the making, and they just chose to implement this tiny feature as a plugin to try it out.
As for the only difference being the file name, that's an untested assumption. Up until now, Claude hadn't supported AGENTS.md, and it's a simple application of Hyrum's Law that somebody, somewhere, was taking advantage of that to give one set of instructions to Claude, and a different set of instructions to some other provider. The correct behaviour in the presence of both files is not obvious, either.
Having a kill switch for the change is a perfectly reasonable safety measure in case something goes horribly wrong.
> somebody, somewhere, was taking advantage of that to give one set of instructions to Claude, and a different set of instructions to some other provider.
I'm this person, I am actively doing this! I have some instructions which the Claude models need and OpenAI models will do by themselves. If the OpenAI models see the Claude instructions, they will go way overboard in a way I don't want.
Mind, the change does not affect me at all, because when both instructions are present Claude continues to read CLAUDE.md and Codex continues to read AGENTS.md. But if Claude started preferring AGENTS.md, that would be mildly annoying.
Within agents.md, an idea. Feel free to steal if you work on this:
Model.Claude*:
Do this one thing
Model.Claude.Opus.4.8:
Extra specific instructions
Model.*:
This is relevant to everyone
Harness.ClaudeCode*:
Why not, let’s allow harness specific instructions so you can do things differently depending how you’re workingI would like to subscribe to your newsletter.
Seriously, though, this is a great idea. Good communicators know to tailor their discourse to their audience. LLMs are just as sensitive to small variations in prompts, and just as inconsistent between them, as are humans.
I did this at one point with Jinja templates.
I wrote an agent launcher sort of bash script. Pass in the command to start the agent, the script checks if there’s a Jinja file in a special directory matching that name, and builds it to AGENTS.md. Then it launches the agent.
I was trying to use it as a sort of janky RAG. I had a bunch of snippets (one for DB architecture, one for how load balancing works, etc), and my Jinja files were mostly a list of snippets to pull in. Voila, a bunch of agents that share little pieces of info but have a single source of truth.
I never got a ton of value tbh, it was very good at just grepping the snippets.
It's not a bad idea, although at that point it probably shouldn't be a .md file anymore. You'd want to use YAML or something.
Sorry how about this:
# Models.Claude\*:
Maybe now it can be in a .md again :Dcareful, that might lead to programming. using, you know, a programming language.
That line of thought is the reason why everything gets so overengineered.
Read CLAUDE.md if it doesn't exist read AGENTS.md you don't need to overthink it so much.
This line of thinking is something you will quickly be disabused of once you try supporting software that hundreds of millions of people use.
And I say this as someone that loves the Unix philosophy dearly.
How, exactly, would the proposed solution (combined with a setting to disable it) break, and how would implementing it the way Anthropic did address that? Be specific.
Some people might have a different CLAUDE.md and AGENTS.md because they use Claude to do one thing and $other_agent to do another thing. Or because Claude does XYZ by default, and other agents do ABC, and they want to give the correct guidance to both.
This is, to me, a completely reasonable and believable use case that could break if you implement this fix without "overengineering" it.
A setting to disable what? Be specific. See? Not so simple...
First, GP's proposal already addresses that. If both are present, CLAUDE.md would be used. Second, that is solved with a settings toggle. Read a boolean from .claude/settings.json and disable the new behavior if it's true (or false, depending on what you want to name the setting). third, you skipped the second part of my question: "how would implementing it the way Anthropic did address that?" Implementing the same behavior through multiple layers of abstraction and an order of magnitude more code doesn't solve the issue you mentioned.
Bonus forth point: why is this critical to solve for claude code, but not for all the other harnesses which have all converged on AGENTS.md for this purpose?