feat: add Claude Code installation target - #21
Merged
Conversation
Materialize shadow-passed mutations as repo-scoped Claude Code skills at .claude/skills/autophagy-<id>/SKILL.md alongside the existing Codex target, sharing one InstallTarget-parameterized code path for planning, non-overwrite materialization, symlink-escape refusal, and drift-checked rollback. The Claude Code body reproduces the reviewed instruction, versioned trigger selectors, exclusions, and an evidence footer citing exact supporting and counterexample event IDs plus mutation ID and version. Migration 0007 relaxes the installation registry CHECK constraints to accept the new target and its .claude/skills path; uninstall reconstructs the materializer from the stored target. The CLI gains --target codex|claude-code (defaulting to codex). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV
- record_uninstall derives the transition reason (and metadata) from the stored installation target instead of hardcoding the Codex reason, so a Claude Code uninstall now records "Claude Code repo skill uninstalled". - CLI plain-text install output appends target as the last TSV column rather than inserting it mid-row, preserving positional parsers. - Document the evidence-footer asymmetry (Claude Code only, for Codex byte-stability; the DB audit retains evidence IDs for both) in ADR 0006 and the installation guide. - Add a CLI-level real (non-dry-run) install --target claude-code + uninstall round-trip test exercising audit-driven target reconstruction, and assert the claude-code uninstall reason in the store test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV
karngyan
added a commit
that referenced
this pull request
Jul 16, 2026
PR #21 landed docs/decisions/0006-claude-code-install-target.md, colliding with the model-synthesis ADR. Renumber to 0007 and update all references. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV
karngyan
added a commit
that referenced
this pull request
Jul 16, 2026
* feat: add local model synthesis providers Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV * maint: renumber synthesis ADR to 0007 to avoid collision PR #21 landed docs/decisions/0006-claude-code-install-target.md, colliding with the model-synthesis ADR. Renumber to 0007 and update all references. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV * fix: address PR #22 review (redirect privacy hole + hygiene) - remote.rs: disable HTTP redirects (max_redirects(0) + will_error(false)) and treat any 3xx as a transport error, so a loopback endpoint cannot 3xx-redirect evidence to a non-loopback host past the locality guard. Add mock-server test. - Add a test asserting the transport-error path never echoes the Bearer key. - ADR 0007: correct migration reference to 0008_mutation_provenance. - Prompt test: assert a raw-payload corpus marker is absent from the prompt. - Tighten the prompt-size bound to <=750 approx tokens to pin the documented figure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015LY7xtercMc3NtLeX2z4YV --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim
Autophagy can now install a shadow-passed, review-approved mutation as a repo-scoped Claude Code skill, alongside the existing Codex target. Most users run Claude Code; before this the only materializer wrote Codex skills.
A Claude Code install writes exactly one file —
<repo>/.claude/skills/autophagy-<id>/SKILL.md— withname/descriptionYAML frontmatter and a Markdown body containing the reviewed instruction, the exact versioned trigger selectors, the exclusions, and an evidence footer citing the exact supporting/counterexample AEP event IDs plus the mutation ID and version.What changed
autophagy-install: introduced anInstallTargetenum (Codex,ClaudeCode) that parameterizes one shared code path — planning, non-overwrite materialization (create_new), symlink-escape refusal, and byte-exact drift-checked rollback are all target-agnostic. The target only selects the skill directory (.agents/skillsvs.claude/skills), the registry identifier (codex_repo_skillvsclaude_code_repo_skill), and the agent named in the body.plan_codex_skillstays as a thin wrapper andCodexSkillPlanas a type alias, so existing callers are unaffected. The Codex body is byte-for-byte unchanged.mutation_installations(SQLite cannot alter aCHECKin place) withtarget IN ('codex_repo_skill','claude_code_repo_skill')and arelative_pathcheck that accepts either skill path; existing rows copy forward. The registration validator accepts both targets with their matching path prefix.mutations installgains--target codex|claude-code, defaulting tocodex(existing behavior and--output jsonshape unchanged; the report now also carriestarget).mutations uninstallneeds no flag — it reconstructs the materializer from the stored audit target.knownSchemaVersion6 → 7 so the read-only app treats v7 (the new default) as.supportedrather than "newer-than-known".docs/guides/shadow-and-installation.mdto cover both targets; added ADR 0006 (required because a stored schema changed); updated the schema doc and the ADR 0005 known-version note.Evidence
mise run checkpasses (fmt, clippy-D warnings+ pedantic,cargo test --workspace, pandoc GFM docs, actionlint).swift testforapps/macospasses (25 tests).--target claude-codedry-run JSON assertingtargetand.claude/skillspath.install --target claude-codeproduced a validSKILL.md(frontmatter + instruction + selectors + exclusions + evidence footer citingevt_failure_1..3andevt_success_1, mutation ID, version0.1.0) →uninstallremoved the skill and its directory and transitioned the mutation toretired.Privacy implications
Preserves the local-first, offline, reversible guarantees. One file is written inside the user-selected Git repository only after the mutation passes challenge/replay/shadow and the user supplies the exact
repo-skill-writeconfirmation phrase. Nothing is written to~/.claude, global config, hooks, slash commands, or off the machine. The body is deterministic, already-redacted, reviewed content plus the exact evidence identifiers the project requires derived findings to retain. Uninstall removes the file and directory and refuses to touch content whose hash no longer matches.Note on migrations
Added migration 0007;
origin/maincurrently tops out at 0006. A concurrent PR (synthesis / mutations contract v0.2) may also add a store migration — if so, expect a renumber of 0007 at merge time (rename the file, bump theversion/include_str!inmigration.rs; the migration-count assertions instore.rsare literal 7s that would also move, while the version-check tests inmigration.rsare already computed dynamically).🤖 Generated with Claude Code