Skip to content

feat: add per-prompt model selection field#36

Open
mtibbits wants to merge 2 commits into
JCSnap:mainfrom
mtibbits:feat/model-selection
Open

feat: add per-prompt model selection field#36
mtibbits wants to merge 2 commits into
JCSnap:mainfrom
mtibbits:feat/model-selection

Conversation

@mtibbits

Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional model field to QueuedPrompt YAML frontmatter, allowing users to specify a Claude model ID (e.g. claude-haiku-4-5-20251001) per queued prompt
  • When set, passes --model <id> to the claude CLI subprocess; when unset, behavior is unchanged (backward compatible)
  • Includes R7 type-safe coercion in the YAML parser to handle YAML implicit typing (model: true"True")
  • Adds --model / -m flag to claude-queue add CLI command
  • Surfaces model in claude-queue bank list output and template frontmatter

Changes

File Change
models.py model: Optional[str] = None field on QueuedPrompt
storage.py R7 coercion in parse, round-trip in write, templates, bank list
claude_interface.py --model flag injected before positional prompt arg
cli.py --model/-m on add subparser, display in bank list

Test plan

  • pytest tests/ -m "not llm_eval" — all 547 tests pass (verified locally)
  • Verify claude-queue add "test" --model claude-haiku-4-5-20251001 creates prompt with model set
  • Verify claude-queue add "test" (no flag) creates prompt with model=None
  • Verify claude-queue template foo output includes model: null in frontmatter
  • Verify claude-queue bank save foo && claude-queue bank list shows model field
  • Verify round-trip: write prompt with model → parse → model preserved
  • Verify YAML coercion: model: true in frontmatter → "True" string (invalid model, handled by CLI exit + retry)

🤖 Generated with Claude Code

Allow users to specify a Claude model ID (e.g. claude-haiku-4-5-20251001)
per queued prompt via YAML frontmatter or `claude-queue add --model`.
When set, the value is passed to the claude CLI via `--model <id>`.

- models.py: add `model: Optional[str]` field to QueuedPrompt
- storage.py: R7 type-safe coercion in parse, round-trip in write,
  include in templates and bank list output
- claude_interface.py: inject `--model` flag before positional prompt
- cli.py: add `--model/-m` to `add` subparser, display in `bank list`
- CLAUDE.md: add model field to YAML schema, --model to CLI reference
- 14 new tests across all 4 test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthew Tibbits <mtibbits@users.noreply.github.com>
@mtibbits mtibbits force-pushed the feat/model-selection branch from 32b0c5c to 53e0fa4 Compare March 16, 2026 03:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matthew Tibbits <mtibbits@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant