mlx-optiq
OptiQ Code · Sessions & traces

Sessions & traces

Every run is recorded, so you can pick up where you left off and share exactly what happened.

Where sessions live

Sessions are stored per repo under ~/.optiq/code/sessions/<repo-key>/. The key combines the repo name and a hash of its path, so two projects with the same folder name never collide. Each session keeps the full message trajectory plus an event log (the goals you typed, the tools that ran).

Continue & resume

  • optiq code -c / --continue continues the most recent session in this repo. The model reloads its prior context and picks up where it left off.
  • optiq code -r <id> / --resume <id> resumes a specific session by id.

Within a single launch, successive goals build one continuous conversation, so a follow-up like "now add a test for that" already has the context.

Export a trace

Export a session as a JSONL trace in the HuggingFace Session-Traces format:

terminalbash
$ optiq code export -o session.jsonl        # most recent session
$ optiq code export -r <id> -o session.jsonl # a specific one

The trace format

The first line is a session record (id, model, harness: "optiq-code"); each following line is a message record with the role and any tool calls (camelCase toolCalls / toolCallId). It is the same schema used across the OptiQ tooling, so a trace drops straight into a dataset or a bug report.

session.jsonljson
{"type":"session", "harness":"optiq-code", "model":"...Qwen3.6-27B-OptiQ-4bit"}
{"type":"message", "message":{"role":"assistant", "toolCalls":[...]}}
{"type":"message", "message":{"role":"tool", "toolCallId":"..."}}

Using a trace

An exported trace is the fastest way to file a useful bug report (it carries the exact turns the model took), and it doubles as training data, a record of a model fixing real bugs, ready for fine-tuning with the LoRA workflow.

For a large example in exactly this format, see the OptiQ Code Traces dataset: 1,706 gold-verified software-engineering trajectories as Session-Traces files, collected to fine-tune local models for OptiQ Code.