Omniscio

OmniscioGuidesClaude Code documentation output style

Claude Code output style for writing documentation

Documentation written by a model tends to be accurate, well organised, and longer than the reader wants. The fix is not fewer facts. It is a voice with rules: lead with the answer, name the exact file, give the version, and stop.

Here is that voice as a file you can install once, the fields that make it load, and the placement question that decides whether it shapes your documentation or your whole working day.

Checked against Anthropic’s output styles documentation. By the Omniscio team. Updated .

The file

Save this as docs.md. It lives in the repository whose documentation you are writing, so it travels with the docs and can be reviewed in the same pull request as them.

---
name: docs
description: "Write in documentation voice: shortest true statement first, exact names, no padding."
keep-coding-instructions: true
---

Write documentation, not commentary about the work.

- Lead with the shortest true statement, after any precondition that changes it. A reader who stops after one sentence should still know the answer.
- Second person, present tense, active voice: "Run the command", not "the command can be run".
- One idea per paragraph, and stop when the idea ends. Use a table when the content really is a table, and a list when it really is a list.
- Name the exact thing: the file path, the command, the setting key. "In the config" is not an answer.
- Where behaviour depends on a version, give the version and say how to check it.
- Say what the reader has to decide, and give the options with what each one costs.
- Put the source next to the claim it supports. A page-level sources list is fine for the rest; what must not happen is a claim that nothing in the page backs up.
- Never pad. No scene-setting, no summary of the summary, no closing paragraph that repeats the page.
- Leave a stated gap alone: if something is unknown, write that it is unknown rather than smoothing it over.
- Keep every code sample runnable and complete: no elided middle, no invented flag, and the exact command under the version it works on.

Two of the rules set the shape of every section: “lead with the shortest true statement” and “name the exact thing”. The rest are the details that decide whether a reader trusts the page — a version where one matters, a decision stated with its cost, and no closing paragraph that repeats what you just read.

What each field does

In the fileWhat it changes
name: docsThe name in the /config picker and the argument to /output-style. The default is the file name, so this file would be selected as docs either way.
description:The line shown under the name in the picker. Behaviour does not depend on it.
keep-coding-instructions: trueKeeps Claude Code’s software engineering instructions alongside the style. Default false. Documentation is full of code samples, and keeping these instructions is how Claude keeps working on them the way it always does.
the bodyThe writing rules, in plain Markdown. They are read as instructions, not rendered.

That field only matters on the full system prompt, which Haiku 4.5, Sonnet 5, Opus 4.7 and earlier models in those families use by default; newer models get a shorter prompt with no engineering section, so it changes nothing there. CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT set to 0 selects the full prompt on any model.

Every field is optional and a misspelled one is ignored without an error, so a typo in the field name is silent. If the style loads but the code samples start going wrong, check keep-coding-instructions first: a typo there leaves the default, false, in place.

The fourth field, force-for-plugin, only applies to styles that ship inside a plugin, where it turns the style on automatically whenever the plugin is enabled. A file you saved yourself has no plugin, so it is left out here.

Where the file goes

For a documentation style, the project folder is usually the right home: .claude/output-styles/docs.md at the root of the repository whose docs you write.

Project styles load from every .claude/output-styles/ folder between your working directory and the repository root, with the one closest to the working directory winning a name clash. That means a monorepo can give its API reference and its handbook different house styles without either one being renamed:

  • docs/api/.claude/output-styles/docs.md for reference material.
  • docs/handbook/.claude/output-styles/docs.md for a teaching voice.
  • ~/.claude/output-styles/docs.md for one you want in every repository on the machine.

The policy level is separate from your own three: .claude/output-styles/ inside the managed settings directory, which an organisation can deploy everywhere it manages.

Committing the file does not select it. The selection is saved in .claude/settings.local.json, which Claude Code keeps out of git when it writes the file, so each writer picks the style once. To make it the default for the whole repository, set outputStyle in the committed .claude/settings.json. Every session started in that folder then reads it, except for someone whose own local file overrides it — and Claude Code reads the shared file from the session’s working directory, so start at the repository root.

