Code-Index-MCP: Command for Claude Code

.claude/commands/update-docs.md

update-docs is a command for Claude Code from Consiliency/Code-Index-MCP. It costs 0 tokens per session (3,552 once invoked), scanned A, original, MIT.

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

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; positional $N argument; mentions AGENTS.md.

This is Consiliency/Code-Index-MCP's own configuration. It tells Claude Code how to work on Code-Index-MCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Code-Index-MCP configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./docs/scripts/ai-guidance-consolidate.sh.

Reuse

Borrowing it

Nothing to install: this file belongs to Consiliency/Code-Index-MCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Consiliency/Code-Index-MCP/main/.claude/commands/update-docs.md
Clone the repo
git clone --depth 1 https://github.com/Consiliency/Code-Index-MCP

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for update-docs

README.md
[![agentmods](https://agentmods.dev/badge/commands/consiliency/code-index-mcp/update-docs/github.svg)](https://agentmods.dev/commands/consiliency/code-index-mcp/update-docs)
Your own site
<a href="https://agentmods.dev/commands/consiliency/code-index-mcp/update-docs"><img src="https://agentmods.dev/badge/commands/consiliency/code-index-mcp/update-docs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for update-docs

Your own site · 80×15
<a href="https://agentmods.dev/commands/consiliency/code-index-mcp/update-docs"><img src="https://agentmods.dev/badge/commands/consiliency/code-index-mcp/update-docs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.03552
Opus 5.5 $0.00000 $0.01421
Sonnet 5.5 $0.00000 $0.00710
Haiku 4.5 $0.00000 $0.00355

Measured 2mo ago against content hash 7ff719cb7da3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (60 stars, last pushed yesterday), 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.

Related

update-docs compared with commands from other repositories

update-docs next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
update-docsConsiliency/Code-Index-MCPCommand60yesterdayMITA0Claude Code
checklistgithub/spec-kitCommand148kyesterdayMITA13Claude Code
clarifygithub/spec-kitCommand148kyesterdayMITA27Claude Code
specifygithub/spec-kitCommand148kyesterdayMITA13Claude Code
analyzegithub/spec-kitCommand148kyesterdayMITA26Claude Code
convergegithub/spec-kitCommand148kyesterdayMITA35Claude Code
implementgithub/spec-kitCommand148kyesterdayMITA14Claude Code