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.
This commit is contained in:
@@ -15,3 +15,27 @@ When a file looks correct but tooling rejects it, `cat -A` reveals non-printing
|
||||
## Use `git diff --numstat` for binary detection instead of `file`
|
||||
|
||||
The `file` command is unreliable for distinguishing binary from text files (marks shell scripts as "executable"). `git diff --numstat` shows `-` for binary files and is more reliable since git already has its own binary detection heuristics.
|
||||
|
||||
## Verify harness capabilities before designing workarounds
|
||||
|
||||
Before committing to workarounds for something the harness "doesn't support", verify the assumption. A 30-second check via a guide agent can prevent building multiple unnecessary workarounds. Pattern: if you're about to design around a limitation, confirm it's actually a limitation first.
|
||||
|
||||
## Check existing references in old scripts before extending
|
||||
|
||||
When extending an existing script, verify that its current references actually work in the live environment. Broken references can be masked by never running certain code paths. Tests catch these immediately.
|
||||
|
||||
## Guard interactive `read` with `[[ -t 0 ]]` for testable scripts
|
||||
|
||||
For bash scripts that are both interactive and testable, wrap every `read` call with `[[ -t 0 ]]` and provide a default value for non-TTY contexts. This allows the same code path to work interactively or in dryrun/test mode without `set -e` blowups.
|
||||
|
||||
## File-based result passing keeps driver context lean
|
||||
|
||||
When subagents or background processes produce non-trivial results, write them to files and only `Read` into context when actually needed. This unifying pattern (sentinel files, `bg-model-call`, container agent outputs) prevents the driver's context from bloating with data it may never use.
|
||||
|
||||
## Always `Read` a file with the Read tool before calling `Edit`
|
||||
|
||||
The Edit tool tracks which files have been explicitly read via the Read tool — viewing a file via Bash (`cat`, etc.) does not count. An Edit attempt on a file seen only through Bash output is rejected. When planning multiple edits, batch parallel `Read` calls first, then parallel `Edit` calls.
|
||||
|
||||
## `/context` "Memory files" aggregates two distinct systems
|
||||
|
||||
The "Memory files" category reported by `/context` combines project `CLAUDE.md` instructions and auto-memory `MEMORY.md`. They have different purposes (project conventions vs cross-session learnings) and live in different places. When auditing context size, check both rather than assuming a single source.
|
||||
|
||||
Reference in New Issue
Block a user