> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monolex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Monogram Overview

> Code intelligence for AI agents and humans — ranked discovery, call graphs, contract audits, and a 50-tool MCP surface across 24 languages.

Monogram is Monolex's code-intelligence engine. It turns a source tree into ranked locations, exact symbols, call and dependency graphs, cross-boundary coupling evidence, and deep semantic worklists. The goal is not to guess from a function name; it is to move from a symptom to bounded source evidence and then prove the owning path.

*Published contract: `monogram 0.98.11`, OpenCLIs build
`2026-07-20-154556`.* Run `monogram --version` to identify the binary you are
using. In an agent/non-TTY process, bare `monogram` prints the compact entry
brief; use `monogram docs initiate` or `monogram help --full` for the complete
embedded reference.

## Quick start

```bash theme={null}
# Build or incrementally refresh the current project's index
monogram index .

# Turn a public requirement into edge bands before searching code
monogram spec-audit instruction.md --against .

# Bind the ordered task contract, then close it after the final edit and test
monogram sequence start "task" --from instruction.md
monogram sequence finish current

# Locate the implementation, then prove its role
monogram search "session reconnect"
monogram region "session reconnect lifecycle" -n 5
monogram investigate reconnect_session

# Audit bindings that cross language, process, or protocol boundaries
monogram coupling --summary

# Add the semantic companion for deep graph and possibility-band commands
monogram index . --deep
monogram semantic status
```

Every investigation result includes executable `[NEXT]` guidance. A normal path is:

```text theme={null}
requirement -> spec-audit/sequence -> search/region -> context/investigate
            -> chain/coupling -> source proof -> change -> rerun the same proof
```

## Agent entry and embedded docs

The `0.98.11` release retains the survivable agent entry introduced in 0.97.0
and keeps the full command manual available on demand:

```bash theme={null}
monogram                 # compact brief when stdout is not a TTY
monogram help --full     # complete flag-by-flag reference
monogram docs            # embedded topic inventory
monogram docs initiate   # complete command reference
monogram docs skill      # agent workflow and capability map
```

The topic list also includes `audit-guide`, `flow-guide`,
`ownership-ffi-guide`, and `sequence`. Human-readable `stats`, `search`, and
`region` output routes through a mutation-aware three-state sequence entry gate:

* A new recognized task file emits a runnable
  `sequence start task --from <path>` hint. Recognized cwd files are `TASK.md`,
  `PLAN.md`, `BUG.md`,
  `.task.md`, and `.monobench-task-instruction.md`; the historical `/tmp`
  Monobench instruction path remains supported.
* An open current session initially emits one `ORDER OPEN (<id>)` line naming
  its `connection-points.md` path and the required final `sequence finish`
  verb, so a compacted agent can re-enter the binding order. Once a checked
  file in the saved scope has an mtime newer than the UTC session start, the
  line escalates to `edits detected in its scope` and the final-close form.
* A finished session stays silent for the same task digest, while a different
  task file triggers the entry hint again. A virgin root with no recognized
  file retains the generic
  `sequence start ... --from <task-or-bug.md>` placeholder.

`sequence start --from` stores the task's `source_path` and FNV-1a 64-bit
identity `source_digest` in `meta.json`. The digest gates duplicate guidance;
it is not a cryptographic integrity claim.

This release does not add an MCP tool: `monogram mcp-schema` still reports
exactly 50 investigation commands. Successful `stats --json`, `search --json`,
and `region --json` payloads now include `sequence_hint`: it is the same
state-aware edge as a string, or `null` when no edge applies. The MCP server
forces those commands through JSON, so MCP clients receive the same field
without a second state machine or schema command. The existing `sequence` tool
retains its binding `[IAW-SOP] ORDER` chain and closing verb `sequence finish`.
`start` and `define` expose that ordered contract in human and JSON output;
`status` and `resume` re-emit the current phase after context loss. Run
`finish` after the last Edit/Write: it re-presents the saved task contract and
available Book knowledge, writes `finish.json`, changes the session phase to
`finished`, and tells the agent to make no later source mutation.

In 0.98.11, the installed external `initiate.md` and current release source are
identical, with SHA-256
`dbb1812866a6291ebc576106ec72a948fb7cdd24f2bd8a1156c9c6d0daa0c963`.
The installed SKILL also matches source at
`228133b0d369cecbc19150f3b6b20dad76364b6930214c196b7550bff536f627`.
The complete hook lifecycle is shipped in this release:

```bash theme={null}
monogram hook install                 # idempotently add the Claude PostToolUse entry
monogram hook status                  # inspect the selected settings file
monogram hook remove                  # remove only Monogram's entry
monogram hook install --settings path/to/settings.json
```

