About the project

Inspiration

I'm always deep in the weeds with Codex and other AI coding agents, and I frequently run into compaction causing issues. When I heard about DeepSeek-OCR and Glyph research I couldn't help but wonder how context could be compacted into images. Looking through the docs I discovered the canvases can hold entire context windows for a fraction of the tokens:

$$ \left(\frac{2048}{32}\right)^{2} = 64^{2} = 4096 $$

visual tokens for a full (2048\times2048) Codex page at (32\times32) patches, a lot of dense monospace history relative to keeping that text in the active budget.

That led me to want to experiment, and behold it worked!

What it does

PackedIn takes in voice, converts it to text via the OpenAI API (Whisper), and manages session context, compacting cold conversation into dense images behind the scenes. When context is full or the user is ready, they can pack up their session and migrate it to a new image-backed replacement thread, reducing context utilization substantially. That lets the user continue natively, without PackedIn rewriting the original Codex rollout.

Voice is an input adapter. The real product is trustworthy context continuity: cold history as provenance-linked images, fragile working state in a small text layer, and a verified handoff instead of a hope that the model recomputes everything from pixels.

How we built it

PackedIn was built nearly entirely with Codex via prompts, starting with deep research into how the image / visual-token path works, combined with extensive benchmarking to find the optimal path to product.

Once that path was established I used a variety of skills that spin up highly parallel agentic workflows, starting with /deep-plan, which outputs a plan artifact constructed after agents review the repository folder by folder, including benchmarks and discoveries.

When the plan was in place, /deep-build inspected that plan and spun up agents to operate at the level they're most effective at (small context), then combined fleets of them to achieve the full result. /deep-explore and related workflows filled the gaps: mapping what was real vs. PRD-only, pressure-testing claims, and closing coverage.

All of these skills were designed by me and written with Codex after thousands of hours of usage, recording the patterns that actually survive messy, long-running work.

Challenges we ran into

The biggest challenge was finding ways to actually beat native compaction as a baseline. Codex's native compaction is very good on its own in our benchmarks, so several tricks needed to be included to do better.

One idea was to use the native compaction itself and convert that to a dense image. However, we couldn't get a clean reusable intermediate out of that path, which blocked the attempt.

Another was context-card construction. When image chains missed cumulative sums, we tried a number-salience "wave" experiment and also the idea of using another agent to construct context cards extracting the relevant calulation. The agent path errored for the same class of reason and was dropped. What stuck was deterministic rolling-state cards, visibly labeled as derived, after the model proved it could read every labeled value and still fail exact arithmetic.

Product UX had its own friction too: quit/dictation bugs, a cluttered tray menu, and migration that wasn't one-button until Pack & Continue existed. Most of those fixes came from dogfooding, not from the PRD.

Accomplishments that we're proud of

Overall I'm most proud that I was able to come up with a workflow that could beat native compaction on the cost / efficacy tradeoff benchmarks and convert that into a workable demo in the timeframe given.

In one matched held-out ~80% utilization stress pair, PackedIn's replacement thread scored 100/100 vs 95/100 for native compaction and ended at 43.34% vs 80.71% active input (one-seed; caveats in the report). The live product gate exercises the shipping watcher, packer, conductor, and dual-ACK image load against Codex CLI 0.144.6, with remaining human checks written down instead of hidden.

What we learned

Codex's native compaction is excellent, but there is still room for improvement. I would love the chance to bench efficacy on packing a native compaction into an image cleanly.

Further, image compaction is surprisingly effective and would be a great benefit to customers, expecially if the model could be trained or tuned to operate on OCR-dense history natively. The other lesson: a model can read every historical value correctly and still fail to recompute exact derived state. Evidence and state are different layers.

What's next for PackedIn

Hopefully we win this and go from there. I'm interested to explore efficacy with other platforms and models, harden the macOS companion, and keep pressure-testing workloads beyond the coding sessions that started it.

Built With

  • codex
  • codexcli
  • fastapi
  • gpt5.6
  • openai-api
  • openai-whisper
  • python
  • sol
  • sqlite
Share this project:

Updates