logicstamp_refresh_snapshot
Refresh codebase context by analyzing React/TypeScript/Node.js projects and generating structured bundles with component summaries, dependency information, and a snapshot ID for AI-assisted analysis.
Instructions
⚠️ CRITICAL: Do NOT use sleep() delays. After calling this tool, bundles are immediately available. When watch mode is active, skip this tool entirely and read bundles directly - they're already fresh. ⚠️ FIRST: Call logicstamp_watch_status! If watch mode is ACTIVE → SKIP this tool, go to list_bundles → read_bundle (context is fresh). Use when: watch mode INACTIVE, first-time analysis, or after large changes. Default skipIfWatchActive=true (auto-skips regeneration if watch mode active). WHAT IT DOES: Runs stamp context to analyze React/TypeScript/Node.js codebases (Next.js, Express.js, NestJS) and generate structured context files (context_main.json + per-folder context.json bundles). These are STRUCTURED DATA, not raw source. SLOW compared to reading existing context. WHAT YOU GET: Summary statistics (component counts, token estimates, folder structure) and a snapshotId. If watch mode is active, also includes watchMode status. IMPORTANT: This summary does NOT include component details, props, dependencies, or style metadata. WHAT TO DO NEXT: list_bundles(snapshotId|projectPath) → read_bundle(snapshotId|projectPath, bundlePath). Use projectPath when watch mode is active (no snapshotId needed). STYLE METADATA: Set includeStyle=true to extract visual/design info (Tailwind/SCSS/animations/colors/spacing). Appears in bundle "style" field, NOT in summary. Use for design system analysis or when user asks about styling/colors/animations. DEPTH PARAMETER: Default depth=2 includes nested components (App → Hero → Button) with contracts and styles. Set depth=1 for direct dependencies only (App → Hero). PREFER BUNDLES OVER RAW CODE: These bundles are pre-parsed summaries optimized for AI - use them instead of reading raw .ts/.tsx files when possible. If you're unsure how LogicStamp works, call logicstamp_read_logicstamp_docs first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Analysis profile: llm-chat=balanced (default), llm-safe=conservative (max 30 nodes), ci-strict=contracts only, strict deps | llm-chat |
| mode | No | Code inclusion mode: none=contracts only (~79% token savings), header=contracts+JSDoc headers (~65% savings, recommended), full=complete source code (no savings) | header |
| includeStyle | No | Extract style metadata (Tailwind, SCSS, Material UI, animations, layout patterns). Equivalent to `stamp context style` or `stamp context --include-style`. Style data appears in component contracts when reading bundles, NOT in the summary. | |
| depth | No | Dependency traversal depth. Default: 2 (includes nested components, e.g., App → Hero → Button). Set to 1 for direct dependencies only (e.g., App → Hero). Depth=2 is recommended for React projects with component hierarchies. | |
| projectPath | Yes | CRITICAL: Absolute path to project root. REQUIRED - must always be provided. When stamp init has been run, MCP clients may omit this, causing hangs. This parameter is REQUIRED for the tool to work correctly. | |
| cleanCache | No | Manually force cleanup of .logicstamp cache folder. Default: false (auto-detects corruption/mismatch). Set to true to force cache reset. Use only when experiencing cache-related issues. | |
| skipIfWatchActive | No | Skip regeneration if watch mode is active (default: true). When true and watch mode is running, skips expensive regeneration and reads existing context files instantly. Set to false only if you need to force regeneration even when watch mode is active. |