Update Logic Index
Updates the semantic understanding of the codebase by scanning Python files, extracting function/class signatures, and generating incremental summaries using Gemini.
Process
- •
Check Configuration:
- •Check if
.claude/logic_index_configexists. - •If missing:
- •Create it from
skills/update-logic-index/default_logic_config.template. - •Use
AskUserQuestionto prompt the user: "Configuration generated. Please review.claude/logic_index_configto exclude unnecessary directories (to save Tokens). Continue?"
- •Create it from
- •If exists:
- •Read the file content.
- •Use
AskUserQuestionto prompt the user: "Existing configuration found. The scan will run based on these rules (consuming Tokens). Proceed?"
- •Check if
- •
Execute Scanning:
- •If user confirms, run:
python skills/update-logic-index/run.py
- •If user confirms, run:
Configuration (Environment)
Requires the following environment variables (injected via settings.json > env):
- •
GEMINI_API_KEY: Google Gemini API Key. - •
GEMINI_MODEL: Model name (default:gemini-3-flash-preview). - •
GEMINI_MAX_WORKERS: Concurrency limit (default: 5). - •
GEMINI_BASE_URL: (Optional) Custom API endpoint.
Output
Generates:
- •
.claude/logic_index.json: Incremental cache of AST hashes and summaries. - •
.claude/logic_tree.md: Readable Markdown tree for context injection.
Summary Identification
- •
[Doc] ...: The summary is directly extracted from the source code's Docstring (first 3 non-empty lines). No API cost. - •
Small utility function.: The function has no Docstring and is very short (< 3 lines). API call skipped to save tokens. - •
[Source] .../[Sink] ...: LLM-generated summary identifying data flow origins or destinations. - •(Plain Text): Generated by Gemini LLM. Consumed tokens.