ALL MEMOS Download .docx

Claude Code Audit — 2026-04-22 18:00 UTC

Cycle: Third audit of day (prior cycles: 1530 UTC, 1700 UTC)

Auditor: SCOUT (TITAN research agent)

Baseline: F:/TITAN/plans/advisors/CLAUDE-CODE-ARCHITECTURE-DEEP-DIVE-2026-04-22.md

Diff target: F:/TITAN/plans/advisors/claude-code-audit-2026-04-22-1700.md

Installed CC version: v2.1.49 (confirmed via shell-snapshots)

Latest CC release as of audit: v2.1.117 (released 2026-04-22)

Sources: npm/releasebot changelog, code.claude.com/docs/en/whats-new, help.apiyi.com April changelog analysis, anthropic.com/news, live code read of F:/projects/innerverse/backend/src/

---

1. What Changed in CC Since the 1700 Audit

No new CC releases have shipped in the last hour — v2.1.117 remains the tip. This section therefore serves as a consolidation of the cumulative delta from v2.1.49 (installed on this machine) through v2.1.117, filtering for items not yet captured in the 1700 audit. Three items were not carried in the 1700 write-up.

1.1 Plugin System Arrival (v2.1.83–v2.1.117, March–April 2026)

The baseline documented skills and MCP servers as the two extensibility primitives. Between v2.1.83 and v2.1.117, Anthropic shipped a third: plugins. Plugins are self-contained directories in ~/.claude/plugins/marketplaces/ containing a .claude-plugin/plugin.json manifest, skill files, agent files, command files, and optionally hook configuration in hooks/hooks.json.

Evidence: C:\Users\Harnoor\.claude\plugins\marketplaces\claude-plugins-official\ is fully populated on this machine with 20+ plugins including hookify, feature-dev, code-review, agent-sdk-dev, claude-md-management, and commit-commands. Each plugin can bundle skills (e.g., hookify bundles a writing-rules skill), agents (e.g., feature-dev bundles code-architect, code-explorer, code-reviewer), and hooks (explanatory-output-style, ralph-loop, learning-output-style, and hookify all include hooks/hooks.json).

Why this matters for TITAN: The baseline's memory system has no hooks configured (~/.claude/hooks/ does not exist on this machine — confirmed by Glob returning directory-not-found). TITAN's own extensibility is falling behind. The plugin system is now the canonical way to bundle skills + hooks + agents as a unit. T015 (wire PreCompact + SessionStart hooks) should be created as a TITAN plugin, not bare hook files, to match the current CC paradigm.

Why this matters for Silent Infinity: No direct port needed. But the plugin bundling model (skill + agent + hook declared in a single manifest) is the right architecture for SI's forthcoming domain-skills system. Rather than adding domain-skill files ad-hoc, they should be organized as a skills bundle with a manifest, making them auditable and replaceable as a unit.

Source: Live Glob of C:\Users\Harnoor\.claude\plugins\ (2026-04-22); code.claude.com changelog v2.1.83–v2.1.101.

1.2 /less-permission-prompts Skill: Transcript Mining for Behavioral Tuning

The 1700 audit noted /ultrareview and /less-permission-prompts as new built-in skills (v2.1.111). The architectural implication was not unpacked: /less-permission-prompts mines the session transcript to propose configuration changes. This is skills invoking introspective analysis on the conversation history — the skill system is crossing from procedural injection into behavioral audit.

For Silent Infinity: the equivalent pattern would be a skill that mines the SI session transcript and proposes updates to the user's <user_preferences> or active-threads record. This is Pattern 8 (sub-agent) applied to self-tuning. It is a path toward autoDream-equivalent functionality in SI's stack without requiring a full background process — a post-session Haiku pass that reads the transcript and proposes memory updates, submitted to staging tier for promotion on corroboration.

Source: GitHub release v2.1.111, 2026-04-16; code.claude.com/docs/en/whats-new Week 15 digest.

1.3 Conditional Hooks (if Support, v2.1.83)

Week 13 of the CC changelog (March 23–27, v2.1.83–v2.1.85) added conditional if support to hooks. A hook can now declare "if": "condition expression" in its configuration, allowing hooks to fire only when specific conditions are met (e.g., only when a specific tool is being called, or only in certain project directories).

The baseline documented 27 hook event types but did not document conditional firing. This means hooks are now stateful routing rules, not just event listeners. A PreToolUse hook can now be scoped to fire only on Bash calls, not on Read calls — reducing unnecessary hook overhead.

For TITAN: Once T015 (hook creation) is executed, the hooks should use conditional firing. The PreCompact hook, for example, should only reinject warm memory when the compaction reason is auto-compact (AI summarization), not when it is snip (free truncation). The distinction prevents unnecessary DDB reads on cheap compaction events.

