Skip to main content

Context Loom In The CLI

Context Loom is the user-visible context layer in the CLI. It gives a local, source-cited view of what ProtoAgent thinks is relevant before or during a run.

CLI Commands

CommandPurpose
/contextShow index status for the active project.
/context QUERYBuild a Context Pack preview without calling a model.
/index refreshRefresh or rebuild the local SQLite index.
`/context window [16kauto]`
/context historyInspect model-facing ProtoLink conversation history.
`/context compact [recenttokens
/context resetClear saved histories for the active project session.
/context onUse persistent project memory.
/context offUse task-local memory.

Shell equivalents:

proto-cli context
proto-cli context "runtime streaming task handling"
proto-cli index refresh
proto-cli context history
proto-cli context compact tokens 4000

Automatic Injection

Plain task prompts automatically get Context Loom evidence before the model is called. /context QUERY is a preview/debug command, not the only way Context Loom runs.

Task flow:

What The Status Panel Shows

The status output comes from context_status_rows() and includes:

FieldMeaning
NameAlways Context Loom.
WorkspaceActive project path.
IndexSQLite index path.
FilesNumber of indexed files.
Indexed atLast index timestamp.
DurationLast index refresh duration.
UpdatedFiles upserted during refresh.
RemovedStale files removed.
SkippedFiles ignored or too large.

What A Pack Preview Shows

The Context Pack panel includes:

FieldMeaning
QueryThe request used to score files.
WorkspaceActive project.
ItemsNumber of selected evidence items.
TermsNormalized query terms used by the scorer.
IndexIndexed file count and duration.
GitNumber of changed paths from git status --short.

Each selected item can show path, language, score, reason, evidence, symbols, headings, line range, and a bounded line-numbered snippet.

Memory Controls Are Nearby On Purpose

The /context namespace covers both context evidence and model-facing memory because the user experiences them together:

  1. Context Loom decides what repository facts enter the current prompt.
  2. ProtoLink state decides whether the agents remember previous project turns.
  3. Runtime context metrics show how much of the model window the run consumed.

This is why /context history, /context compact, /context reset, and /context window live next to /context QUERY.

Common Debug Flow

Use this when a model seems to miss the relevant files:

/project
/index refresh
/context the exact thing I am asking about
/trace

If /context QUERY produces the right files but the final answer is wrong, the problem is likely in agent reasoning or tool use. If the pack misses the files, inspect Context Loom scoring in core/protoagent_core/context/packer.py.