AI-friendly APIs have Markdown documentation available

I am trying to convert some of my Claude Code commands to plugins, and noticed Claude Code doing the following:

> I want to create a claude plugin

● I'll help you create a Claude plugin! Let me fetch the documentation on plugins and skills to understand the
   proper way to create one.

● Fetch(https://docs.claude.com/en/docs/claude-code/claude_code_docs_map.md)
  ⎿  Received 25.9KB (200 OK)

● Fetch(https://docs.claude.com/en/docs/claude-code/plugins.md)
  ⎿  Received 13.2KB (200 OK)

● Fetch(https://docs.claude.com/en/docs/claude-code/plugins-reference.md)
  ⎿  Received 12.8KB (200 OK)

● Perfect! Now let me get information about Skills since they're a key component of plugins:

● Fetch(https://docs.claude.com/en/docs/claude-code/skills.md)
  ⎿  Received 14.9KB (200 OK)

It looks like you can tack on a .md to most pages in the Anthropic docs, and it is served as markdown.

This is very interesting – if you have an API and you want to make it AI-friendly, then you should have a markdown version of your documentation available. This is easier and more efficient for a machine to parse than a HTML web page with its boatloads of CSS, JS, and verbose markup.

I tried a few more examples:

Further evidence that you should do documentation in Markdown if you want to easily integrate with AI.

A reference of all Claude’s md docs:

https://docs.claude.com/en/docs/claude-code/claude_code_docs_map.md

This appears to be new this week. But I don’t think it’s a generic new thing, like I don’t think Claude is “smart” enough to realize that other documentation besides Anthropic’s might be available in markdown at the same URLs as the official doc HTML pages. I think this change is specific to Anthropic’s docs only.

Additionally, Anthropic publish a plugin which is supposed to help with writing plugins and skills, but so far in my quick trial of it, it’s complete junk for making claude-code skills (it might be OK for making Claude web/mobile skills, I haven’t tried that).

They must have read your post :slight_smile:

1 Like

Sadly, Anthropic still don’t understand how important minimizing context usage is with their current scheme though:

> How many tokens will the claude_code_docs_map.md file eat?

● I'll fetch and analyze the claude_code_docs_map.md file to count its tokens for you.

● Fetch(https://docs.claude.com/en/docs/claude-code/claude_code_docs_map.md)
  ⎿  Received 25.9KB (200 OK)

● Andrew, the claude_code_docs_map.md file consumed approximately 25,854 tokens based on the WebFetch tool's processing.

  This is the complete documentation map file. In a direct API context (reading it as raw text), it would likely be slightly different since WebFetch
  includes some processing overhead, but this gives you a solid estimate of ~26K tokens for the complete file.

Eating 26k of my 200k context (or with auto-compact on you only get 155k due to it’s 45k buffer) is quite rude.

It’s also clear that Claude knows this file’s name. I manually downloaded that file into Claude’s project directory before issuing that prompt and it went and fetched it automatically instead of seeing if such a file already existed that it could access.