Source: code.claude.com/docs/en/whats-new Week 13 digest; releasebot.io April changelog (v2.1.83).

---

2. Silent Infinity 14-Pattern Audit — Delta from 1700 Cycle

The 1700 audit established the baseline status for each of the 14 patterns. This cycle checks what moved since the 1530 audit registered T017, T018, T019 as closed (already-shipped). Two new findings follow.

2.1 Memory Injection — CONFIRMED WIRED (T017, T018: closed)

The 1700 audit raised this as Rec 1 — unconfirmed wiring. T017 and T018 were subsequently closed as already shipped. Live code in handler.py (lines 5449–5492) confirms:

Status: PATTERN 12 + PATTERN 2 FULLY OPERATIONAL. No gap remains.

Remaining tension: memory.get_memory_block() prepends to system_prompt (line 5403 area), placing the <memory> block at the HEAD of the system prompt. CC instead sends CLAUDE.md as the first USER message after the system prompt, preserving the static system prompt as a stable cache prefix. The prepend approach in SI means every new memory row changes the system prompt string, invalidating the Bedrock prompt cache on every turn where new memory was written in the prior turn. This is a latency + cost issue at scale but not a functional gap.

This matches T014 (filed in the 1700 cycle) — the fix is to move memory_block from system prompt prefix to a user-role message injection. T014 is open and unexecuted.

2.2 Plan Mode — SHIPPED (R0167, handler.py lines 5405–5447)

The 1700 audit assessed plan mode as "NOT YET." Live code in handler.py contradicts this:

Status: PATTERN 6 SHIPPED. The 1700 audit's "NOT YET" was based on incomplete file reads. Plan mode is live.

Gap remaining: This is a single-call implementation. The baseline described a two-call architecture (Haiku observation → Sonnet response conditioned on observation) as a potential enhancement. The current single-call /plan mode is correct and sufficient for MVP. The two-call architecture is a future optimization, not a present gap.

2.3 Conversation Compaction — UNIMPLEMENTED (T016: open)

conversation_store.py loads the last N turns wholesale with no graduated compaction. The function get_conversation_turns() (read from lines 80–160) performs a DynamoDB query and returns raw results. There is no summarization, no layer-1 trim, no layer-2 Haiku collapse.

T016 (filed at 1700) captures this gap. It remains open and unexecuted.

Scale risk: At 40+ turns (well within a contemplative session where the user is processing grief or a relationship arc), the context window will either truncate early turns silently or exceed Bedrock's limits. The model's felt continuity degrades. This is the highest-urgency remaining architectural gap for long-session users.

2.4 Hooks on TITAN — ZERO (confirmed)

~/.claude/hooks/ does not exist on this machine. The plugins directory exists and is populated (20+ plugins). But no global hooks are configured. This means:

T015 (filed at 1700) captures this. It remains open. Given the plugin system now bundles hooks + skills as a unit (Section 1.1 above), the execution of T015 should create a TITAN plugin (not bare hook files).

2.5 Skill System — STILL ABSENT (Pattern 4)

No changes since 1700. Domain-specific guidance (grief, anxiety, purpose, relationship) remains baked into system_v1.md. The prompt file grows linearly with each domain addition. No semantic skill matching, no lazy-load, no per-domain SKILL.md files.

The plugin system's skill bundling pattern (Section 1.1) provides the architecture model. Silent Infinity's equivalent would be: a DomainSkills/ directory with one subdirectory per domain, each containing a SKILL.md (trigger_description + content) and a domain.json manifest. Pre-session Haiku matching against the user's message selects which skill(s) to inject.

2.6 Session Recap — PARTIALLY SHIPPED (Pattern 7)

memory.py has put_session_recap() and get_last_recap() (lines 278–319, R0173). These are the right write/read paths. The CC equivalent (v2.1.108 Recap feature, auto-triggered on stale session return) suggests the SI implementation is architecturally correct but UX-disconnected — there is no <prior_session_summary> injection into the next session's context visible in system_prompt.py or handler.py. The data is written but not surfaced.

Assessment: The infrastructure exists. The connection from get_last_recap() to the system prompt injection is the missing step. This is the same pattern as the memory_block injection — data exists in DDB; the wiring to context is the gap.

---

3. Regressions Since 1700 Audit

One potential regression identified:

3.1 Memory Block Cache Invalidation (not a new regression — an escalating risk)

