Inspecting History
Once you have initialized a context store and begun packing agent executions, ctx provides a suite of tools to navigate and inspect your history. This is critical for debugging agent behavior, verifying artifact provenance, and maintaining a record of AI-driven workflows.
Viewing the Execution Log
To see a chronological list of all finalized context packs in your local store, use the ctx log command.
ctx log
The log displays a summary of your history, including the content-addressed hash, the creation timestamp, the model used, and a brief overview of the execution's scope. This is the primary way to find the specific hashes needed for deeper inspection or comparison.
Deep Inspection of a Pack
To perform a deep dive into the metadata, inputs, and step-by-step actions of a specific execution, use ctx show.
ctx show <hash>
The command supports several ways to reference a pack:
- Full Hash: The complete content-addressed SHA-256 identifier.
- Short Hash: A unique hex prefix (e.g.,
ctx show a1b2c3). - URI: The
ctx://protocol identifier (e.g.,ctx show ctx://a1b2c3d4e5f6).
Understanding the Pack Manifest
The ctx show command parses the immutable manifest and presents a human-readable summary. The output is structured into several key technical areas:
| Section | Description |
|:--- |:--- |
| Metadata | Includes the Pack Hash, creation date (UTC), and the Model identifier (e.g., gpt-4). |
| System Prompt | The exact system instructions provided to the agent, referenced by its own content hash. |
| Inputs | A list of all files, data, and configurations injected into the agent's context window. |
| Steps | The sequential execution trace, showing tool calls (e.g., read_file, write_file) and whether they were deterministic. |
| Outputs | The final artifacts produced by the agent execution. |
| Environment | The technical stack at the time of execution, including OS, runtime version, and specific tool versions. |
Example Output
Pack: a1b2c3d4e5f6
Created: 2023-10-27 14:30:05 UTC
Model: gpt-4
System Prompt: f8e7d6c5b4a3
Inputs (1):
readme.md (1024 bytes)
Steps (2):
[0] tool_call read_file (deterministic)
[1] tool_call write_file (non-deterministic)
Outputs (1):
summary.txt
Environment: darwin / go1.22
Tool Versions:
read_file: 1.0.2
write_file: 2.1.0
Practical Workflows
Finding a Specific Run
If you know an agent produced a specific file but you aren't sure which execution log it belongs to, you can use ctx log to find the most recent entries and then use ctx show on the candidate hashes to verify the output list.
Identifying Non-Determinism
When inspecting history via ctx show, pay close attention to the Steps section. Steps marked as non-deterministic are points where the agent's behavior might vary across replays, which is a common starting point for investigating drift or unexpected outputs.
Exporting for External Tools
Because context packs are stored as content-addressed JSON manifests, you can also inspect the raw data directly in the .ctx/objects/ directory if you need to feed the execution history into custom analysis scripts or third-party observability platforms.