LLM Context Format

LogicStamp Context – LLM Guide

Understand the structure of the folder-organized context files (multiple context.json files plus context_main.json index) that LogicStamp Context generates for LLM consumption and how to interpret them.

Multi-file structure
AI-optimized
Schema compliant

Overview

⚑

AI-Friendly Bundles

Generates context bundles from React/TypeScript projects without build steps

🌐

Global CLI

Install with npm install -g logicstamp-context, then use stamp context command

πŸ€–

LLM Optimized

Optimized for assistants such as Claude or ChatGPT to improve code understanding

πŸ“¦

Node.js 18+

Requires Node.js β‰₯ 18 with access to your project's source tree

πŸ’‘ Note: "Global CLI" means the tool is installed globally on your system (via npm install -g), making the stamp command available from any directory in your terminal, not just within a specific project folder.

Output Structure

LogicStamp Context generates folder-organized, multi-file output:

Multiple context.json files

One per folder containing components. Each file contains an array of LogicStamp bundles (one bundle per entry point/root component).

context_main.json index

Main index file with folder metadata, summary statistics, and references to all folder context files.

✨ Design note: LogicStamp Context uses per-root bundles (one bundle per entry point) rather than per-component files. This means each bundle contains the root component plus its complete dependency graphβ€”all related components and their relationships in one self-contained unit. This design is optimized for AI consumption: when you need help with a specific page or feature, share that root bundle and the AI has complete context.

What Each context.json Contains

Each folder's context.json is an array of LogicStamp bundles. Each bundle represents one entry point plus its graph.

Top-level fields

positiontypeschemaVersionentryIddepthcreatedAtbundleHashgraphmeta

graph.nodes

Contains UIF contracts describing functions, props, events, imports, and semantic/file hashes. Optional codeHeader blocks store contract headers or snippets when requested.

graph.edges

Lists dependency relationships between nodes (often empty when depth is 1).

The context_main.json Index

The context_main.json file provides a complete directory index with:

summary

Overall statistics (total components, bundles, folders, token estimates)

folders

Array of folder entries, each with:

  • β€’ path – relative path from project root
  • β€’ contextFile – path to this folder's context.json
  • β€’ bundles – number of bundles in this folder
  • β€’ components – list of component file names
  • β€’ isRoot – whether this is an application entry point
  • β€’ tokenEstimate – token count for this folder's context

Use the index to discover which folders have context files and navigate to specific folder contexts.

The meta Section

The meta object provides metadata about bundle generation and dependency resolution:

missing

Array of unresolved dependencies, each with name, reason, and referencedBy. An empty array means complete resolution.

source

Generator version string, for example "logicstamp-context@0.1.0"

⚠️ Important: When meta.missing is non-empty, treat analysis as partial and surface that to users.

Best Practices for LLM Consumers

Start with context_main.json to understand the project structure and locate relevant folder contexts.

Load specific folder context.json files based on the area of code you're working with.

Check meta.missing before assuming complete component coverage.

Suggest increasing --depth if many "max depth exceeded" entries appear.

Flag "file not found" entries as potential bugs in the codebase.

Filter bundles by entryId to focus on relevant modules.

Use version.functions and logicSignature to reason about APIs without loading full source.

For deeper context, rerun the CLI with --include-code full or higher --depth before querying the assistant.