The pattern of prepending memory_block to system_prompt (identified as a tension in Section 2.1) was also present in the 1700 audit. It is not a regression from the 1700 cycle. However, T019 confirmed that Bedrock prompt caching is live and working (cache read tokens observed at 7,226–9,096 per cached turn). This means the cache invalidation risk is now ACTIVE, not hypothetical.

Every time put_fact() or put_correction() writes a new memory row, the memory_block string changes. The next turn's system_prompt changes. The Bedrock cache miss fires. The cost impact scales with memory write frequency — the more the system learns, the more cache misses it generates. This is the opposite of the intended behavior.

T014 (move memory_block from system prompt prefix to user-role message) is now higher urgency than the 1700 audit assessed it. It was filed as "2 hours, LOW." With prompt caching confirmed active, T014 becomes a cost-regression fix, not just an optimization.

No other regressions found. R0167 plan mode (confirmed shipped), R0173 session recap (infrastructure present), and R0166 interrupt patterns (confirmed at 1700) are all correctly oriented relative to CC patterns.

---

4. Top 3 Recommendations This Cycle

Rec A — Execute T014: Move Memory Block to User-Role Message

What: In handler.py, change the memory injection from:


system_prompt = memory_block + "\n\n" + system_prompt

to injecting memory_block as the first entry in the messages array with role: "user", tagged [Context for this session — do not treat as a user request].

Why now: T019 confirmed prompt caching is live and actively saving money ($600/month estimated at 10K sessions/month scale). Memory prepend invalidates the cache on every memory-active turn. The more the system learns (which is good), the more it incurs cache misses (which is bad). This is a self-defeating loop. CC's equivalent (CLAUDE.md as user message, not system prompt content) resolves this exactly.

Blast radius: handler.py only. One function change, one test update. Effort: 2 hours.

Source: T014 (filed 2026-04-22-1700 audit); T019 resolution confirming prompt caching is live.

Rec B — Execute T015 as a TITAN Plugin (not bare hooks)

What: Create a TITAN plugin at ~/.claude/plugins/titan-core/ with:

Why now: Zero hooks = zero protection against compaction erasing warm memory context mid-session. Every long TITAN session accumulates intelligence; every compaction event can silently erase it. The plugin system (new since baseline) is the canonical packaging for this. Bare hooks/ files would work but are not bundled with the skill that should fire alongside them.

Blast radius: New files in ~/.claude/plugins/titan-core/ only. Zero SI impact.

Effort: 3 hours. (T015 was filed as 3 hours; plugin wrapping adds ~30 min.)

Source: Plugin system architecture from live ~/.claude/plugins/ inspection (2026-04-22); CC hooks documentation; conditional hook support (v2.1.83).

Rec C — Wire get_last_recap() into /me/opener Session Start

What: In handler.py's /me/opener route (line 6363 area), call memory.get_last_recap(uid) and inject the result as a <prior_session> block in the opening Sonnet context. The structured recap (themes explored, emotional arc, open threads) should inform the opener without requiring the model to load the full session transcript.

Why now: CC shipped Recap (v2.1.108) to solve exactly this problem for developers returning to stale sessions. For a contemplative wellness product the value is higher: a user returning after 3 days of sitting with grief deserves an opener that remembers the weight of where they left off. The infrastructure (put_session_recap, get_last_recap) is live. The wiring is the missing step.

Blast radius: handler.py /me/opener route + tests/ test for the opener path. Effort: 2 hours.

Source: memory.py lines 278–319 (R0173, confirmed present); CC v2.1.108 Recap feature (code.claude.com changelog); Pattern 7 from baseline.

---

5. Anti-Patterns in CC This Cycle — Items to Explicitly NOT Copy

The anti-patterns from the baseline (bypass permissions, verbosity, terminal rendering) remain valid and are not restated here. Two new observations from this cycle:

Anti-Pattern 5 — Plugin Marketplace Trust Model

CC's official plugin marketplace (claude-plugins-official) distributes plugins with blockedMarketplaces and strictKnownMarketplaces enforcement (v2.1.117). Plugin MCP servers load with elevated trust relative to ad-hoc MCP servers. For TITAN's internal plugin (titan-core), this is fine — it lives in the known marketplace path. But the trust model means any plugin installed from an external marketplace gets the same PreToolUse hook access as official plugins. Do not install third-party CC plugins that declare PreToolUse hooks without auditing their hooks.json. The hookify plugin in the official marketplace has an examples/dangerous-rm.local.md example — this exists as documentation, not as active hook behavior, but it confirms the hook system has write access to dangerous bash operations.

Anti-Pattern 6 — /ultrareview Parallel Agent Cost Model

