Commit Graph

8 Commits

Author SHA1 Message Date
Paul O'Reilly
b76e56f750 fix(claude-profile): use --append-system-prompt-file to avoid ARG_MAX on large projects
Passing combined context inline as a CLI arg hits Linux ARG_MAX (~2 MB)
when project CONTEXT.md or MEMORY.md are large. Three changes:

1. Write combined_context to a mktemp file and pass via
   --append-system-prompt-file instead of the inline --append-system-prompt arg.

2. Drop exec in favour of a subprocess call so the EXIT trap fires
   after claude exits, properly resetting the WezTerm theme and cleaning
   up the temp file. (With exec, bash is replaced immediately and traps
   never fire on success — WezTerm reset was silently broken.)

3. Warn when context exceeds 150 KB and show context size (in KB) on
   the launch line and in dryrun output, so oversized CONTEXT.md files
   are visible before they become a crash.
2026-06-22 10:17:31 +12:00
Paul O'Reilly
16586541ea claude-profile: bump opus to 4.8, add fable driver
- driver_model_id(): opus -> claude-opus-4-8, opus-1m -> claude-opus-4-8[1m]
- driver_model_id(): add fable -> claude-fable-5
- error message updated: Valid: haiku sonnet opus opus-1m fable
- spec: driver->model table updated (opus 4.8, fable added); frontmatter
  driver enum includes fable; note that opus-1m retained for [1m] convention
- tests: add Test 13 (deep-fable dryrun asserting claude-fable-5);
  add Test 14 (unknown driver exits 1) — 47 assertions total
  Note: deep-fable mode file lands in the next commit
2026-06-12 21:33:58 +12:00
Paul O'Reilly
9e13b7f096 claude-profile: remove provider-yaml system, embed model config in profiles
Provider selection phase removed; Anthropic driver→model_id is now
hardcoded in the script and non-Anthropic profiles supply provider.env
(MODEL_ID, ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY_FILE).

Test suite baseline changes 58 → 41 assertions: the 17 dropped
assertions covered the removed provider-yaml selection phase, not
retained behaviour.

Includes refactor-derived memory: decisions (provider architecture,
driver enforcement via --model), bash gotchas (read -rp under set -e,
never eval user config), process lessons.
2026-06-12 21:26:07 +12:00
Paul O'Reilly
4cd9757abc feat(claude-profile): warn when non-Anthropic provider used with OAuth profile
Add a warning when ANTHROPIC_BASE_URL would be set but the active profile's
.credentials.json would override ANTHROPIC_API_KEY with subscription OAuth,
routing requests to Anthropic instead of the intended provider.

Fixes the MiniMax routing issue: use --profile minimax (~/.claude-minimax/,
no stored credentials) for non-Anthropic providers.

Update presets example to use profile: minimax for quick-minimax preset.
63 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 18:33:39 +12:00
Paul O'Reilly
a11051e0a8 feat(claude-profile): add provider selection (model + endpoint + credentials)
Introduces provider files (`data/claude-profile/providers/*.yaml`) that
bundle model ID, API base URL, API key source, and extra env vars. Phase 2.5
(provider selection) added between mode selection and launch, with a default
derived from the mode's driver field so existing Anthropic usage is unchanged.

Ships 5 providers: anthropic-haiku/sonnet/opus/opus-1m and minimax-sonnet.
MiniMax token decrypted from agent-runtimes SOPS env, stored at
~/.claude-secrets/minimax-auth-token. Adding new providers = one YAML file,
no script changes.

58 dryrun tests passing (up from 37).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 18:16:22 +12:00
Paul O'Reilly
143b32597e Add claude-profile engagement mode picker with statusline and session-start integration
- claude-profile: phase 1-3 picker (profile, mode, launch) with preset support,
  dryrun, WezTerm theming, and --append-system-prompt mode body injection
- 5 mode files (chat/quick/deep/hybrid/orch) with YAML frontmatter + prose body;
  new escalates_to field drives statusline →Opus arrow for deep and hybrid
- statusline.sh reads CLAUDE_CONFIG_DIR/active-mode.env to show
  [Sonnet→Opus] deep · topic format when launched via claude-profile
- Root CLAUDE.md session-start: auto-selects project from cwd or CLAUDE_PROJECT
  in active-mode.env, skipping the interactive picker when context is clear
- Spec, tests (37 assertions, 9 test files, all passing), context docs, and
  preset example included

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 00:36:38 +12:00
Paul O'Reilly
2055926100 Add sync-repos and WezTerm theming to claude-profile
claude-profile now:
- Syncs all repos (git pull --ff-only) before starting a session
- Emits WezTerm user-var escape sequences to trigger profile themes
- Resets terminal theme on session exit via trap

New script sync-repos pulls latest for all git repos under ~/dev/claude
with --dryrun support and color status output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 18:44:43 +13:00
Paul O'Reilly
87f7bfb7cd Add claude-profile: manage Claude Code profile symlinks
Utility for switching between Claude Code skill profiles by
managing the ~/.claude/skills symlink target.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:14:39 +13:00