The hook preserves unrelated settings and hooks. Its carrier remains a
fail-quiet, one-file core-index refresh; it does not build deep semantics,
create a database, migrate a schema, or replace an ordinary index refresh.

The release also carries forward the Windows-safe ASCII release gate, the
synchronized NIIA standalone lock, and the `lib-monosession` optional SQLite
boundary required by the all-CLI release gate. `version --json` is not a
supported form; use `monogram --version` or `monogram version` for the
executing identity.

<Warning>
  The 0.98.11 CDN metadata has a provenance split. `latest.json` and the Linux
  and Windows platform rows name clean source commit
  `04f5162b8bb1518c8814b50de90990ad4030e3ca`; the macOS archive row names clean
  commit `96d20c623b95e8aa9938b96d2a608557aac09e8d`. Artifact hashes below are
  verified, but the five rows must not be described as one-source provenance
  until the release metadata or archive is republished consistently.
</Warning>

For isolated CI, benchmark, or disposable-worktree runs, set
`MONOGRAM_HOME=<dir>`. Core and semantic databases then live under
`<dir>/monogram/`, while sequence sessions and their `finish.json` witnesses
live under `<dir>/problem-definitions/`. Without the override, sequence state
remains repo-local under `.monogram/problem-definitions/`. Version 0.98.2
closed the earlier leak where sequence artifacts could enter a benchmark Git
patch even though the index databases were already isolated; 0.98.11 retains
that isolation and the 0.98.3 per-task provenance inside the isolated session.

## What Monogram owns

