Skip to content

feat: PDS v5.0.0 — observability, hook exploitation, instinct activation#99

Merged
rmzi merged 5 commits intomainfrom
real_source_review
Mar 31, 2026
Merged

feat: PDS v5.0.0 — observability, hook exploitation, instinct activation#99
rmzi merged 5 commits intomainfrom
real_source_review

Conversation

@rmzi
Copy link
Copy Markdown
Owner

@rmzi rmzi commented Mar 31, 2026

Summary

  • Claude Code source analysis — 692-line architecture deep dive (docs/claude-code-source-analysis.md). Covers system prompt pipeline, agentic loop, 28 hook events, LLM coupling, 30+ feature flags, cost model. Dated March 2026 snapshot.
  • Observability infrastructure — Opt-in telemetry via PDS_TELEMETRY=1. Logs skill invocations, agent spawns, file modifications, worktree events to .claude/telemetry.jsonl. New /pds:telemetry skill (on/off/view/rotate). New /pds:inspect skill for real-time PDS state.
  • Hook exploitation — 12 hook events (was 6). New: PostToolUse (telemetry + file tracking), SubagentStart (roster enforcement), PreCompact/PostCompact (context preservation), UserPromptSubmit (skill discovery). WorktreeCreate/InstructionsLoaded consolidated to JSONL.
  • Instinct activationscripts/detect-patterns.sh auto-detects instinct-worthy patterns from telemetry. Scout agent updated to consume telemetry in Phase 6 with Usage and Telemetry-Detected Patterns sections.
  • Status linehooks/scripts/status-line.sh shows PDS version, swarm phase/tier, telemetry status.
  • Documentation — Extension point catalog, whitepaper Observability section, updated README/CLAUDE.md/skills.md with 20 skills.

Files Changed (23 files, ~1,600 lines added)

New files (15):

  • docs/claude-code-source-analysis.md — Architecture analysis
  • docs/claude-code-extension-catalog.md — Hook/settings reference
  • hooks/scripts/telemetry-log.sh — Skill/Agent telemetry
  • hooks/scripts/file-telemetry-log.sh — Write/Edit tracking
  • hooks/scripts/roster-check.sh — Agent roster enforcement
  • hooks/scripts/pre-compact-snapshot.sh — PreCompact state snapshot
  • hooks/scripts/post-compact-inject.sh — PostCompact state injection
  • hooks/scripts/skill-hint.sh — Prompt-based skill suggestions
  • hooks/scripts/status-line.sh — CLI status line
  • scripts/telemetry-summary.sh — Usage report generator
  • scripts/detect-patterns.sh — Auto-instinct pattern detection
  • skills/telemetry/SKILL.md + EVAL.md — Telemetry skill
  • skills/inspect/SKILL.md + EVAL.md — Inspect skill

Modified files (8):

  • hooks/hooks.json — 12 events (was 7)
  • agents/scout.md — Telemetry analysis in Phase 6
  • skills/swarm/SKILL.md — Phase 6 telemetry mention
  • docs/whitepaper.md — Observability section
  • docs/skills.md — New skill entries
  • CLAUDE.md — 20 skills, expanded hooks
  • README.md — 20 skills, new docs, updated structure
  • .gitignore — Telemetry file, swarm artifacts

Issues Addressed

#82, #83, #84, #85, #86, #87, #88, #89, #90, #91, #92, #93, #95, #96, #97

Still Needed (follow-up)

Test Plan

  • Set PDS_TELEMETRY=1, run a skill, verify .claude/telemetry.jsonl has an entry
  • Run /pds:telemetry view — verify report output
  • Run /pds:inspect during swarm — verify phase/tier shown
  • Verify hooks/hooks.json is valid JSON
  • Verify all 20 skills have SKILL.md files
  • Verify SubagentStart hook warns on unknown agent type

Generated with PDS

rmzi and others added 5 commits March 31, 2026 19:43
…ling

Reverse-engineered analysis of Claude Code CLI internals from March 2026
source. Covers: system prompt pipeline (5-stage assembly), agentic loop,
28 hook events (PDS uses 6), plugin/settings hierarchy, LLM coupling
(zero abstraction — deeply Anthropic), 30+ feature flags, and cost model.

Establishes the knowledge base for PDS v5.0.0 observability and hook
exploitation work (#82-#98).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
-#98)

PDS v5.0.0 foundational work — 12 hook events (was 6), 20 skills (was 18),
opt-in telemetry, status line, and auto-instinct detection.

New hooks: PostToolUse (telemetry + file tracking), SubagentStart (roster
enforcement), PreCompact/PostCompact (context preservation),
UserPromptSubmit (skill discovery). WorktreeCreate/InstructionsLoaded
consolidated to JSONL telemetry format.

New skills: /pds:telemetry (on/off/view/rotate), /pds:inspect (real-time
PDS state). New scripts: telemetry-summary.sh, detect-patterns.sh.

Scout agent updated with telemetry analysis in Phase 6. Swarm skill
updated with telemetry-detected patterns. Whitepaper updated with
Observability section. Extension catalog added to docs/.

All telemetry is opt-in (PDS_TELEMETRY=1), disabled by default.
Zero PII in any telemetry data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, hook fixes

- install.sh: add jq preflight check, telemetry opt-in prompt, statusLine
  managed key, update version string to v5
- agents/scout.md: add Edit tool, Usage and Telemetry-Detected Patterns
  output sections, step 7a for detect-patterns integration
- skills/swarm/SKILL.md: add telemetry analysis step to Phase 6,
  update scout prompt, renumber steps
- hooks/hooks.json: fix WorktreeCreate to produce stdout (was blocking
  agent spawns with "no successful output")
- scripts/telemetry-summary.sh: fix file modification field (.name → .ext)
- docs/whitepaper.md: add Telemetry, Context Preservation, Auto-Instinct
  glossary terms
- CLAUDE.md: add WorktreeCreate, InstructionsLoaded to hooks list

Refs #82, #84, #85, #86, #87, #88, #89, #90, #91, #92, #93

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmzi rmzi force-pushed the real_source_review branch from 418606d to a586caa Compare March 31, 2026 23:54
@rmzi rmzi merged commit eb9a0d2 into main Mar 31, 2026
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.

1 participant