// ai client LIVE

Claude Code

Primary client, deepest integration

Claude Code has the richest AgentOS integration: a three-layer config model (behavioural contract, memory, and commands), two auto-sync hooks that keep everything current without manual steps, a permission allowlist that eliminates most confirmation prompts, and a Haiku sub-agent delegation pattern that keeps main session token costs low.

03 config layers 14 shared commands 02 auto-sync hooks 18 permission rules
configuration_model [01]

Three Layers

Claude Code's configuration composes across three files in clients/claude/. Each file has a distinct role; keeping them separate makes each easier to maintain and reason about independently.

How to act
CLAUDE.md

Behavioral contract. Encodes output style (TL;DR first, bullets over paragraphs), language rules (no em dashes, no AI openers), assumed knowledge level, the VSCode extension deploy gate, and markdown formatting standards. Loaded unconditionally every session. Synced to ~/.claude/CLAUDE.md.

What to know
memory/

Persistent context. Four types: user (who Jason is), feedback (corrections and confirmed approaches), project (ongoing work, deadlines, decisions), reference (external system pointers). Indexed by MEMORY.md. Global memory is loaded every session; project memory is loaded per-workspace. Sourced from clients/shared/memory/.

What to do
commands/

Global slash commands available in any project via /jn-* prefix. Sourced from clients/shared/skills/. Cover the full post-build workflow: compile and deploy VSCode extensions, update changelogs and docs, run the full ship sequence, sync memory and config between sessions.

session_context [02]

How Claude Code Loads Context

Claude Code assembles context from several sources at session start. The global layer always loads; the project layer loads when Claude runs inside a project directory.

Global (every session, every project)
~/.claude/CLAUDE.md
Behavioral contract. Loaded unconditionally.
~/.claude/memory/MEMORY.md
Memory index. Always loaded; individual files loaded on demand from the index.
~/.claude/commands/*.md
Global slash commands. Available in any project session.
Project (when inside a project directory)
[project]/.claude/CLAUDE.md
Project-level instructions, merged on top of global. Sets project identity and MCP resource instructions.
~/.claude/projects/[sanitized]/memory/
Project memory. The sanitized path replaces : with - and /\ with -. For C:\Development\AI, this resolves to c--Development-AI.
sync [03]

sync.ps1 and Auto-Sync Hooks

The repo is the canonical source. sync.ps1 deploys to the runtime and cleans stale files. Two hooks in settings.json automate routine sync so manual intervention is rarely needed.

01
sync.ps1 push-runtime

Deploys CLAUDE.md, memory files (sourced from clients/shared/memory/), shared commands (sourced from clients/shared/skills/), and settings.json to ~/.claude/. Cleans stale files from prior runs. Safe to run repeatedly. This is the only command that writes to the runtime.

02
Stop Hook (auto-sync on session end)

Registered in settings.json. Runs sync.ps1 push-runtime every time Claude Code exits. Any in-session config changes (memory writes, command edits) are captured back into source control automatically. No manual sync needed during normal use.

03
PostToolUse Write Hook (real-time memory push)

Fires immediately when Claude writes any file inside ~/.claude/memory/ or ~/.claude/commands/. Runs push-runtime in-session, not waiting for the Stop hook. Memory writes are pushed to the repo in real time.

Command What it does
push-runtime Deploys canonical config to ~/.claude/. Cleans stale files first. Source of truth direction only.
pull-extracted Stages files from ~/.claude/memory/_extracted/ into memory/_extracted/ for review. Does not auto-commit.
clean-runtime Removes all managed files from ~/.claude/, then re-runs push-runtime. Handles orphan cleanup on restructures.
cost_optimisation [04]

Haiku Sub-Agent Delegation

Portfolio reads and orchestration commands use a lightweight sub-agent pattern. Instead of running portfolio reads in the main session context, each jn-read-* command spawns a dedicated Haiku sub-agent. The cheap model does the work; the main session stays focused and light.

Portfolio reads

Each jn-read-* command (identity, role, current-projects, etc.) spawns a Haiku sub-agent that reads the corresponding portfolio:// resource and returns the content synchronously to the main session. Token overhead shifted to Haiku rates.

Orchestration

Commands like jn-ext-deploy, jn-website-commit, and jn-git-commit delegate complex workflows to Haiku sub-agents. The sub-agent inherits project context (CLAUDE.md, MEMORY.md) automatically and runs without the full memory of the calling session.

The --auto flag lets orchestration commands skip confirmation gates when chained. jn-website-commit passes --auto to changelog, docs, git, and publish steps so the entire post-build workflow runs uninterrupted after one changelog approval.
friction_reduction [05]

Permission Allowlist

18 entries in settings.json permissions.allow auto-approve specific tool patterns across all sessions. These cover operations that are auditable and safe within the orchestration context.

Git write operations
git add *
git commit *
git push *
PowerShell cmdlets
Get-ChildItem, Get-Item, Test-Path, Get-Content
Set-Content, Out-File, Copy-Item, New-Item
ConvertFrom-Json, ConvertTo-Json, Invoke-WebRequest
file_mapping [06]

Canonical to Runtime

Repo path Deployed to Purpose
clients/claude/CLAUDE.md ~/.claude/CLAUDE.md Behavioral contract
clients/shared/memory/global.md ~/.claude/memory/global.md Identity and stack
clients/shared/memory/conventions.md ~/.claude/memory/conventions.md Technical conventions (Salesforce, git, code standards)
clients/shared/memory/projects/*.md ~/.claude/memory/projects/*.md Per-project context files
clients/shared/skills/*.md ~/.claude/commands/*.md 16 shared global slash commands
clients/claude/settings.json ~/.claude/settings.json Hooks and permission allowlists
shared_commands [07]

14 Commands via /jn-*

All sourced from clients/shared/skills/ and deployed to all three clients. Available in Claude Code as slash commands. Each is logged to the MCP server on invocation via the PreToolUse hook.

/jn-ext-compile

Compile VSCode extension TypeScript source

/jn-ext-package

Package extension to .vsix, auto-bumps version in package.json

/jn-ext-install

Install latest .vsix into VSCode via code.cmd

/jn-ext-deploy

Orchestrates compile → package → install as sub-commands

/jn-git-commit

Staged commit with confirmation gate (skipped with --auto)

/jn-git-push

Push to remote with confirmation gate (skipped with --auto)

/jn-read-context

Read portfolio resources from the MCP server

/jn-sync-claude

Run sync.ps1 push-runtime to deploy canonical config

/jn-sync-cursor

Run Cursor client sync.ps1 push-runtime

/jn-update-changelog

Draft and prepend a dated changelog entry with confirmation

/jn-update-docs

Identify and update affected .md files from git diff

/jn-website-content

Draft and write showcase site copy for current project

/jn-website-commit

Full post-build orchestrator: changelog → docs → site copy → commit → push

/jn-update-claude-stats-cache

Refresh cached analytics data for the dashboard