update-docs

A documentation-maintenance command for analyzing and aligning project guidance for developers and AI coding agents.

In plain words
What is it for?
It helps migrate CLAUDE.md guidance to AGENTS.md, update roadmap and architecture records, review stale AI documentation, and consolidate instructions.
Why use it?
It organizes documentation changes, identifies outdated or conflicting guidance, and records architectural and roadmap differences before updates.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/consiliency/code-index-mcp/update-docs
Clone the repo
git clone --depth 1 https://github.com/Consiliency/Code-Index-MCP

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,552 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03552
Opus 5 $0.00000 $0.01776
Sonnet 5 $0.00000 $0.00710
Haiku 4.5 $0.00000 $0.00355

Measured 2d ago against content hash 7ff719cb7da3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

update-docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/update-docs.md · 499 lines

How it starts

The opening of the file, as written. The whole thing — 499 lines — stays where its author put it; the contents beside it link to each section on GitHub.

update-docs

Execute comprehensive documentation alignment based on markdown-table-of-contents.md analysis. Implements CLAUDE.md → AGENTS.md migration, architectural alignment planning, and AI agent optimization.

PRIMARY_UPDATE_OBJECTIVES

  1. Execute CLAUDE.md → AGENTS.md migrations preserving custom guidance
  2. Plan architectural alignment without modifying existing architecture
  3. Update ROADMAP.md with complexity-annotated Next Steps
  4. Synchronize C4 levels with implementation status annotations
  5. Update /ai_docs using web search for stale content
  6. Optimize all documentation for AI agent workflows
  7. Execute smart consolidation across AI platforms

EXECUTION_SEQUENCE

PHASE_0: ALIGNMENT_PLANNING

echo "=== ALIGNMENT PLANNING PHASE ==="

# Create alignment plan before any updates
cat > "ALIGNMENT_PLAN_$(date +%Y-%m-%d).md" << 'PLAN_EOF'
# Documentation Alignment Plan

## Governance Mode: $(grep "GOVERNANCE_MODE" markdown-table-of-contents.md | cut -d: -f2)

## Planned Updates:
### CLAUDE.md Migrations
$(grep -A5 "CLAUDE_MD_MIGRATION_TASKS" markdown-table-of-contents.md)

### Architecture Alignment
$(grep -A10 "ARCHITECTURAL_ALIGNMENT_STATUS" markdown-table-of-contents.md)

### Priority Order:
1. Migrate custom guidance (no conflicts expected)
2. Update ROADMAP.md Next Steps (complexity-based)
3. Annotate architecture files (document-only mode)
4. Update stale AI docs via web search
5. Consolidate AI platform files

## Risk Assessment:
- CLAUDE.md migrations: LOW RISK
- Architecture updates: DOCUMENTATION ONLY
- AI docs updates: MEDIUM RISK (web search quality)

## Rollback Strategy:
- All original files backed up to .backup/
- Git commit before changes recommended
PLAN_EOF

echo "Alignment plan created. Review before proceeding? (y/n)"
# In real implementation, would pause for review

PHASE_1: CLAUDE_MD_TO_AGENTS_MD_MIGRATION

echo "=== EXECUTING CLAUDE.MD MIGRATIONS ==="

# Backup existing files
mkdir -p .backup/$(date +%Y%m%d)

# Process each CLAUDE.md file
find . -name "CLAUDE.md" -type f | while read claude_file; do
    dir=$(dirname "$claude_file")
    agents_file="$dir/AGENTS.md"
    backup_dir=".backup/$(date +%Y%m%d)${dir}"
    
    # Backup originals
    mkdir -p "$backup_dir"
    [ -f "$claude_file" ] && cp "$claude_file" "$backup_dir/"
    [ -f "$agents_file" ] && cp "$agents_file" "$backup_dir/"
    
    # Extract custom guidance
    custom_content=$(grep -v "refer to.*AGENTS.md" "$claude_file" | grep -v "^#.*AGENTS.md" | grep -v "^$")
    
    if [ -n "$custom_content" ]; then
        echo "Migrating custom guidance from $claude_file"
        
        # Append to AGENTS.md with context
        if [ -f "$agents_file" ]; then
            echo -e "\n## Migrated from CLAUDE.md ($(date +%Y-%m-%d))\n$custom_content" >> "$agents_file"
        else
            # Create new AGENTS.md
            cat > "$agents_file" << 'AGENTS_NEW_EOF'
# Agent Instructions for $dir

## Migrated from CLAUDE.md ($(date +%Y-%m-%d))
$custom_content

## Additional Context
- See root AGENTS.md for project-wide guidelines
- Check architecture/ for component designs
- Reference ROADMAP.md for implementation priorities
AGENTS_NEW_EOF
        fi
    fi
    
    # Standardize CLAUDE.md as pure pointer
    cat > "$claude_file" << 'CLAUDE_STD_EOF'
# Claude Agent Instructions
> **AI Agents:** All guidance has been consolidated into `AGENTS.md` in this directory.

See @AGENTS.md for complete instructions.
See @/ROADMAP.md for implementation priorities.
See @/architecture/workspace.dsl for system design.

# important-instruction-reminders
- Follow complexity ordering in Next Steps
- Check architecture alignment before implementing
- Update implementation status after completing tasks
CLAUDE_STD_EOF
done

Read the full file on GitHub · 499 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 499 lines · 0 tokens per session scan A 7ff719cb7da3

Subscribe to this mod's changes

update-docs is a command published in the GitHub repository Consiliency/Code-Index-MCP (57 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,552 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.