# Versions
agent-doc is alpha software. Expect breaking changes between minor versions.
Use `BREAKING CHANGE:` prefix in version entries to flag incompatible changes.
## 0.20.2
- **Fix: numeric session name ambiguity** (tmux-router v0.2.8): `new_window()` now appends `:` to session name (`-t "0:"` instead of `-t "0"`). Without the colon, tmux interprets numeric names as window indices, creating windows in the wrong session. Root cause of persistent session 1 bleedover bug.
## 0.20.1
- **Session affinity enforcement**: Route and auto_start bail with error instead of falling back to `current_tmux_session()` when `tmux_session` is set in frontmatter. Prevents pane creation in wrong tmux session.
## 0.20.0
- **CRDT conservative dedup** (#15): Post-merge pass removes identical adjacent text blocks.
- **CRDT frontmatter patches** (#16): `patch:frontmatter` now applied on disk write path (was IPC-only).
- **Binary-vs-agent responsibility** documented in CLAUDE.md.
## 0.19.0
- **ExecutionMode in config.toml**: `execution_mode = "hybrid|parallel|sequential"` in global config.
- **TmuxBatch**: Command batching in tmux-router v0.2.7 — reduces flicker via `\;` separator. `select_pane()` uses batch (2 → 1 invocation).
## 0.18.1
- **Revert Gson**: Hand-written JSON parser restored in JetBrains plugin (Gson causes ClassNotFoundException).
- **H2 scaffolding**: `claim` scaffolds h2 headers before components for IDE code folding.
- **SKILL.md**: Canonical pattern documented — h2 header before every component.
## 0.18.0
- **`agent-doc undo`**: Restore document to pre-response state (one-deep).
- **`agent-doc extract`**: Move last exchange entry between documents.
- **`agent-doc transfer`**: Move entire component content between documents.
- **Pre-response snapshots**: Saved before every write for undo support.
## 0.17.30
- **Immutable session binding**: `claim` refuses to overwrite `tmux_session` unless `--force`. Prevents cross-session pane swapping.
## 0.17.29
- **JNA FFI integration**: `NativeLib.kt` JNA bindings for JetBrains plugin with Kotlin fallback.
- **`agent_doc_merge_frontmatter()`**: New FFI export for frontmatter patching.
- **`agent-doc lib-path`**: Print path to shared library for plugin discovery.
- **VS Code prepend mode**: Fixed missing `prepend` case in `applyComponentPatch()`.
## 0.17.28
- **Validate tmux_session before routing**: Guard against routing to a non-existent tmux session.
## 0.17.27
- **Plugin code-block fix**: JetBrains and VS Code plugins skip component tags inside fenced code blocks. JB plugin 0.2.4, VSCode 0.2.2.
## 0.17.26
- **PLUGIN-SPEC docs update**: Document recent plugin features in PLUGIN-SPEC.
## 0.17.25
- **Stash else-branch fix**: Fix else-branch stash logic. Use `diff --wait` for truncation detection.
## 0.17.24
- **Pulldown-cmark for code range detection**: Replace hand-rolled code span/fence parser with `pulldown-cmark` in component parser. Stash overflow panes instead of creating new windows.
## 0.17.23
- **Stash overflow fix**: Overflow panes stashed instead of creating new tmux windows.
## 0.17.22
- **UTF-8 corruption fix**: Sanitize component tags in response content before writing to prevent UTF-8 corruption in `sanitize_component_tags`.
## 0.17.21
- **Indented fenced code blocks**: Component parser skips markers inside indented fenced code blocks. Scaffold `agent:pending` in claim for template documents.
## 0.17.20
- **BREAKING CHANGE: Rename `mode` to `patch`** for inline component attributes (`patch=append|replace`). `mode=` accepted as backward-compatible alias.
## 0.17.19
- **Split-window in auto_start**: Use `split-window` instead of `new-window` for auto-started Claude sessions. Resync tests added.
## 0.17.18
- **Resync `--fix` enhancements**: Detect wrong-session panes and wrong-process registrations. Renamed `--dangerously-set-permissions` to `--dangerously-skip-permissions`.
## 0.17.17
- **Parse fix**: `parse_option_line` matches `[N]` bracket format only. Fix `find_registered_pane_in_session` lookup.
## 0.17.16
- **Cursor editor support**: Add Cursor as a supported editor. `claude_args` frontmatter field for custom CLI arguments. Tmux session routing fix. VS Code extension bumped to v0.2.1.
## 0.17.15
- **Route/sync improvements**: Routing and sync refinements for multi-session workflows.
## 0.17.14
- **Plugin IPC fix**: VS Code IPC parity with JetBrains. History command improvements. Documentation updates.
## 0.17.13
- **Fix exchange append mode**: Remove hardcoded replace override in `run_stream`, allowing exchange component to use its configured patch mode.
## 0.17.12
- **Inline component attributes**: `<!-- agent:name mode=append -->` — patch mode configurable directly on the component tag.
## 0.17.11
- **History command**: `agent-doc history` shows exchange version history from git with restore support. IPC-priority writes with `--force-disk` flag to bypass.
## 0.17.10
- **Default component scaffolding**: Auto-scaffold missing components on claim. Append-mode exchange default. Route flash notification via `tmux display-message`.
## 0.17.9
- **Fix CRDT character interleaving**: Switch to line-level diffs to prevent character-level interleaving artifacts.
## 0.17.8
- **Template parser code block awareness**: Component markers inside fenced code blocks are now skipped by the template parser.
## 0.17.7
- **Fix CWD drift**: Recover and claim commands no longer drift from the project root working directory.
## 0.17.6
- **Documentation update**: Align docs with IPC-first write architecture from v0.17.5.
## 0.17.5
- **IPC-first writes**: All write paths (`run`, `stream`, `write`) try IPC to the IDE plugin via `.agent-doc/patches/` before falling back to disk. Exit code 75 on IPC timeout.
## 0.17.4
- **Tmux pane orientation fix**: Arrange files side-by-side (horizontal split) instead of stacking vertically.
## 0.17.3
- **Fix CRDT character-level interleaving bug**: Resolve text corruption caused by character-level merge conflicts in CRDT state.
## 0.17.2
- **Fix CRDT shared prefix duplication bug**: Prevent duplicate content when CRDT documents share a common prefix.
## 0.17.1
- **Fix stream snapshot**: Use replace mode for exchange component in stream snapshot writes.
## 0.17.0
## 0.16.1
- **Native compact for template/stream mode**: `agent-doc compact` now works natively with template and stream mode documents.
## 0.16.0
- **Reactive stream mode**: CRDT-mode documents get zero-debounce reactive file-watching from the watch daemon. Truncation detection and CRDT stale base fix.
## 0.15.1
- **Patch release**: Version bump and minor fixes.
## 0.15.0
- **CRDT-based stream mode**: Real-time streaming output with CRDT conflict-free merge (`agent-doc stream`). Chain-of-thought support with optional `thinking_target` routing. Deferred commit workflow. Snapshot resolution prefers snapshot file over git.
## 0.14.9
- **Multi-backtick code span support**: `find_code_ranges` handles multi-backtick code spans (e.g., ` `` ` and ` ``` `).
## 0.14.8
- **Code-range awareness for strip_comments**: Fix `<!-- -->` stripping inside code spans and fenced blocks. Stash window purge for orphaned idle shells.
## 0.14.7
- **Bidirectional convert**: `agent-doc convert` works in both directions (inline <-> template). Autoclaim sync improvements.
## 0.14.6
- **Auto-sync on lazy claim**: Automatically sync tmux layout after lazy claim in route. Plugin autocomplete fixes for JetBrains.
## 0.14.5
- **`agent-doc commands` subcommand**: List available commands. Plugin autocomplete for JetBrains/VS Code. Remove auto-prune (moved to resync). Purge orphaned claude/stash tmux windows in resync.
## 0.14.4
- **Claim pane focus**: Focus the claimed pane after `agent-doc claim`. `convert` handles documents with pre-set template mode.
## 0.14.3
- **Autoclaim pane refresh**: Refresh pane info during autoclaim. Template missing-component recovery on write.
## 0.14.2
- **Skill reload via `--reload` flag**: Compact and restart skill installation in a single command.
## 0.14.1
- **SKILL.md workflow fix**: Move git commit to after write step in the skill workflow to prevent committing stale content.
## 0.14.0
- **Route focus fix + claim defaults to template mode**: New documents claimed via `agent-doc claim` default to template format. `agent-doc mode` CLI command for inspecting/changing document mode.
## 0.13.3
- **Bump tmux-router to v0.2.4**: Fix spare pane handling in tmux-router dependency.
## 0.13.2
- **Sync registers claims**: `agent-doc sync` registers claims for previously unregistered files in the layout.
## 0.13.1
- **Sync updates registry file paths**: Fix autoclaim file path tracking when sync moves files between panes.
## 0.13.0
- **Autoclaim + git-based snapshot fallback**: Automatic claim on route when no claim exists. Fall back to git for snapshot when snapshot file is missing.
## 0.12.2
- **Exchange component defaults to append mode**: The `exchange` component uses append patch mode by default instead of replace.
## 0.12.1
- **Lazy claim fallback**: `agent-doc claim` without `--pane` falls back to the active tmux pane.
## 0.12.0
- **`agent-doc convert` command**: Convert between inline and template document formats. Lazy claim support. `agent-doc compact` for git history squashing. Exchange component as default template target.
## 0.11.2
- **Strip trailing `## User` heading**: Also strip trailing `## User` heading from agent responses (complement to v0.11.1).
## 0.11.1
- **Strip duplicate `## Assistant` heading**: Remove duplicate `## Assistant` heading from agent responses when already present in the document.
## 0.11.0
- **Append-friendly merge strategy**: Improved 3-way merge strategy optimized for append-style document workflows.
## 0.10.1
- **Bundle template-mode instructions in SKILL.md**: SKILL.md now includes template-mode workflow instructions for the Claude Code skill.
## 0.10.0
- **BREAKING CHANGE: Rename `response_mode` to `agent_doc_mode`**: Frontmatter field renamed with backward-compatible aliases.
## 0.9.10
- **Code-span parser fix**: Component parser skips markers inside fenced code blocks and inline backticks. Template input/output component support.
## 0.9.9
- **Template mode + compaction recovery**: New template mode for in-place response documents using `<!-- agent:name -->` components. Durable pending response store for crash recovery during compaction.
## 0.9.8
- **Relocate advisory locks**: Move document advisory locks from project root to `.agent-doc/locks/`.
## 0.9.7
- **`agent-doc write` command**: Atomic response write-back command for use by the Claude Code skill.
## 0.9.6
- **Race condition mitigations**: Stale snapshot recovery, atomic file writes, and various race condition fixes.
## 0.9.5
- **Advisory file locking**: Lock the session registry during writes. Stale claim auto-pruning.
## 0.9.4
- **Bump tmux-router to v0.2**: Update tmux-router dependency.
## 0.9.3
- **Bump tmux-router to v0.1.3**: Fix stash window handling in tmux-router.
## 0.9.2
- **`agent-doc plugin install` CLI**: Install editor plugins from GitHub Releases. VS Code extension reaches feature parity with JetBrains.
## 0.9.1
- **Stash window resize fix**: Bump tmux-router to v0.1.2 to fix stash window resize issues.
## 0.9.0
- **Dashboard-as-document**: Component-based documents with `<!-- agent:name -->` markers, `agent-doc patch` for programmatic updates, `agent-doc watch` daemon for auto-submit on file change.
## 0.8.1
- **Auto-prune registry**: Prune dead session entries before route/sync/claim operations.
## 0.8.0
- **Tmux-router integration**: Wire `tmux-router` as a dependency for pane management. Fix `route` auto_start bug.
## 0.7.2
- **Attach-first reconciliation**: Sync uses attach-first strategy with auto-register for untracked panes. Column-positional focus. Tmux session affinity.
## 0.7.1
- **Additive reconciliation**: Convergent reconciliation loop (max 3 attempts) with deferred eviction and reorder phase. Nuclear rebuild fallback.
## 0.7.0
- **Snapshot-diff sync architecture**: Rewrite sync to use snapshot-based diffing for tmux layout reconciliation. Dead window handling and column inversion fix.
## 0.6.6
- **`--focus` on sync**: `agent-doc sync` accepts `--focus` flag. Inline hint notification at cursor position in JetBrains plugin.
## 0.6.5
- **Always use `sync --col`**: Single-file sync uses column mode. Break out unwanted panes. Plugin notification balloon for detected layout.
## 0.6.4
- **Sync window filtering + layout equalization**: Filter sync to target window only. Equalize pane sizes after layout.
## 0.6.3
- **LayoutDetector fix**: Skip non-splitter Container children in JetBrains plugin 3-column layout detection.
## 0.6.2
- **Fire-and-forget Junie bridge**: Junie bridge script resolved automatically. Plugin clipboard handoff for non-tmux editors.
## 0.6.1
- **Junie agent backend**: Add Junie as an agent backend with JetBrains plugin action support.
## 0.6.0
- **`agent-doc sync` command**: 2D columnar tmux layout synced to editor split arrangement. Dynamic pane groups.
## 0.5.6
- **Commit message includes doc name**: `agent-doc commit` message format now includes the document filename. `agent-doc outline` command for markdown section structure with token counts.
## 0.5.5
- **Window-scoped routing**: Route commands scoped to tmux window (not just session). `--pane`/`--window` flags. Layout safeguards. JetBrains plugin self-disabling Alt+Enter popup (removes ActionPromoter).
## 0.5.4
- **Positional claim**: `agent-doc claim <file>` accepts file as positional argument. Editor plugin improvements and SPEC updates.
## 0.5.3
- **Bundled SKILL.md with absolute snapshot paths**: Snapshot paths use absolute paths for reliability. Resync subcommand and claims log documentation.
## 0.5.2
- **Claim notifications + resync + plugin popup**: Notification on claim. `agent-doc resync` validates sessions.json and removes dead panes. JetBrains and VS Code editor plugins added.
## 0.5.1
- **Windows build fix**: Cfg-gate unix-only exec in `start.rs` for cross-platform compilation.
## 0.5.0
- **`agent-doc focus` and `agent-doc layout`**: Focus a tmux pane for a session document. Layout arranges tmux panes to mirror editor split arrangement.
## 0.4.4
- **Rename SPECS.md to SPEC.md**: Standardize specification filename.
## 0.4.3
- **Commit CWD fix**: Fix working directory for `agent-doc commit`. SKILL.md prohibition rules.
## 0.4.2
- **SPEC.md gaps filled**: Document comment stripping as skill-level behavior (§4), `--root DIR` flag for audit-docs (§7.6), `agent-doc-version` frontmatter field for auto-update detection (§7.12), and startup version check (`warn_if_outdated`).
- **Flaky test fix**: Skill tests no longer use `std::env::set_current_dir`. Refactored `install`/`check` to accept an explicit root path (`install_at`/`check_at`), eliminating CWD races in parallel test execution.
- **CLAUDE.md module layout updated**: Added `claim.rs`, `prompt.rs`, `skill.rs`, `upgrade.rs` to the documented module layout.
## 0.4.1
- **SKILL.md: comment stripping for diff**: Strip HTML comments (`<!-- ... -->`) and link reference comments (`[//]: # (...)`) before comparing snapshot vs current content. Comments are a user scratchpad and no longer trigger agent responses.
- **SKILL.md: auto-update check**: New `agent-doc-version` frontmatter field enables pre-flight version comparison. If the installed binary is newer, `agent-doc skill install` runs automatically before proceeding.
- **PromptPanel: JDialog to JLayeredPane overlay**: Replace `JDialog` popup with a `JLayeredPane` overlay in the JetBrains plugin, eliminating window-manager popup leaks.
## 0.4.0
- **`agent-doc claim <file>`**: New subcommand — claim a document for the current tmux pane. Reads session UUID from frontmatter + `$TMUX_PANE`, updates `sessions.json`. Last-call-wins semantics. Also invokable as `/agent-doc claim <file>` via the Claude Code skill.
- **`agent-doc skill install`**: Install the bundled SKILL.md to `.claude/skills/agent-doc/SKILL.md` in the current project. The skill content is embedded in the binary via `include_str!`, ensuring version sync.
- **`agent-doc skill check`**: Compare installed skill vs bundled version. Exit 0 if up to date, exit 1 if outdated or missing.
- **SKILL.md updated**: Fixed stale `$()` pattern → `agent-doc commit <FILE>`. Added `/agent-doc claim` support.
- **SPEC.md expanded**: Added §7.7–7.13 (all commands), §8 Session Routing with use case table (U1–U11), §8.3 Claim Semantics.
## 0.3.0
- **Multi-session prompt polling**: `agent-doc prompt --all` polls all live sessions in one call, returns JSON array. `SessionEntry` now includes a `file` field for document path (backward-compatible).
- **`agent-doc commit <file>`**: New subcommand — `git add -f` + commit with internally-generated timestamp. Replaces shell `$()` substitution in IDE/skill workflows.
- **Prompt detection**: `agent-doc prompt` subcommand added in v0.2.0 (unreleased).
- **send-keys fix**: Literal text (`-l`) + separate Enter, `new-window -a` append flag (unreleased since v0.2.0).
## 0.1.4
- **`agent-doc upgrade` self-update**: Downloads prebuilt binary from GitHub Releases as the primary upgrade strategy. Falls back to `cargo install`, then `pip install --upgrade`, then manual instructions including `curl | sh`.
## 0.1.3
- **Upgrade check**: Queries crates.io for latest version with a 24h cache. Prints a one-line stderr warning on startup if outdated.
- **`agent-doc upgrade`**: New subcommand tries `cargo install` then `pip install --upgrade`, or prints manual instructions.
## 0.1.2
- **Language-agnostic audit-docs**: Replace Cargo.toml-only root detection with 3-pass strategy (project markers → .git → CWD fallback). Scan 28 file extensions across 6 source dirs instead of .rs only.
- **--root CLI flag**: Override auto-detection of project root for audit-docs.
- **Test coverage**: Add unit tests for frontmatter, snapshot, and diff modules.
## 0.1.0
Initial release.
- **Interactive document sessions**: Edit a markdown document, run an AI agent, response appended back into the document.
- **Session continuity**: YAML frontmatter tracks session ID, agent backend, and model. Fork from current session on first run, resume on subsequent.
- **Diff-based runs**: Only changed content is sent as a diff, with the full document for context. Double-run guard via snapshots.
- **Merge-safe writes**: 3-way merge via `git merge-file` if the file is edited during agent response. Conflict markers written on merge failure.
- **Git integration**: Pre-commit user changes before agent call, leave agent response uncommitted for editor diff gutters. `-b` flag for auto-branch, `--no-git` to skip.
- **Agent backends**: Agent-agnostic core. Claude backend included. Custom backends configurable via `~/.config/agent-doc/config.toml`.
- **Commands**: `run`, `init`, `diff`, `reset`, `clean`, `audit-docs`.
- **Editor integration**: JetBrains External Tool, VS Code task, Vim/Neovim mapping.