diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 48d6507..bd248ce 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -72,8 +72,8 @@ Only update the `Status` field — do not modify any other frontmatter or prompt ## Current State -Branch: `main` -In-progress: PR #119 (release alpha.70) open, auto-merge enabled. After merge, run github-release skill to publish. PR #122 (fix #121, abort crash on early escape) open, auto-merge enabled. +Branch: `fix/slash-command-attachments` +In-progress: PR open for #89 (slash commands discarding attachments). Awaiting merge. diff --git a/.claude/sessions/2026-03-27.md b/.claude/sessions/2026-03-27.md new file mode 100644 index 0000000..24a9c5f --- /dev/null +++ b/.claude/sessions/2026-03-27.md @@ -0,0 +1,17 @@ +# Session Log: 2026-03-27 + +### 07:36 - fix/slash-command-attachments (Stage 1 of #89) + +- Did: Moved `takeAttachments()` after `handleCommand()` check in `submit()`. Slash commands now return early before consuming attachments. Also moved the `> text [N attachments]` log after the check (it uses `attachments`). All checks pass: type-check, build, 105 tests, biome. +- Files: src/ClaudeCli.ts +- Decisions: Moved the log line along with `takeAttachments()` since the log references the `attachments` variable. For slash commands, the `> /command` echo is no longer printed (slash commands are internal, not queries). Stage 2 (commit, push, PR) awaits manual verification. +- Next: Stage 2 after Supreme Commander verifies the fix manually. +- Violations: None + +### 07:39 - fix/slash-command-attachments (Stage 2 of #89) + +- Did: Committed Stage 1 fix, pushed to remote, created PR for #89. +- Files: src/ClaudeCli.ts, .claude/CLAUDE.md, .claude/sessions/2026-03-27.md +- Decisions: All changes in one commit per session-end protocol. Prompt status set to completed. +- Next: Await PR merge. +- Violations: None diff --git a/CHANGELOG.md b/CHANGELOG.md index 299477b..4da0101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Slash commands no longer discard pending file attachments + ### Security - Fixed [CVE-2026-33672](https://github.com/advisories/GHSA-c2c7-rcm5-vvqj) (ReDoS) and [GHSA-3v7f-55p6-f55p](https://github.com/advisories/GHSA-3v7f-55p6-f55p) (method injection) in picomatch diff --git a/src/ClaudeCli.ts b/src/ClaudeCli.ts index 8177f9a..c58cc2c 100644 --- a/src/ClaudeCli.ts +++ b/src/ClaudeCli.ts @@ -298,21 +298,22 @@ export class ClaudeCli { return; } - const attachments = this.attachmentStore.takeAttachments(); this.commandMode.exit(); this.editor = clear(this.editor); - if (attachments) { - this.term.log(`> ${text} [${attachments.length} attachment${attachments.length === 1 ? '' : 's'}]`); - } else { - this.term.log(`> ${text}`); - } if (await this.handleCommand(text)) { this.redraw(); return; } + const attachments = this.attachmentStore.takeAttachments(); + if (attachments) { + this.term.log(`> ${text} [${attachments.length} attachment${attachments.length === 1 ? '' : 's'}]`); + } else { + this.term.log(`> ${text}`); + } + const startTime = Date.now(); this.term.log('Sending query...'); this.appState.sending();