Skip to content

feat: adopt Claude Code v2.1.83 → v2.1.122 features#9

Merged
scotthavird merged 1 commit into
mainfrom
feat/recent-claude-code-features
Apr 29, 2026
Merged

feat: adopt Claude Code v2.1.83 → v2.1.122 features#9
scotthavird merged 1 commit into
mainfrom
feat/recent-claude-code-features

Conversation

@scotthavird

Copy link
Copy Markdown
Owner

Summary

Audits the Claude Code changelog from v2.1.83 to v2.1.122 and adopts every feature relevant to a starter template. New hook types, new plugin components (bin/, themes/), new settings, new MCP semantics, an effort-aware skill demo, an agent self-containment demo, and a CI alternative path via /ultrareview. All additive — no breaking changes for existing forks.

Closes #8

Changes

Hooks

  • scripts/hooks/pre-compact.sh (new) — PreCompact hook (v2.1.105+) saves a checkpoint to .claude/checkpoints/ before compaction.
  • scripts/hooks/redact-secrets.sh (new) — PostToolUse hook demonstrating v2.1.122 hookSpecificOutput.updatedToolOutput. Scrubs API keys, JWTs, AWS access keys, GitHub PATs, and Slack tokens.
  • scripts/hooks/session-cost.sh — now uses PostToolUse.duration_ms (v2.1.121) for a top-tools-by-time breakdown.
  • .claude/settings.json — wires the new hooks; adds conditional if field on block-dangerous-bash (v2.1.85).

MCP

  • .mcp.jsonalwaysLoad: true on filesystem and git (v2.1.122).

Plugin spec

  • .claude-plugin/plugin.json v0.3.0 — registers themes and bin components.
  • .claude/themes/anthropic-clay.json (new) — demo theme.
  • bin/claude-template-info (new) — demo executable that goes on the Bash tool's $PATH when the plugin is installed (v2.1.91+).

Skills

  • .claude/skills/effort-aware/SKILL.md (new) — demonstrates ${CLAUDE_EFFORT} interpolation (v2.1.120+).

Subagents

  • .claude/agents/dependency-auditor.md — frontmatter now declares mcpServers: and hooks: (v2.1.116/117) for self-contained agent invocations.

Settings

  • statusLine.refreshInterval: 5 (v2.1.97)
  • sandbox.network.deniedDomains for cloud-metadata IPs (v2.1.113)
  • prUrlTemplate for the footer PR badge (v2.1.119)

CI / scripts

  • scripts/ci-review.sh --ultrareview <target> — delegates to claude ultrareview (v2.1.120) for cloud-based parallel review.

settings.local.json.example

  • New env var blocks: ENABLE_PROMPT_CACHING_1H, CLAUDE_CODE_NO_FLICKER, CLAUDE_CODE_HIDE_CWD, CLAUDE_CODE_FORK_SUBAGENT, DISABLE_UPDATES, ANTHROPIC_BEDROCK_SERVICE_TIER.
  • Default model bumped to claude-opus-4-7.
  • Commented autoMode block showing the $defaults extension pattern.

Docs

  • docs/permission-modes.md — adds auto mode (v2.1.111+) and the PermissionDenied hook (v2.1.89+).
  • docs/hooks-cookbook.md — covers PreCompact, updatedToolOutput, conditional if, and mcp_tool hook type.
  • docs/plugins.mdbin/, themes/, monitors, claude plugin tag/prune.
  • docs/integrations.md/ultrareview and Routines.
  • CLAUDE.md and README.md — updated component counts and feature lists.

