Repository navigation
v0.3.8 — Close the loop with apply-zip
contextzip has always handled getting your code out to an AI tool. This release handles the trip back in.
contextzip apply-zip
Once an AI tool hands you back a ZIP with its changes, drop it into .contextzip/inbox/ and run:
contextzip apply-zipNo manual unzip-and-hope, no wondering whether you've overwritten something you meant to keep.
How it stays safe
Every ZIP contextzip creates now gets a small manifest — a hash of each included file — written next to it in .contextzip/output/. It's local only and never goes in the ZIP itself, so it's never uploaded and nothing an AI model (or a teammate) would ever notice or ask about.
apply-zip uses that manifest to classify every file before touching anything:
| Status | Meaning | Applied automatically? |
|---|---|---|
| New | Wasn't part of the original zip | ✅ |
| Modified | Sent, changed, and your copy hasn't moved since | ✅ |
| Unchanged | Identical to what's on disk | Skipped |
| Drifted | You edited (or deleted) it locally after zipping | ⏸️ asks first |
| Untracked | No baseline to compare against | ⏸️ asks first |
The common case — zip it, AI edits it, nothing else changes in the meantime — applies straight through with just a summary. Anything riskier stops and asks.
Other guarantees
- Path-traversal protection — any zip entry resolving outside the project is refused outright, no override.
- Automatic backups — every overwritten file is copied to
.contextzip/backups/<timestamp>/first. - No silent deletions — v1 only adds and modifies; nothing is ever removed from disk based on a zip's contents.
- Archived, not deleted — consumed zips move to
.contextzip/inbox/applied/, so there's always a trail back to what was applied and when.
Usage
contextzip apply-zip # auto-detect from .contextzip/inbox/
contextzip apply-zip fix.zip # explicit path overrides the inbox
contextzip apply-zip --dry-run -v # preview every file's status first
contextzip apply-zip -y # skip confirmation, even if riskyAlso available from Python:
from contextzip import apply_zip
result = apply_zip()
print(f"Wrote {len(result.written)} files, backup at {result.backup_dir}")Full Changelog: v0.3.7...v0.3.8