> ## 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.

# Monolog

> PTY activity log — query recent terminal operations, sessions, files, timelines, and indexed memos.

Monolog queries recognized AI-tool activity captured from Monolex, MonoTerm,
and Headless PTY output. The gate maps provider-specific markers such as Read,
Write, Bash, and Search into a shared activity store; only operations accepted
by that gate become durable evidence.

*Published contract: `monolog 0.2.2`, OpenCLIs build
`2026-06-30-035910`. The executing binary, registry, and public CDN metadata
agree on this release.*

<Card title="See the work across three lenses" icon="eye" href="https://monolex.ai/tools/observe/">
  Use Monocli for conversations, Monometer for usage, and Monolog for terminal activity; this page remains the Monolog command reference.
</Card>

***

## Quick Start

```bash theme={null}
# Install the current public payload
openclis install monolog

# Recent activities (default: 20)
monolog

# Search for a file
monolog search main.rs

# Indexed memo search
monolog index
monolog find scrollbar

# Session overview
monolog sessions

# Most touched files
monolog files

# Daily activity chart
monolog timeline

# Embedded guide and topic list
monolog help
monolog docs
```

***

## What Gets Recorded

Every time an AI CLI (Claude Code, Codex, Gemini) runs a tool inside Monolex, the operation is captured.

```
┌──────────────────────────────────────────────────────────────────┐
│  RECORDED OPERATIONS                                             │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Claude Code        Codex CLI          Gemini CLI                │
│  ───────────        ─────────          ──────────                │
│  Read               read_file          ReadFile                  │
│  Write              write_file         WriteFile                 │
│  Edit               apply_diff         Shell                     │
│  Bash               shell              SearchFiles               │
│  Search                                ListDir                   │
│  Grep, Glob                                                      │
│  WebFetch, WebSearch                                             │
│  TodoWrite, Skill                                                │
│                                                                  │
│  Each record includes:                                           │
│    operation, target (file/command), timestamp, terminal name,   │
│    AI provider, source (app / headless / monoterm)               │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
```

***

## Search Paths

```
┌──────────────────────────────────────────────────────────────────┐
│  SEARCH HIERARCHY                                                │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  monolog search <query>                                          │
│  ─────────────────────                                           │
│  Search recorded activity rows by query.                         │
│    Example: monolog search lib.rs                                │
│                                                                  │
│  monolog index                                                   │
│  ─────────────                                                   │
│  Copy parsed PTY activities into the dedicated Monomento index.  │
│                                                                  │
│  monolog find <query>                                            │
│  ────────────────────                                            │
│  Search the indexed PTY activity documents (top 15).             │
│    Example: monolog find "PRAGMA journal_mode"                   │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
```

***

## Sessions

```bash theme={null}
monolog sessions
```

Groups activities by terminal name. Detects parallel sessions (same name, multiple terminals) and shows operation breakdown.

```
  Scrollbar (178 activities, 10 terminals — PARALLEL)
    2025-12-12 15:49:25 → 2026-02-20 14:26:05
    ops: report:3, Search:84, Read:34, Bash:57

  File Tree Rust (132 activities, 34 terminals — PARALLEL)
    2025-12-18 14:16:31 → 2025-12-23 14:26:37
    ops: Bash:55, Search:62, Read:11
```

***

## Hot Files

```bash theme={null}
monolog files        # top 15
monolog files 30     # top 30
```

Shows the most frequently touched files, how many sessions touched them, and when.

```
#    File                                                    Touches By   Last
───────────────────────────────────────────────────────────────────────────
1    .../app-monolex-headless/src/main.rs                    54     2    2026-03-27
2    .../app-monolex/src-tauri/src/lib.rs                    51     20   2026-03-26
3    .../session_gateway_ingress_runtime.rs                  47     8    2026-03-27
```

***

## Timeline

```bash theme={null}
monolog timeline        # last 14 days
monolog timeline 30     # last 30 days
```

Visual daily activity chart with session count.

```
  2026-03-26 │ 2277 activities,  6 sessions │ ██████████████████████████████████████████████████
  2026-03-27 │  990 activities,  3 sessions │ ██████████████████████████████████████████████████
  2026-04-07 │   16 activities,  1 sessions │ ████████████████
  2026-04-08 │   15 activities,  2 sessions │ ███████████████
```

***

## Statistics

```bash theme={null}
monolog stats
```

Full breakdown: total count, per-source (app/headless/monoterm), per-operation, daily trend, DB size.

```
  Total:    6129 activities
  Sources:
    app-monolex:  6080
    headless:     34
    monoterm:     15

  Operation       Count
  ──────────────────────
  Bash            4259
  Search          968
  Read            625
  report          163
  Write           64
```

***

## Gate Configuration

```bash theme={null}
monolog gate      # show current filters
monolog ops       # show operation pairs
monolog status    # logging enabled/disabled
```

The gate determines what gets recorded. Default gates detect AI markers (⏺ for Claude, • for Codex, ✦ for Gemini) and tool patterns (Read(, Bash(, etc.). Custom filters can be added via the Monolex app settings. `gate` and `ops` print configured rows only, so a successful empty result means no custom rows are currently registered rather than a command failure.

***

## Sources

Monolog identifies where each activity came from:

```
┌──────────────────────────────────────────────────────────────────┐
│  SOURCE DETECTION                                                │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  app        Monolex desktop app (Tauri GUI)                      │
│  headless   Monolex headless server (web sessions)               │
│  monoterm   MonoTerm TUI (terminal-based interface)              │
│                                                                  │
│  All three use the same logging library.                         │
│  Same gate, same operations, same DB.                            │
│  monolog queries all of them at once.                            │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
```

***

## Complete Command Reference

| Command                   | Description                                                   | Read/write boundary                                                                        |
| ------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `monolog`                 | Recent 20 activities                                          | Read-only; no command is the same as `recent 20`.                                          |
| `monolog recent [N]`      | Recent N activities                                           | Read-only.                                                                                 |
| `monolog search <query>`  | Search recorded activity rows                                 | Read-only; alias `s`. The explicit form joins every remaining argument into the query.     |
| `monolog find <query>`    | Search indexed PTY activity documents; at most 15 results     | Read-only derived search; alias `memo`.                                                    |
| `monolog index`           | Copy every parsed activity into the dedicated Monomento index | Derived database write; alias `reindex`. It does not create missing historical PTY events. |
| `monolog sessions`        | Session summaries                                             | Read-only; alias `sess`.                                                                   |
| `monolog files [N]`       | Hot files ranking; default 15                                 | Read-only aggregate; alias `f`. A non-numeric N falls back to 15.                          |
| `monolog timeline [days]` | Daily activity chart; default 14 days                         | Read-only aggregate; alias `tl`. A non-numeric value falls back to 14.                     |
| `monolog stats`           | Full source/operation/database statistics                     | Read-only.                                                                                 |
| `monolog gate`            | Current gate/filter configuration                             | Read-only configuration view.                                                              |
| `monolog ops`             | Recorded operation pairs                                      | Read-only.                                                                                 |
| `monolog status`          | Logging daemon/status truth                                   | Read-only runtime view.                                                                    |
| `monolog docs [topic]`    | Lists or serves embedded AI documentation                     | Read-only; the 0.2.2 payload contains the `index` topic.                                   |
| `monolog --version`       | Installed payload identity                                    | Read-only; `-V` and `version` are equivalent.                                              |
| `monolog help`            | Embedded command guide                                        | Read-only; `--help` and `-h` are equivalent.                                               |

An unknown first argument is treated as a search query, but only that one token
is used; use `monolog search "multiple words"` for a multi-word query. A missing
query after `search` or `find` exits quietly.

`index` reads `parsed_activities` from the shared PTY database and writes
documents named `pty-activity/<id>` to
`Monolex/protocols/niia/database/monolog-memo.db` beneath the platform data
directory. `find` reads that derived database. Direct `search`, session, file,
timeline, and stats views remain backed by the PTY activity database.

Monolog queries persisted evidence; it does not drive a terminal and cannot
reconstruct events that were never recorded. A healthy logger now and a
complete historical range are separate claims.

## Release Platforms

| Artifact                        | Public binary | Boundary                                                                       |
| ------------------------------- | ------------- | ------------------------------------------------------------------------------ |
| `darwin-aarch64`                | `monolog`     | Native macOS payload; strict code-signature verification passed in this audit. |
| `linux-x86_64`, `linux-aarch64` | `monolog`     | Uses the platform data directory for shared databases.                         |
| `windows-x86_64`                | `monolog.exe` | Same query surface with Windows platform paths.                                |

## Relationships

| Tool                            | Ownership                                                                                     |
| ------------------------------- | --------------------------------------------------------------------------------------------- |
| [MonoCLI](/ai-clis/monocli)     | Provider-native AI conversations and lineage; Monolog stores terminal activity                |
| [Monometer](/ai-clis/monometer) | Token, cost, quota, and usage aggregates                                                      |
| [Monopty](/ai-clis/monopty)     | Drives current PTY sessions; Monolog searches persisted activity afterward                    |
| [Work Wiki](/ai-clis/work-wiki) | Composes terminal/conversation evidence into project knowledge without owning the raw PTY log |