| Plane              | Question                                                                          | Main commands                                                                                         | Detail                                                                          |
| ------------------ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Contract preflight | What public behaviors and edge bands must the implementation close?               | `spec-audit`, `sequence`, `format-trace`                                                              | [Reference](/ai-clis/monogram/reference#contract-preflight)                     |
| Locate             | Where is the implementation?                                                      | `search`, `region`, `symbols`, `grep`, `refgrep`                                                      | [Reference](/ai-clis/monogram/reference#locate)                                 |
| Navigate           | What calls it, what does it call, and where does its value originate?             | `context`, `trace`, `investigate`, `chain`, `tree`, `deps`, `rdeps`, `provenance`                     | [Reference](/ai-clis/monogram/reference#navigate-and-prove)                     |
| Boundary audit     | Are HTTP, SQL, event, IPC, FFI, CSS-token, and export/import contracts connected? | `coupling`, `bridges`, `css`, `important`                                                             | [Audit & Correctness](/ai-clis/monogram/audit#boundary-and-structural-audits)   |
| Semantic audit     | What does the resolved deep graph observe?                                        | `semantic`, `inspect`, `effect`, `hubs`, `lifecycle`, `unsafe-reach`, `modules`, `injection`, `types` | [Audit & Correctness](/ai-clis/monogram/audit#deep-semantic-plane)              |
| Possibility bands  | Which concrete rows need human or agent proof?                                    | 14 named band/worklist commands                                                                       | [Audit & Correctness](/ai-clis/monogram/audit#the-14-possibility-band-commands) |
| Index estate       | Which project database answers, and is it current?                                | `index`, `reindex`, `stats`, `list`, `scope`, `prune`                                                 | [Scope & Index Management](/ai-clis/monogram/scope)                             |
| Boot trace         | In what order does a web app initialize?                                          | `boot`, `boot init`                                                                                   | [Boot Sequence Tracer](/ai-clis/monogram/boot)                                  |

## The evidence boundary

Monogram deliberately separates observation from conclusion:

* Search and region scores rank likely source locations. They do not prove causality.
* `uncalled` reports no inbound edge in the indexed graph. Dynamic, reflective, trait, external, and test callers may be invisible.
* Deep semantic commands and possibility bands return candidates or complete review worklists. A row is not automatically a defect.
* `coupling --verify-callers` reports inbound-edge facts for orphan definitions; public APIs and dynamically invoked handlers still require interpretation.
* The stable proof loop is `context` the concrete row, follow it with `chain` or `investigate`, inspect the owning boundary, and rerun the same query after a change.

## Public MCP surface: 50 tools

`monogram mcp` exposes 50 investigation tools over stdio JSON-RPC. `monogram mcp-schema` prints the exact wrapper schema used by the server.

```bash theme={null}
monogram mcp-schema
monogram mcp
```

The 50-tool surface includes locate, navigation, contract, coupling, quality, deep-semantic, and possibility-band commands. The complete inventory and purpose of every tool is in [Monogram Reference](/ai-clis/monogram/reference#complete-50-tool-mcp-inventory).

Index and terminal administration are intentionally separate from that 50-tool count. Commands such as `index`, `reindex`, `prune`, `scope`, `docs`, `verify`, `hook claude`, `hook install/remove/status`, and `mcp` manage local state or integration rather than serving as MCP investigation tools. In the sequence family, `start`, `deepen`, `define`, `finish`, and `resume` change repo-local session artifacts; only `status` and `list` are read-only. `boot init` also writes configuration. See the mutation boundaries on the companion pages.

## Supported languages

The core index recognizes 24 language families:

| Area      | Languages and formats                       |
| --------- | ------------------------------------------- |
| Systems   | Rust, C, C++, Go, Zig                       |
| Web       | TypeScript, JavaScript, HTML, CSS, PHP      |
| Apps      | Swift, Kotlin, Dart, Java, Scala            |
| Scripting | Python, Ruby, Bash/Zsh, Lua                 |
| Config    | TOML, YAML, JSON, HCL/Terraform, Dockerfile |

The basic index extracts search identifiers, symbols, references, calls, imports, and boundary keys where the language adapter supports them. The deep semantic companion is a separate evidence plane: verify it with `monogram semantic status` before relying on deep commands.

## Project-scoped indexes

Each registered project root has its own database. Monogram resolves the deepest indexed ancestor of the current working directory, so your current directory is part of every query.

```bash theme={null}
monogram list --health
monogram stats --deep
```

In a monorepo, `cd` into the intended indexed subtree before making an absence claim. Learn the registry, workspace expansion, schema-v17 corpus policy, selective recovery, and fail-closed deep-index rules in [Scope & Index Management](/ai-clis/monogram/scope).

## Installation and release identity

Monogram is distributed through OpenCLIs:

```bash theme={null}
curl -fsSL https://openclis.com/install.sh | sh
openclis install monogram
openclis update monogram

command -v monogram
monogram --version
openclis info monogram
openclis init monogram
```

The installed binary, the OpenCLIs registry entry, and a development checkout can be at different versions. Public behavior should be claimed from the installed release and its live `mcp-schema`; source-only changes are not a shipped feature.

The public registry guide includes the ordered sequence flow and relationships
to NIIA, Monoflow, Work Wiki, Monograph, the Monogram companion tools, Kernel
CLI, and MonoSurf. When command-specific wrapper guidance is useful, run for
example `OPENCLIS_NEXT=1 openclis monogram search "session reconnect"`; the
wrapper adds a bounded next step after the native Monogram result.

The 0.98.11 release has five platform artifacts. Each archive and extracted
payload below was downloaded from build `2026-07-20-154556` and verified
directly:

| Platform key      | Archive SHA-256                                                    | Extracted payload SHA-256                                          | Source commit recorded by platform metadata |
| ----------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------- |
| `darwin-aarch64`  | `c694b759eac7fa0cc265048c87e158982c9b7a78c0652fbf7d38a32dbcddd9fa` | `e17f019fca556c6185e6f0e594f5d5d35cb7b0c8102347789f1c482b6b6e7d0e` | `96d20c623b95e8aa9938b96d2a608557aac09e8d`  |
| `linux-x86_64`    | `0be4dbafe12608d7c39e630f6aea70078cbfa406c8dba59d64828f341da9059d` | `a6c8b211b4360ce69d84f503d9093a668643d3ab0d7baf07eaf1f7ea3c5d03fd` | `04f5162b8bb1518c8814b50de90990ad4030e3ca`  |
| `linux-aarch64`   | `e974498ec1e24cf9c7494dedfc795556a3135e172582f5b82666f0d8d676dab9` | `35620ca93d50d5e31a0cb645d0a6dfee516d6a5e48911b75392a5e2ca5432fb1` | `04f5162b8bb1518c8814b50de90990ad4030e3ca`  |
| `windows-x86_64`  | `bbc5d2bb43c51988489711ae4e17d961db77e92a806344e99cafcc2e6b356fdb` | `c1debaaf37da5da28e561df4be557679166613a5c75be820d7da69655ac02430` | `04f5162b8bb1518c8814b50de90990ad4030e3ca`  |
| `windows-aarch64` | `9efb5eacdc97eaf239768dd19fa23c50cca0136b4203974cf64d14c24a00a93a` | `adaf4e923a75de8b43235d3797934574c680d5128ef48d707dd961892dc3cf81` | `04f5162b8bb1518c8814b50de90990ad4030e3ca`  |

The OpenCLIs-managed macOS payload reports 0.98.11, passes strict signature
verification, exposes 50 MCP schema commands, and verifies 353 embedded Book
files plus seven initiate-tree files. Archive integrity, executable signature,
runtime behavior, and source-provenance metadata are separate proofs; the
verified hashes do not resolve the macOS commit split described above.

Intel macOS is not part of the stable five-platform matrix. Check
`cdn.openclis.com/monogram/latest.json` and its referenced `meta.json` rather
than inferring platform support from the Rust source.

## Relationship to the Monolex tools

| Tool                                              | Owns                                                                                                         | Use together                                                                                                                                    |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [NIIA](/ai-clis/niia)                             | Work entry, memory, sessions, PTY control, MCP wrapping, OS-control authorization, and remote orchestration  | Use NIIA to retain and orchestrate work; use Monogram to prove code structure.                                                                  |
| [Monogram Semantics](/ai-clis/monogram-semantics) | Clean-room structural IR Store, resolved/lexical graphs, effects, and possibility-band evidence              | Use Semantics when the product graph needs a deeper source-structure proof plane or an explicit compiler-review lane.                           |
| [Monogram Logos](/ai-clis/monogram-logos)         | Three-command MAP/VALIDATE/EMIT foundry over the Semantics Store                                             | Use Logos to review a candidate band before native absorption; use Monogram for the shipped navigation/ranking behavior.                        |
| [Monogram Language](/ai-clis/monogram-language)   | Language-self corpus profiles and gated future-prior design artifacts                                        | Use Language for reviewable corpus evidence; it never silently changes Monogram ranking.                                                        |
| [Monoflow](/ai-clis/monoflow)                     | Temporal composition across Monogram code structure, git history, documents, watcher events, and saved diffs | Use Monogram for the current code graph; use Monoflow for topics, co-change, gaps, quality delta, and cross-database insight over time.         |
| [Work Wiki](/ai-clis/work-wiki)                   | Work history, file biography, project knowledge, and code-to-document convergence                            | Use Work Wiki to ask whether Monoflow-derived code topics are covered by research and final docs; return to Monogram for symbol and edge proof. |
| [Kernel CLI](/kernel-cli)                         | Local OS observation and action primitives                                                                   | NIIA owns grants and routes `observe`/`control`; Kernel CLI performs the OS operation.                                                          |
| [MonoSurf](/monosurf)                             | Browser connection, observation, and automation                                                              | Use MonoSurf for a live web surface and Monogram for the implementation behind it.                                                              |
| [Monograph](/ai-clis/monograph)                   | Curated code and fix-shape books                                                                             | Monogram embeds a release snapshot and can attach Book IDs; the standalone CLI manages and verifies installed Books.                            |

## Keeping results fresh

```bash theme={null}
# Incremental refresh
monogram index .
monogram search "new symbol" -r

# Full, crash-safe rebuild for schema/corpus recovery
monogram reindex .
```

`index` and `-r` are the everyday incremental paths. `reindex` is a full rebuild. Monogram prints index identity and freshness before queries; do not silently treat stale results as current evidence.

```text theme={null}
ordinary change ──▶ incremental index ──▶ current generation
contract epoch changed ────────────────▶ full rebuild required
unlisted structural drift ─────────────▶ fail closed; widen the refresh
successful reindex ─▶ new current + one rollback margin ─▶ older generations reclaimed
```

Version 0.98.11 separates executable version from extraction compatibility. A
different Monogram crate version may continue incremental writes when the
stored corpus contract epoch is unchanged; an old contract epoch refuses the
write and routes to a rebuild. This avoids needless full rebuilds while still
preventing a new extractor from stamping old structural assumptions as current.

Selective `--files-from` recovery may converge content or membership drift it
observes during the paired core/deep pass. It does not silently accept a new or
removed source outside the authoritative carrier: unresolved structural drift
leaves semantic currentness closed and requires a broader index. After a
successful crash-safe reindex, Monogram protects every live registry pointer,
keeps the newest previously served generation as a rollback/in-flight-reader
margin, and reclaims older superseded generations plus same-root crash orphans.

## Where next

* [Monogram Reference](/ai-clis/monogram/reference) — all 50 MCP tools plus CLI-only integration commands
* [Scope & Index Management](/ai-clis/monogram/scope) — database selection, schema-v17 policy, incremental recovery, exclusions, and cleanup
* [Audit & Correctness](/ai-clis/monogram/audit) — contract, coupling, semantic, and 14 possibility-band audits
* [Boot Sequence Tracer](/ai-clis/monogram/boot) — web initialization order and the config write boundary
