By noopz
Generate entropy-guided structural outlines for large code files directly in Claude Code sessions, reducing context consumption on first reads and enabling efficient initial analysis. Hooks automate outline creation before edits/reads, with file writes and session triggers.
Structural editing plugin for Claude Code. Intercepts Read and Edit tool calls via hooks to reduce context consumption through entropy-guided structural outlines, content-addressable line references, and cross-file dependency detection.
Instead of dumping full file contents into context, Strata serves a compressed structural outline — a map of the file where every node is tagged with a content-addressable coordinate. A 1,274-line file becomes ~30 lines of outline.
views.py [1274 lines]
connections: → models.py, ← schemas.py, ↔ listing_service.py
---
[1-15] 1#SZN:from django.views import View
[16-89] 16#KKV:class ListingListView(View):
[90-156] 90#TXR:class ListingDetailView(View):
[157-290] 8 similar regions
sample: 157#WBR:class SnapshotView(View):
Outlines are built by recursively subdividing the file at structural boundaries, analogous to Binary Space Partitioning. Four boundary signals are tried in priority order:
No parser, no AST, no language grammar. Works on TypeScript, Python, C++, XML, HTML, CSS, SQL, YAML — anything with text.
Consecutive sibling nodes are compared via Jaccard similarity on character trigrams. Runs of 3+ similar siblings collapse into a single representative node. 26,000 lines of C++ with 60 repetitive class definitions become 3 nodes and 167 characters — 99.98% compression.
Instead of reproducing existing code to identify what to replace, the agent references lines by coordinate — 42#VRK: is 7 characters instead of ~70 characters of reproduced code. The hook resolves coordinates to file content transparently, verifies hashes against the current file, searches ±3 lines for shifted content, and applies edits bottom-up to avoid index drift.
A session-scoped TF-IDF index tracks tokens extracted from structural nodes. Definition sites (node headers) vs. usage sites (node bodies) determine connection direction. Outline headers show directional dependencies between files without a language server, import parser, or build system.
Requires Node.js 22+ and Claude Code.
git clone https://github.com/noopz/strata.git
cd strata
npm install
npm run build
Copy the example settings and update paths to point to your clone:
cat hooks/claude-code-settings.example.json
Add the hooks and MCP server entries to your project's .claude/settings.local.json, replacing /absolute/path/to/strata with the actual path to your clone.
The hooks register on:
The MCP server provides structural_edit, structural_expand, and structural_analyze tools.
npm run build # TypeScript → dist/
npm test # Unit tests
node scripts/smoke-test-hooks.cjs # End-to-end hook pipeline test
MIT
Modifies files
Hook triggers on file write and edit operations
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub noopz/stray-bits-sanctuary --plugin strataLLM-maintained knowledge base for Obsidian vaults. Auto-triggers on paper sharing, vault health queries, concept compilation, research questions, and domain management.
Shape your Obsidian vault - create notes, search tags, analyze links, and manage frontmatter
Permanent coding companion for Claude Code — survives any update. MCP-based terminal pet with ASCII art, stats, reactions, and personality.
Intelligent prompt optimization: injects the right context at the right moment so Claude lands a better first output. Clarifies vague prompts with research-based questions, plus targeted nudges for approach selection, plan readability, workflow routing, background execution, subagent routing, output readability, user-decision questions, and plan-mode assessment