# Context Mode: retrieve failures from large agent logs

> Discussion on WhatWorks · published 2026-11-07 · fresh until 2026-12-21 · https://whatworks.dev/t/context-mode-retrieve-large-agent-logs
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, Context Mode can index a large build log and return selected passages to Claude Code. Start a fresh trial with Node 24.15.0+ and `/ctx-doctor`

**Not for:** reducing hundreds of MCP tool definitions at startup; see [mcp-catalog-and-executor-instead-of-hundreds-of-tools](https://whatworks.dev/t/mcp-catalog-and-executor-instead-of-hundreds-of-tools.md).

Subjects: agent-workflows, claude-code, mcp

Install Context Mode in Claude Code, check it with `/ctx-doctor`, and retrieve one failure from an indexed log before relying on it for a long session.

Do first: check `node --version`; the [installation instructions](https://github.com/mksglu/context-mode/blob/main/README.md#install) require Node 24.15.0 or later, then:

```sh
claude plugin marketplace add mksglu/context-mode
claude plugin install context-mode@context-mode
```

Restart Claude Code and run `/ctx-doctor`. Follow any reported repair instruction before the trial. This route adds the plugin's hooks, MCP tools and skills. [Install and first-session instructions](https://github.com/mksglu/context-mode/blob/main/README.md#install).

1. Choose a saved, non-sensitive build or test log inside the project. Record its file size and one failure you can locate directly.
2. Ask the agent to index the log path with `ctx_index`, search for the failing test name with `ctx_search`, and return the source reference, failure message and relevant stack frame. The [tool reference](https://github.com/mksglu/context-mode/blob/main/docs/tools.md) shows `ctx_index` with `path` and `ctx_search` with `queries`.
3. Compare the retrieved passage with the original file. If the agent lacks the cause, search a distinctive error token and then the surrounding component name. A short reply alone is not success: the retained evidence must support the proposed diagnosis.
4. Run `/ctx-stats` and inspect its output-byte accounting. Record whether the useful failure details survived, alongside any reduction. The [publisher's examples and benchmark method](https://contextmode.ai/docs/engine/benchmarks) distinguish retrieval from other output-saving modes.

### Diagnostic: the agent sees too much log output and too little cause

Use retrieval when the answer is concentrated in a few passages. For totals or distributions across an entire log, ask for a script through `ctx_execute` that computes the result and prints a small answer; selected search hits cannot establish a whole-file count. [Execution and search mechanics](https://github.com/mksglu/context-mode/blob/main/docs/tools.md).

### Evidence

- Public failure report: **Lcstyle, November 7, 2026**, reports Context Mode 2.1.5 with Claude Code 2.1.319 on Linux. After compaction, a roughly 30 KB initial prompt caused later prompt hooks to exceed five seconds, despite a passing doctor report. The [issue](https://github.com/mksglu/context-mode/issues/1330) was closed as completed on November 8, 2026; as of November 2026, Context Mode 2.1.6 includes the [recall fix](https://github.com/mksglu/context-mode/releases/tag/v2.1.6). [Issue #1330](https://github.com/mksglu/context-mode/issues/1330).
- The publisher provides output-byte measurements and reproduction instructions; those figures do not establish lower account charges or better fixes. [Benchmark method](https://contextmode.ai/docs/engine/benchmarks).

### Limits

This recipe covers a new Context Mode setup in Claude Code; it does not cover migration from 1.x. Useful context can be omitted from a snippet, so compare critical passages with their source. A passing doctor report does not establish compaction reliability; keep a separate project checkpoint before a long session.

Not for: reducing hundreds of MCP tool definitions at startup; see mcp-catalog-and-executor-instead-of-hundreds-of-tools.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.