feat(hooks): inject the using-tracedecay mandate contract on Claude and Kiro - #249
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ScriptedAlchemy
force-pushed
the
feat/claude-plugin-bundle
branch
from
July 3, 2026 18:37
167c4f1 to
9330b37
Compare
ScriptedAlchemy
force-pushed
the
feat/adoption-contract-injection
branch
from
July 3, 2026 18:38
cbc1a12 to
692be89
Compare
ScriptedAlchemy
force-pushed
the
feat/claude-plugin-bundle
branch
from
July 3, 2026 18:52
9330b37 to
7c537df
Compare
ScriptedAlchemy
force-pushed
the
feat/adoption-contract-injection
branch
from
July 3, 2026 18:53
692be89 to
1bd9587
Compare
ScriptedAlchemy
force-pushed
the
feat/claude-plugin-bundle
branch
from
July 3, 2026 19:17
7c537df to
893d00d
Compare
The full using-tracedecay bootstrap (the `<EXTREMELY_IMPORTANT>` mandate) was injected on Cursor and Codex session start but never on Claude or Kiro, so two hosts shipped the skill without ever delivering the mandate. - steering: expose `append_tracedecay_bootstrap_context` as `pub(super)` so sibling hook modules can inject the same contract. - claude: `claude_session_context_for_event` now appends the bootstrap contract after the index status line on initialized projects, matching Cursor/Codex. Delivered via the SessionStart additionalContext channel. - kiro: rewrite the static steering body from "Prefer tracedecay" preference language to a compact mandate (moment->action + red-flag tables), keeping the CLI-fallback block, the delegate guardrail, and the issue-report line. `PROMPT_MARKER` updated in lockstep to the new heading so install / uninstall / strip / doctor still anchor on the managed block. - skill: add a SUBAGENT-STOP guard and instruction-priority ladder to the shared using-tracedecay SKILL.md (cursor + codex copies kept byte- identical) so scoped subagents skip re-discovery and the mandate defers to explicit user instructions and CLAUDE.md / AGENTS.md. - tests: assert Claude SessionStart injects the bootstrap when initialized and omits it for unindexed workspaces; update Kiro marker assertions and the prompt-rules parity marker to the new Kiro heading. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rebasing feat/adoption-contract-injection onto the claude-plugin bundle surfaced two byte-identity/build gaps in the bundle base: - claude-plugin/skills/using-tracedecay/SKILL.md lacked the adoption "## Scope and priority" section (SUBAGENT-STOP guard + user-instruction priority ladder) that the codex/cursor copies carry. Copied the section in so all three using-tracedecay/SKILL.md copies are byte-identical, as the cross-surface byte-identity tests (claude_bundle_skills_stay_byte_ identical_to_the_codex_source, plugin_bundle_sync) require. - claude-plugin/.mcp.json was referenced by src/agents/claude.rs via include_str! but never committed: .gitignore ignores `.mcp.json` and only negated codex-plugin/.mcp.json. The lib failed to build. Added the file (byte-identical to codex-plugin/.mcp.json: stdio serve + global-DB env) and a matching `!claude-plugin/.mcp.json` gitignore negation so it is tracked. Satisfies claude_bundle_mcp_config_declares_the_tracedecay_server. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy
force-pushed
the
feat/adoption-contract-injection
branch
from
July 3, 2026 19:21
1bd9587 to
9890962
Compare
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.
Stacked on #248 (base:
feat/claude-plugin-bundle).What
Makes all hosts inject tracedecay's session-start adoption contract. Today only Cursor and Codex inject the full
using-tracedecayskill (wrapped in<EXTREMELY_IMPORTANT>); Claude emitted only a one-line index-status string and Kiro used "Prefer" preference language — so the plugin shipped the skill but two hosts never delivered the mandate.Changes
src/hooks/claude.rs):claude_session_context_for_eventnow callsappend_tracedecay_bootstrap_contexton the initialized arm, injecting the full contract via the existing SessionStartadditionalContextchannel (index-status line retained).src/agents/kiro.rs): rewrote the steering body from## Prefer tracedecay MCP toolspreference prose to a compact mandate (moment→action + red-flags tables), keeping the CLI-fallback + delegate-guardrail blocks;PROMPT_MARKERupdated in lockstep (install/uninstall/strip/doctor all key off the constant).append_tracedecay_bootstrap_context→pub(super)so sibling hook modules can inject it.using-tracedecayskill, all 3 surfaces byte-identical): added a## Scope and prioritysection with a subagent-skip guard (scoped subagents with explicit files don't re-run discovery) and a user-instruction priority ladder (defers to CLAUDE.md/AGENTS.md above the mandate) so it doesn't fight the host prompt or waste subagent tokens.Tests
hooks_lsp_suite: 112 pass, incl. newtest_claude_session_context_injects_bootstrap_when_initialized/_omits_bootstrap_for_unindexed_project.agent_suite: kiro marker/idempotency, prompt-rules parity (new KIRO_MARKER), skill_lint {claude,cursor}, plugin_skill_contract byte-copies, plugin_bundle_sync — all pass; using-tracedecay byte-identical across claude/codex/cursor (single hash).🤖 Generated with Claude Code