Skip to main content
Glama
Context Loom

Context Loom

by ownasquare

Context Loom

Context Loom turns a chat request and a local project into a smaller, cited prompt you can review before sending. It preserves your exact message, stays local by default, and separates projected token savings from usage actually reported by a model provider.

How it works

  1. Connect a project. Context Loom indexes eligible text files inside one folder you choose.

  2. Prepare a message. Write the request exactly as you want the destination model to receive it.

  3. Review and copy. Inspect the selected sources, fidelity checks, and complete rendered payload.

  4. Track the conversation. Reuse a conversation name to see projected and observed token history.

Context Loom never sends the copied payload to a model unless you deliberately use an integration that performs an outbound request.

Context Loom workbench

Related MCP server: reflens

Install from source

The primary install is Node-free and uses the workbench already bundled in the Python package. Python 3.11-3.13 and uv are required.

Clone the public source repository and install its bundled workbench:

git clone https://github.com/ownasquare/context-loom.git
cd context-loom
uv tool install .
context-loom demo
context-loom serve

Open http://127.0.0.1:8768. Context Loom is not currently distributed through PyPI; the source install above is the canonical install path.

If you already have a checkout, start at uv tool install .. Run uv tool update-shell and open a new terminal if context-loom is not found after installation.

Try the demo

context-loom demo creates a private generated project, indexes it, and prepares one sample message. Start context-loom serve, then use Home, Prepare, Project files, and Savings to inspect the complete flow. The demo does not call a provider or require credentials.

Use your own project

Start the workbench and choose Add project, then enter a local folder that the Context Loom process can read. It scans immediately, and the project switcher can add, select, and rescan multiple projects.

For a scripted setup:

context-loom workspace add /absolute/path/to/project --name "My project" --id my-project
context-loom workspace sync my-project
context-loom serve

The demo uses demo-workspace; the example above uses my-project, so the two flows do not collide. See Getting started for the first-success walkthrough and Docker setup.

Connect a chat tool

Copy and paste is the recommended first integration. Context Loom also offers an MCP server and a loopback-only HTTP API; provider-shaped output formats are available for advanced use.

context-loom adapter preview codex

adapter preview prints a standalone snippet for review. It does not edit harness configuration; after you add the snippet, the harness starts context-loom mcp serve --transport stdio when needed. See Harness integrations and Extending Context Loom.

Docker

Docker keeps state in a named volume and mounts one chosen project read-only at /workspace:

export CONTEXT_LOOM_PROJECT=/absolute/path/to/project
docker compose up --build --detach
docker compose exec context-loom context-loom workspace add /workspace --name "My project" --id my-project
docker compose exec context-loom context-loom workspace sync my-project

Then open http://127.0.0.1:8768. Without CONTEXT_LOOM_PROJECT, Compose mounts the bundled sample project. Host paths are not visible inside the container unless they are mounted.

What Context Loom guarantees

  • The exact user message is retained in the canonical envelope and checked at renderer boundaries.

  • Selected text remains tied to a current source version, hash, path, and line range.

  • Unsafe summarization falls back to extractive or passthrough behavior.

  • Telemetry, outbound access, secret-file indexing, and raw-message persistence are off by default.

  • Projected, provider-observed, and verified counterfactual token figures remain distinct.

No system can guarantee the same model answer while withholding arbitrary source bytes. Read the fidelity contract, token-accounting contract, and limitations before making quality or savings claims.

Learn and contribute

Package users do not need Node. Contributors need Node 22 only when changing or validating the React workbench. Context Loom is currently a local single-user beta; hosted, production, paid-provider, and real-harness proof remain separate from credential-free local validation.

License

MIT

Available Tools

7 tools
explain_selectionC

Explain selected and omitted resources with score components and fidelity gates.

Inputs: hydration_id (required). Returns: object

get_contextC

Read the canonical envelope for a hydration identifier.

Inputs: hydration_id (required). Returns: intent, adapter, fidelity, metadata, +12 more

hydrate_messageD

Compile a source-preserving prompt envelope for one exact user message.

Inputs: message (required), workspace_id (required), mode, adapter, +5 more. Returns: intent, adapter, fidelity, metadata, +12 more

record_usageB

Idempotently record provider-observed usage and return updated thread totals.

Inputs: model (required), provider (required), thread_id (required), idempotency_key (required), +6 more. Returns: turns, thread_id, actual_input_tokens, cached_input_tokens, +8 more

resolve_resource_versionC

Resolve immutable sanitized content from an omission recovery reference.

Inputs: version_id (required), resource_id (required). Returns: kind, sha256, content, current, +6 more

thread_statsB

Read confidence-separated lifetime token metrics for one thread.

Inputs: thread_id (required). Returns: turns, thread_id, actual_input_tokens, cached_input_tokens, +8 more

workspace_statusC

Read active generation, freshness, and synchronization status.

Inputs: workspace_id (required). Returns: last_sync, workspace, indexed_chunks, stale_resources, +3 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool targets a fairly distinct operation within the hydration pipeline: hydrate_message compiles an envelope, get_context reads one by id, explain_selection explains choices, record_usage writes metrics, thread_stats/workspace_status read state, and resolve_resource_version recovers omitted content. Minor overlap exists between hydrate_message and get_context (both concern envelopes) and between record_usage and thread_stats (both concern token metrics), but descriptions keep them separable.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern (hydrate_message, record_usage, get_context, explain_selection, resolve_resource_version), but thread_stats and workspace_status drop the verb and use noun_noun, breaking the otherwise consistent convention. Still readable and largely predictable.

    Tool Count5/5

    Seven tools is well-scoped for a context-hydration and usage-tracking server, with each tool covering a distinct part of the pipeline (hydrate, read, explain, record, stats, status, resolve). No redundant or filler tools.

    Completeness4/5

    The surface covers the core lifecycle: hydrate, read, explain, record usage, inspect stats/status, and recover omitted resources. Gaps exist for thread deletion/forgetting, listing threads, or bulk config, but agents can work around these for the primary workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that indexes reference repositories and provides tools for AI coding agents to retrieve lossless code context, enabling reasoning over codebases larger than the agent's context window.
      8
      2
      Apache 2.0