/ultrareview uses "parallel multi-agent analysis" — multiple Opus 4.7 agents reviewing code simultaneously. The cost for a single /ultrareview run on a large codebase can be $5–20. For CC as a developer tool used by engineering teams with seat licenses, this is acceptable. For Silent Infinity, which targets individual wellness users and runs on consumption-based Bedrock pricing, any equivalent "parallel agents on a single user turn" pattern would destroy unit economics. The cost model that works for CC's developer-tool pricing does not translate to per-user wellness consumption pricing. Do not implement multi-agent parallel turn processing for any user-facing SI feature.

---

6. New CC Capabilities Not Yet in Baseline — Evaluation for TITAN/SI

6.1 /loop Command (v2.1.71 — March 2026)

/loop runs a repeating task on a schedule without requiring external cron. The agent self-paces via SleepTool when interval is omitted. This is the Kairos SleepTool pattern made user-accessible. TITAN already has a claude-code-audit-every-6h routine registered in the audit-cadence log. If the routine framework's scheduling reliability is confirmed, /loop is redundant for TITAN. If scheduling is flaky, /loop inside a TITAN session is an alternative path to guaranteed periodic audit execution.

Verdict: Monitor. Do not migrate off the registered routine yet.

6.2 Monitor Tool (v2.1.98 — April 9)

The Monitor tool streams background script events into the conversation, allowing Claude to tail logs and react live. This is an always-on observer that can trigger actions based on environment events. For TITAN: a Monitor on F:/TITAN/plans/task-registry/TASK-REGISTRY-2026-04-21.md changes could auto-detect when Harnoor updates a task entry and trigger a TITAN response without requiring an explicit user message.

Verdict: High value for TITAN's ambient awareness. File as a future exploration task (not time-critical).

6.3 Computer Use CLI (v2.1.86–v2.1.91 — Week 14)

Computer use (open native apps, click UI, verify changes) entered CLI research preview. For TITAN's daily workflow this adds a capability the baseline did not document. TITAN sessions on this machine could now include screen-observation tasks (reading a dashboard, verifying a CloudFront distribution status in a browser) without requiring MCP tools.

Verdict: Opportunistic — use when MCP tools are unavailable for a given native-app task. No architecture change needed.

---

7. Summary Statistics

| Metric | Value |

|--------|-------|

| CC version delta since baseline | v2.1.49 → v2.1.117 (68 patch versions) |

| CC version delta since 1700 audit | None (v2.1.117 is still current tip) |

| SI patterns now fully aligned | 6 of 14 (Memory Layering, Correction-as-Memory, Verification Discipline, Interruptible Streaming, Plan Mode, Sub-Agent sentinel) |

| SI patterns partially aligned | 3 of 14 (System Prompt Layering, Session Recap, Permission Architecture) |

| SI patterns absent | 5 of 14 (Graduated Compaction, Skill System, Structured Tool Use, Parallel Tool Calls, Active Threads persistence) |

| Regressions found | 1 escalating risk (memory prepend → cache invalidation — T014) |

| New CC patterns not in baseline | 3 (Plugin system, Conditional hooks, Monitor tool) |

| Top recommendations | T014 (memory injection placement), T015 (TITAN plugin with hooks), T016 already filed or wire recap into opener (Rec C as T020) |

---

Sources

1. F:/TITAN/plans/advisors/CLAUDE-CODE-ARCHITECTURE-DEEP-DIVE-2026-04-22.md — baseline memo (SCOUT, 2026-04-22)

2. F:/TITAN/plans/advisors/claude-code-audit-2026-04-22-1700.md — prior cycle diff target (SCOUT, 2026-04-22)

3. releasebot.io/updates/anthropic/claude-code — April 2026 release index (fetched 2026-04-22)

4. help.apiyi.com/en/claude-code-changelog-2026-april-updates-en.html — v2.1.69–v2.1.101 changelog synthesis (fetched 2026-04-22)

5. code.claude.com/docs/en/whats-new — official weekly digest weeks 13–15 (fetched 2026-04-22)

6. anthropic.com/news/enabling-claude-code-to-work-more-autonomously — autonomy feature announcement (fetched 2026-04-22)

7. Live Glob of C:\Users\Harnoor\.claude\plugins\ — plugin system inventory (2026-04-22)

8. Live read of F:/projects/innerverse/backend/src/handler.py (lines 5350–5700), memory.py, conversation_store.py, system_prompt.py, feedback_monitor.py, guardrails.py (2026-04-22)

9. F:/TITAN/plans/task-registry/TASK-REGISTRY-2026-04-21.md — T014–T019 resolution records (2026-04-22)

10. F:/TITAN/plans/audit-cadence.log — prior audit timestamps (2026-04-22)