Housekeeping

  • .gitignore.claude/scheduled_tasks.lock, .claude/checkpoints/, .claude/*.lock.

Code Walkthrough

redact-secrets.sh — emit updatedToolOutput

redacted="$(printf '%s' "$output_text" | sed -E \
  -e 's/(ghp_[A-Za-z0-9]{36})/[REDACTED-github-pat]/g' \
  ...)"

if [ "$redacted" = "$output_text" ]; then exit 0; fi

jq -n --arg text "$redacted" '{
  hookSpecificOutput: { updatedToolOutput: $text }
}'

Hook prints JSON to stdout when (and only when) it has a redaction to apply. Claude Code reads stdout as a hook output object and substitutes tool_output with the redacted version before the model sees it. Fail-open on parse error: leaves output untouched.

pre-compact.sh — checkpoint before compaction

checkpoint=".claude/checkpoints/pre-compact-${ts}-${session_id:0:8}.md"
cat > "$checkpoint" <<EOF
# Pre-compact checkpoint
Session: $session_id
Branch: $branch
Last commit: $last_commit
EOF
exit 0

Permissive by default — always allows compaction to proceed. Customize the block-conditions to fit your team (e.g., block if there's an in-progress refactor with no tests yet).

Testing

  • jq . validates .mcp.json, .claude/settings.json, .claude-plugin/plugin.json, .claude/themes/anthropic-clay.json.
  • bash -n passes on all 7 hook scripts plus bin/claude-template-info and scripts/ci-review.sh.
  • Smoke-tested redact-secrets.sh with a synthetic payload containing a ghp_* token — produces the expected hookSpecificOutput.updatedToolOutput JSON.
  • Smoke-tested pre-compact.sh — writes the checkpoint file, exits 0.
  • Smoke-tested session-cost.sh — prints Session: 12 turns · 1m22s · $0.42.
  • Ran bin/claude-template-info — produces a one-page component summary.

Agent Review Context

  • change-type: feature
  • risk-level: low
  • key-files: .claude/settings.json, scripts/hooks/redact-secrets.sh, scripts/hooks/pre-compact.sh, .claude-plugin/plugin.json, .mcp.json
  • testing-confidence: high (validation + smoke tests on every new hook script)

Checklist

  • All JSON syntactically valid
  • All shell scripts pass bash -n
  • New hook scripts smoke-tested
  • No breaking changes for existing forks
  • Docs updated to match new behavior

🤖 Generated with Claude Code

Audits the changelog from v2.1.83 to v2.1.122 and pulls every feature
relevant to a starter template into this repo. All additive — no
breaking changes.

Hooks
- New PreCompact hook (v2.1.105+) saves a checkpoint to
  .claude/checkpoints/ before compaction drops context
- New redact-secrets PostToolUse hook demonstrates v2.1.122
  hookSpecificOutput.updatedToolOutput by scrubbing API keys, JWTs,
  PATs, and Slack tokens out of tool output before the model sees them
- session-cost.sh now reads per-tool duration_ms from PostToolUse
  logs (v2.1.121) and prints a top-tools-by-time breakdown
- docs/hooks-cookbook.md covers all new events plus the conditional
  `if` field (v2.1.85) and `mcp_tool` hook type (v2.1.118)

MCP
- .mcp.json declares alwaysLoad: true on filesystem and git so they
  skip tool-search deferral (v2.1.122)

Plugin spec
- Bumped plugin.json to v0.3.0
- Registers new components: themes (.claude/themes/) and bin (bin/)
- Ships .claude/themes/anthropic-clay.json as a demo theme
- Ships bin/claude-template-info as a demo executable; plugins now
  add bin/ to the Bash tool's $PATH (v2.1.91+)

Skills
- New effort-aware skill demonstrates ${CLAUDE_EFFORT} interpolation
  (v2.1.120+) — adapts guidance to current effort level

Subagents
- dependency-auditor frontmatter now declares mcpServers and hooks
  (v2.1.116/117) — agents are more self-contained when invoked via --agent

Settings
- statusLine.refreshInterval: 5 (v2.1.97)
- sandbox.network.deniedDomains for cloud-metadata IPs (v2.1.113)
- prUrlTemplate for footer PR badge (v2.1.119)
- Conditional `if` field on the block-dangerous-bash PreToolUse hook

CI / scripts
- scripts/ci-review.sh adds --ultrareview <target> mode that
  delegates to claude ultrareview (v2.1.120) for cloud-based parallel
  review

settings.local.json.example
- New env vars: ENABLE_PROMPT_CACHING_1H, CLAUDE_CODE_NO_FLICKER,
  CLAUDE_CODE_HIDE_CWD, CLAUDE_CODE_FORK_SUBAGENT, DISABLE_UPDATES,
  ANTHROPIC_BEDROCK_SERVICE_TIER
- Default model bumped to claude-opus-4-7
- autoMode block (commented) showing $defaults extension pattern

Docs
- docs/permission-modes.md adds the auto mode and PermissionDenied hook
- docs/plugins.md covers bin/, themes/, monitors, plugin tag/prune
- docs/integrations.md mentions /ultrareview and Routines
- CLAUDE.md and README.md updated to reflect new components

Housekeeping
- .gitignore now excludes .claude/scheduled_tasks.lock,
  .claude/checkpoints/, and .claude/*.lock

Refs #8
AI-Tool: claude-code
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scotthavird scotthavird merged commit fd61209 into main Apr 29, 2026
2 checks passed
@scotthavird scotthavird deleted the feat/recent-claude-code-features branch April 29, 2026 03:17
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.

Adopt Claude Code v2.1.83 → v2.1.122 features in the template

1 participant