$ fssg build --deterministic --validate |

How to Investigate a Codebase with IOSM Ultrathink

IOSM

Deep analysis becomes dangerous when it can edit the system it is still trying to understand.

I want investigation and implementation to be different operating modes. Before an agent changes authentication, untangles a dependency cycle, or proposes a migration, it should be able to inspect the repository repeatedly without earning write authority by accident.

IOSM CLI's /ultrathink command makes that boundary explicit. It runs several root-agent passes with read-only tools, carries a compact checkpoint between them, forces early grounding in the workspace, and ends with a synthesis rather than a pile of disconnected observations.

This is not “think harder.” It is a bounded investigation protocol.

When to use it

Use /ultrathink when the expensive mistake is acting before the system is understood:

  • tracing an authentication or authorization path across modules;
  • finding the real owner of a cross-cutting invariant;
  • evaluating a migration before choosing an implementation shape;
  • separating a reported symptom from its likely causes;
  • reviewing architecture without allowing opportunistic edits.

Do not use it for a one-file change whose scope is already obvious. Do not use it as a substitute for tests. And do not treat its final synthesis as execution approval.

The command belongs before the decision artifact. If the investigation reveals three plausible implementation paths, continue with the IOSM execution-plan workflow. If it establishes a bounded improvement hypothesis, move into a full IOSM cycle. The IOSM CLI runtime remains the broader system; /ultrathink is one deliberately narrow mode inside it.

Start with a question that can be disproved

A weak query invites a generic architecture tour:

/ultrathink analyze the auth system

A better query names the uncertainty and the decision it must support:

/ultrathink -q 6 determine whether refresh-token rotation is enforced
at one boundary or duplicated across handlers; identify the owning files,
rejected explanations, and the smallest safe change surface

That objective gives the investigation a stopping condition. It can return “centralized,” “duplicated,” or “insufficient evidence.” All three are useful. “The architecture is complex” is not.

IOSM CLI accepts an explicit query, or it can reuse the latest meaningful user request from the session. I prefer the explicit form for architecture work because the exact question becomes part of the review context.

/ultrathink -q 5 <question>

The iteration count is configurable from one to twelve; the default is five. More passes do not automatically produce a better answer. Choose enough room for reconnaissance, criticism, verification, and synthesis, then stop. For a bounded subsystem, five or six passes are usually a clearer budget than “keep exploring until confident.”

What happens during the passes

The mode gives each pass a role:

Recon → Critique → ... → Verify → Synthesis

The first pass maps the repository and gathers concrete evidence. Middle passes challenge the current explanation. The penultimate pass verifies the surviving model. The final pass turns the result into a decision-ready analysis.

Between passes, IOSM CLI carries a compact checkpoint with five fields:

Goal
Verified Facts
Rejected Hypotheses
Open Questions
Next Checks

This checkpoint is the core artifact. A normal chat tends to accumulate prose. The checkpoint accumulates state.

That distinction matters. A file path that has been verified should survive compression. A hypothesis disproved by code should not return three turns later as if it were new. An open question should become a concrete next check, not another paragraph of uncertainty.

The implementation deliberately limits checkpoint size and preserves decision-critical paths, outputs, and constraints. The purpose is not to remember every sentence. It is to preserve what changes the next investigative action.

Read-only must mean read-only

/ultrathink filters the active toolset to inspection tools such as file reads, search, structured queries, semantic search, web fetches, and read-only Git operations. It does not grant the pass a shell for arbitrary mutation, patching, or implementation.

That gives the mode a useful invariant:

analysis may reduce uncertainty;
analysis may not change the subject being analyzed.

This is stronger than telling an agent “please do not edit.” The permission boundary is encoded in the runtime's available tools.

There is still a limitation: read-only tools can only expose what they can reach. Generated configuration, remote state, runtime-only behavior, missing fixtures, or an undocumented service dependency may remain invisible. The correct result in that case is an explicit open question, not a confident architectural claim.

Ground the investigation in tool evidence

Multi-pass reasoning can become multi-pass speculation. IOSM CLI counters that failure in two ways.

First, if the reconnaissance pass produces no tool evidence, the runtime injects a grounding retry and requires concrete workspace checks. The same rule applies to critique while the run still has no evidence. A model cannot complete the early investigation only from prior knowledge.

Second, tool results receive evidence identifiers. Quantitative claims in the analysis must refer to known evidence IDs. Unknown references, unsupported numbers, or missing evidence markers trigger a compliance-repair pass.

The practical consequence is simple: do not ask the synthesis to sound certain. Ask it to show which observation supports which conclusion.

For the refresh-token example, useful evidence might be:

- route registration points to two handlers;
- both handlers call the same token service;
- only the service writes the rotation record;
- one legacy test bypasses the route layer;
- no second persistence path was found.

From that evidence, the synthesis may conclude that enforcement is centralized in the service while test entry points create the appearance of duplication. It should not claim that every production caller is safe unless the investigation actually enumerated them.

This is the same principle behind binding IOSM decisions to evidence: a conclusion becomes reviewable when another engineer can follow it back to the inspected artifact.

Use rejected hypotheses as a first-class result

Most architecture reviews record what the reviewer believes. Fewer record what was considered and disproved.

The Rejected Hypotheses checkpoint section prevents circular investigation. Suppose the first pass suspects that refresh rotation is duplicated because two handlers expose similar names. A later search finds that both delegate to one service. The duplication hypothesis should be recorded as rejected, with the relevant paths.

That changes the next pass. Instead of rediscovering the same naming coincidence, it can investigate the real remaining risk: whether any caller bypasses the service.

Rejected hypotheses also make the final report less theatrical. A clean answer often comes from eliminating plausible explanations, not from discovering one dramatic root cause.

A practical investigation recipe

I use this sequence:

1. State one decision the investigation must support.
2. Name the subsystem and suspected boundary.
3. Run /ultrathink with a fixed pass budget.
4. Check that Recon used repository tools.
5. Inspect rejected hypotheses, not only verified facts.
6. Require unresolved questions to name the missing evidence.
7. Treat the final synthesis as an input to planning, not permission to edit.

A useful final synthesis should answer five questions:

  1. What is verified?
  2. Which explanations were rejected?
  3. What remains unknown?
  4. What is the smallest justified change surface?
  5. Which next artifact should authorize execution?

That next artifact might be a /singular analysis, an IOSM hypothesis card, a contract amendment, or a decision to collect runtime evidence first. Investigation has succeeded when it narrows the next responsible action.

Where the mode stops

/ultrathink does not prove runtime behavior from static files. It does not replace a benchmark, integration test, trace, or production observation. It also does not guarantee that the model noticed every relevant path.

Its contract is narrower:

  • no implementation while the system model is unstable;
  • repeated analysis with explicit phases;
  • compact state carried between passes;
  • early tool grounding;
  • evidence-aware quantitative claims;
  • visible unknowns and rejected explanations.

That is enough to improve a common failure mode. Agents often move from a plausible reading to a patch before the architecture has been falsified. IOSM makes room for a different sequence:

inspect → challenge → verify → synthesize → authorize → execute

I do not want deeper reasoning to mean a longer hidden monologue. I want it to produce a smaller, inspectable model of the system—and to stop before that model grants itself permission to change reality.

Sources

FACET AI CLI Terminal
facet@ai:~$