Architecture Context Engine for AI-First Engineering
Project description
๐ธ๏ธ Loom-Context
Deterministic, axiomatic context for AI-first engineering.
. * . * .
\ | /
โโ (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:
- โ
Respects
.gitignore - โ
Respects
.contextignore - โ
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
- CONTRIBUTING.md โ setup, conventions, PR process
- CHANGELOG.md โ release history
- SECURITY.md โ vulnerability reporting
- CONTRIBUTORS.md โ maintainer and contributor credit
- TRADEMARKS.md โ project name and branding guidance
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69be2f1a54c25e5588923bab6067ecb532605b94d8d93bcc19002fa670a78ae5
|
|
| MD5 |
827348959c9f8e1d20af9195b5cfb198
|
|
| BLAKE2b-256 |
b817cf6eea9b17d198b04a96f1f005520cf9d7daed16555f6aa3621a5423204e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loom_context-0.4.0.tar.gz -
Subject digest:
69be2f1a54c25e5588923bab6067ecb532605b94d8d93bcc19002fa670a78ae5 - Sigstore transparency entry: 1138698018
- Sigstore integration time:
-
Permalink:
Basal-Research-Group/Loom-Context@3518f9b5a82af6aa7596230757be070796f1ff19 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Basal-Research-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@3518f9b5a82af6aa7596230757be070796f1ff19 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
700d9ca5b4d1e833bebc5f116d364bc92a49aafa4ce14f343d6d39df4ab68df8
|
|
| MD5 |
a480de445fd9ccc0464a56995e51ff57
|
|
| BLAKE2b-256 |
3f7718934e0406071206c8ffd73fcb185f2c644eac36a6acdedf0a7622f780cc
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loom_context-0.4.0-py3-none-any.whl -
Subject digest:
700d9ca5b4d1e833bebc5f116d364bc92a49aafa4ce14f343d6d39df4ab68df8 - Sigstore transparency entry: 1138698383
- Sigstore integration time:
-
Permalink:
Basal-Research-Group/Loom-Context@3518f9b5a82af6aa7596230757be070796f1ff19 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Basal-Research-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@3518f9b5a82af6aa7596230757be070796f1ff19 -
Trigger Event:
release
-
Statement type: