Skip to main content
The Context Monitor writes runtime context snapshots to disk, providing visibility into exactly what’s being sent to the model.
The user enables context monitoring on an agent; each turn writes a snapshot so they can inspect exactly what reached the model.

Quick Start

1

Enable via Agent config

2

Use the monitor API directly

CLI Usage

Output Formats

Human-Readable (context.txt)

JSON (context.json)

Update Frequency

Sensitive Data Redaction

By default, sensitive data is redacted in snapshots:
Patterns redacted:
  • API keys (sk-, api_key, etc.)
  • Passwords
  • Tokens
  • Connection strings

Multi-Agent Monitoring

Output files:

Safety Features

  1. Opt-in by default: Monitoring is disabled unless explicitly enabled
  2. Redaction: Sensitive data redacted by default
  3. Atomic writes: Uses temp file + rename to prevent corruption
  4. Respects ignore rules: Honors .praisonignore for file content
  5. Cross-platform path safety: Output paths are validated against POSIX and Windows conventions; sensitive system directories are blocked even when absolute paths are explicitly allowed.

Configuration

Environment Variables

How It Works


Best Practices

Context monitors add I/O overhead — disable in production unless you need audit trails.
Human snapshots are for local debugging; JSON suits automated diffing in CI.
Review files before attaching them to tickets — secrets should appear as [REDACTED].
Capture state when compaction triggers to reproduce what the model actually saw.

Context Management

Overview of context management

Context Optimizer

Reduce context size automatically