Skip to main content

Architecture Context Engine for AI-First Engineering

Project description

๐Ÿ•ธ๏ธ Loom-Context

CI PyPI Python License

Deterministic, axiomatic context for AI-first engineering.

English ยท Espaรฑol

        .  *  .  *  .
         \  |  /
      โ”€โ”€ (O O) โ”€โ”€
         /  |  \
        *  .  *  .  *

  less tokens, more signal

Loom's core is deterministic โ€” no AI required. It prevents wasting AI.

It scans your repo, infers architecture and conventions, and compiles compact context that any agent (Claude, Codex, Cursor) can consume โ€” so they stop re-reading 700 files and start working with the right 7.

AI can optionally enhance selection (future), but the foundation is always deterministic and reproducible.

Without Loom:  35KB prompt  โ†’  agent reads everything  โ†’  drift, waste, hallucinations
With Loom:     2.6KB bundle โ†’  agent reads what matters โ†’  precision, consistency, savings

No cloud. No LLM. No heavy deps. Deterministic analysis in <2 seconds. 93% fewer tokens.

pip install loom-context
cd your-project/
loom init .

๐Ÿ“‰ Bundles 93% smaller than full prompt. Scan in <2 seconds.


โšก Quick Start

loom init .                                  # scan + generate .context/ + .loom/
loom bundle "refactor auth" . --stdout       # task-specific context (93% smaller)
loom export . --agent claude                 # export for your AI agent

That's it. Your agent now has architecture, rules, naming, and boundaries โ€” without reading 700 files.


๐ŸŽฏ 15 Commands

๐Ÿ” Scan & Generate

loom init .                    # Full scan + .context/ + .loom/ + audit
loom scan .                    # Re-scan and update .context/

๐Ÿ“ Context for AI

loom prompt . --stdout         # Full master prompt (all context)
loom focus "auth" . --stdout   # Filtered prompt by topic
loom bundle "task" . --stdout  # Task-specific bundle with manifest
loom handoff "task" . --save   # Session continuity summary
loom export . --agent claude   # Format for specific agent

โœ… Quality & Audit

loom audit .                   # Validate naming + boundary rules
loom enrich .                  # Re-audit + refresh + persist findings
loom doctor .                  # Health check (11 diagnostics)

๐Ÿ“Š State & Memory

loom status .                  # Project health dashboard
loom decide "..." -r "..." -s architecture  # Record decision
loom log "note" -p .           # Session memory
loom plan .                    # Summarize docs/plans
loom watch . --interval 60     # Continuous re-scan

๐Ÿ“ What Loom Generates

.context/                      โ† canonical, reproducible, shareable
  index.json                   โ† entry point + quick_rules
  architecture.md              โ† patterns + layer boundaries
  naming.md                    โ† conventions + suffix/prefix patterns
  directory-map.md             โ† annotated directory tree
  stack.json                   โ† categorized dependencies
  rules.json                   โ† machine-readable rules for audit
  plans-summary.md             โ† docs and plan progress
  exports/                     โ† agent-specific formats
  bundles/                     โ† task-specific context + manifests

.loom/                         โ† live state, local per user
  inconsistencies.json         โ† last audit findings
  decisions.jsonl              โ† architectural decision records
  sessions.jsonl               โ† session log with git metadata
  mutations.jsonl              โ† context change history

๐Ÿค– Export for Your Agent

loom export . --agent claude   # โ†’ .context/exports/CLAUDE.md
loom export . --agent cursor   # โ†’ .context/exports/.cursorrules
loom export . --agent codex    # โ†’ .context/exports/AGENTS.md
loom export . --agent generic  # โ†’ .context/exports/.loom-export.md

๐Ÿ” What It Detects

Area Detection
๐Ÿ—๏ธ Architecture Clean Architecture, Hexagonal, MVC, MVVM, Pipeline, Feature-based, Layered
๐Ÿ“ฆ Project Type React Native/Expo, Next.js, Angular, Vue, Python, Rust, Go, Java, and more
๐Ÿท๏ธ Naming PascalCase, camelCase, kebab-case, snake_case, I-prefix, use-prefix, suffixes
๐Ÿ“ฆ Stack 130+ known packages categorized (ui, state, db, testing, DI, etc.)
๐Ÿ“„ Docs Markdown with frontmatter, plan status, section headings
โš™๏ธ Rules Layer boundaries, naming conventions, import aliases