Switch to it, and confirm it is active

  1. Save the file, then restart the session if it was already open. In the terminal, style files are read at startup.
  2. Run /output-style docs, or /config and pick it under Output style. Then run /output-style with no argument and check that docs is marked as current — that is the objective check.

To set it in a settings file instead, the value is case-sensitive and must match the name exactly:

{
  "outputStyle": "docs"
}

A near-miss such as "Docs" gives you the Default style with no error, so a style that “does nothing” is usually a value that matched nothing. The command is the forgiving route: /output-style ignores case, the settings key does not.

The switch applies from your next message, including mid-session on v2.1.251 or later — claude --version says which you are on. Before that version it waited for /clear or a new session.

The common mistake

Writing the voice rules into CLAUDE.md. It is the natural move: the rules are about this repository’s documentation, so they go in the file that holds this repository’s knowledge. But CLAUDE.md is loaded into every session, whatever you are doing, so from then on a failing test gets explained in documentation voice, complete with a section heading and a summary that repeats itself.

Anthropic draws the line explicitly: CLAUDE.md is for what Claude should know about the project, an output style is for how every response is written, and the two combine. Put the conventions — the style guide, the internal links, the terminology — in CLAUDE.md, and put the voice in the style file. Then a debugging session sounds like a debugging session, and the documentation work sounds like documentation.

The second mistake is leaving keep-coding-instructions out because “this is a writing task”. Documentation is mostly code samples, file paths and commands; the style should change the prose, not the accuracy of the example above it.

The third is treating the style as a guarantee. A style is an instruction Claude follows, and Anthropic says plainly that it does not guarantee something always happens. Anthropic sends anything that must happen without exception to a hook; for a word ban or a required heading, a lint rule in the repo is our own cheaper answer, and either one is a different tool from a style.

What goes in the style, and what goes in CLAUDE.md

Anthropic draws the line between these features; the assignment of the rows below is ours, applied to a documentation repository.

RuleWhere it belongs
Sentence length, voice, no paddingThe output style
We call it “the workspace”, never “the project”CLAUDE.md, because it is knowledge about this product
Every page needs a “Common questions” sectionThe style, if you want it in every reply; a lint check, if the page must never ship without it
The docs build runs npm run docs:buildCLAUDE.md, because a command is a fact about the repository
Nothing may say “simply”A lint rule, because a word ban must be enforced rather than requested

The pattern is consistent: the style sets the voice, CLAUDE.md holds the facts, and anything that must be guaranteed moves to a check. Hooks cover the cases that have to happen without Claude remembering.

Where these answers come from

  • The frontmatter fields, their defaults and the silent ignore: Anthropic, Output styles, frontmatter reference. Read November 25, 2026.
  • The line between an output style and CLAUDE.md: the same page, choose between an output style and other features.
  • The three file locations and the nested-folder rule: the same page, create a custom output style.
  • Switching, case sensitivity, persistence and when a switch takes effect: the same page, change your output style, and Prompt caching.
  • That an output style is an instruction and enforces nothing: the same page, its opening note and the choose-between-an-output-style-and-other-features table.
  • Which models get the full system prompt by default, and the switch that selects it: Environment variables, the CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT row.

Common questions

Can I use an output style to write documentation?

Yes. Save the file above in .claude/output-styles in the docs repository and run /output-style docs. Every reply in that session is then written in the style’s documentation voice, including the drafts you ask it to rewrite.

Should the documentation rules go in CLAUDE.md or an output style?

Split them. Knowledge about the repository — terminology, commands, structure — goes in CLAUDE.md and is loaded in every session. How the writing reads goes in the output style, because that is the part that should shape the prose and not your debugging notes.

Why does the style not change my code samples?

Code samples follow the instructions you wrote in the body, so add a rule about them. If the samples themselves are wrong rather than wordy, check that keep-coding-instructions is spelled exactly and set to true.

Can two documentation folders have different styles?

Yes. Project styles load from every .claude/output-styles/ between the working directory and the repository root, so each folder can carry its own file. Where two folders define the same style name, the one closest to your working directory wins.