Agents

Docs sync subagent: update docs after code changes

A Claude Code subagent that finds README, docs and code comments made stale by your branch (renamed functions, CLI flags, env vars, config keys, endpoints) and updates them to match the code.

Agent in Engineering by AISkillHub Library

What it does

Documentation goes stale one rename at a time. This subagent checks your branch for changes that documentation usually depends on and fixes the references.

**What it tracks** - Renamed or removed exported functions, classes, components and types. - CLI commands and flags. - Environment variables (added, renamed, removed, new defaults). - Configuration keys and default values. - HTTP endpoints, parameters and response fields. - Installation and setup steps (new required services, changed scripts in `package.json`, `Makefile`, `composer.json` or `pyproject.toml`).

**Where it looks** `README*`, `docs/`, `CONTRIBUTING*`, `.env.example` and similar sample files, docstrings and JSDoc of changed code, `CLAUDE.md` and `AGENTS.md`, and inline code samples in Markdown.

**How it works** It computes the branch diff, extracts the identifiers above, searches the documentation for each old name or value, and edits the matches. For new things (a new env var or flag) it adds them to the closest existing reference list, following the format already used there. It then reports each edit with the code change that motivated it.

**What it will not do** It will not write new guides or restructure documentation, and it does not edit changelogs or release notes. It does not document behavior it cannot see in the code; if a new option's purpose is unclear, it lists it as a question. It leaves versioned docs for older releases untouched.

How to use it

1. Save the file below as `.claude/agents/docs-sync.md`. 2. After finishing a change on a branch, ask Claude Code: "Run docs-sync on this branch" or "update the docs for my changes". 3. Review the doc edits in your diff before committing. 4. If your docs live in another folder (for example `website/content/`), say so in the request or add the path to `CLAUDE.md`.

Files

Save each file at the path shown, relative to your project root.

  • .claude/agents/docs-sync.md2.7 KB

More agents

See all