Skip to content
Documentation

Guided workflows

Investigate a function

Move from a question to source without loading the entire repository.

AvailableReviewed September 2026

Before you start

Use a connected host, a permitted checkout and one observable behavior to investigate. For example: a checkout total changes after a discount is applied. The goal is a source-backed explanation and a focused verification plan, not a repository-wide summary.

Locate the behavior

Use ctx_compose with the task, or ctx_search when you know a string or symbol. Start with a narrow question such as “where is the discounted total calculated?” Keep the file path and source location for relevant matches.

A match is a candidate. Follow the relationship to the calling code before deciding it explains the observed behavior. If a project index is involved, check that it represents the current checkout.

Read the interface, then the implementation

Request signatures or map for a useful first view. Choose the relevant function and recover its implementation with a line range from your result:

{"name":"ctx_read","arguments":{"path":"src/checkout.ts","mode":"signatures"}}

The path illustrates a project file; replace it with one returned by your search. Do not copy example line numbers into a real investigation. Use fresh: true when the source may have changed.

Check the surrounding contract

Inspect the caller, inputs and relevant tests. A function may be correct in isolation while its caller supplies the wrong currency, rounding mode or discount order.

Before editing, recover exact text or current edit anchors. LeanCTX provides context; the host performs the change and executes the appropriate tests.

Recover deliberately

If the view omits a condition, expand that region. Repeated compressed reads are not evidence that the omitted detail does not exist. Keep track of recovery reads when evaluating context savings.

Check the result

Your explanation should name the responsible code, the current source evidence and the check that confirms it. Distinguish an interface you observed from behavior you executed.

Continue with read modes for representation semantics or the search schema for exact inputs.

Sources & versions6 references Reviewed
  • mode.rsrust/src/tools/ctx_read/mode.rsReviewed checkout
  • file_io.rsrust/src/tools/ctx_read/file_io.rsGitHub
  • ctx_read.rsrust/src/tools/registered/ctx_read.rsReviewed checkout
  • helpers.rsrust/src/tools/ctx_read/helpers.rsReviewed checkout
  • context_gate.rsrust/src/server/context_gate.rsReviewed checkout
  • quality-loop-v1.mddocs/contracts/quality-loop-v1.mdReviewed checkout
Core checkout
0ce2207ee4
Reviewed runtime
3.10.2
SDK release
1.1.0

Separate baselines for source, CLI/configuration and SDK contracts. Review does not certify every platform or integration.

Versions & compatibility