๐Ÿ”’ Security

Three layers of filtering โ€” your source code never appears in output:

  1. โœ… Respects .gitignore
  2. โœ… Respects .contextignore
  3. โœ… Always excludes .env, *.pem, *.key, credentials

Output is metadata only: file names, patterns, rules, structure. Never source code.


๐Ÿ” Daily Workflow

# Morning: check state
loom status .
loom scan .

# Before a task: get focused context
loom bundle "implement payment flow" . --stdout | pbcopy

# During work: record decisions
loom decide "use Stripe adapter" -r "team standard" -s architecture

# End of day: persist and handoff
loom enrich .
loom handoff "payment flow" . --save

๐Ÿ“Š Real-World Results

Tested on a 674-file React Native project:

Metric Result
Scan time 0.9s
Files analyzed 674 files, 95 dependencies, 59 docs
Architecture detected Clean Architecture + Hexagonal + Feature-based
Naming patterns 67 Repositories, 28 Mappers, 17 Services, 14 ViewModels
Boundary violations 107 (all in core/ importing from infrastructure/)
Bundle vs prompt 2.6KB vs 35KB (93% reduction)
Export formats Claude, Cursor, Codex, Generic

๐Ÿ“š Documentation

Guide What it covers
๐Ÿš€ Quick Start Install, first scan, daily workflow
๐Ÿ“– CLI Reference All 15 commands with examples
๐Ÿ“ Context Output .context/ and .loom/ structure
๐Ÿ”’ Security 3-layer filtering model
๐Ÿ“ Best Practices Individual, team, and AI patterns
๐Ÿง  Philosophy The brain analogy + scientific references
๐Ÿ•ธ๏ธ Loomy The spider-neuron mascot
๐Ÿ“‹ Roadmap Version plan with delivery docs

๐Ÿ› ๏ธ Development

git clone https://github.com/jadruiz/Loom-Context.git
cd Loom-Context
pip install -e ".[dev]"

pytest                         # 281 tests, ~8s
ruff check src/ tests/         # lint
ruff format --check src/ tests/  # format

Requirements

  • Python 3.9+
  • 4 runtime deps: click, rich, pathspec, jinja2
  • Zero AI/ML dependencies in base install

License

Apache License 2.0.

Loom-Context is free to use, modify, and distribute for personal and commercial purposes under the terms of the license. Attribution and notice requirements are preserved through LICENSE and NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loom_context-0.4.0.tar.gz (200.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loom_context-0.4.0-py3-none-any.whl (115.3 kB view details)

Uploaded Python 3

File details

Details for the file loom_context-0.4.0.tar.gz.

File metadata

  • Download URL: loom_context-0.4.0.tar.gz
  • Upload date:
  • Size: 200.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loom_context-0.4.0.tar.gz
Algorithm Hash digest
SHA256 69be2f1a54c25e5588923bab6067ecb532605b94d8d93bcc19002fa670a78ae5
MD5 827348959c9f8e1d20af9195b5cfb198
BLAKE2b-256 b817cf6eea9b17d198b04a96f1f005520cf9d7daed16555f6aa3621a5423204e

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_context-0.4.0.tar.gz:

Publisher: pypi-publish.yml on Basal-Research-Group/Loom-Context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loom_context-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: loom_context-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loom_context-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 700d9ca5b4d1e833bebc5f116d364bc92a49aafa4ce14f343d6d39df4ab68df8
MD5 a480de445fd9ccc0464a56995e51ff57
BLAKE2b-256 3f7718934e0406071206c8ffd73fcb185f2c644eac36a6acdedf0a7622f780cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_context-0.4.0-py3-none-any.whl:

Publisher: pypi-publish.yml on Basal-Research-Group/Loom-Context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page