Shows the session id and cost estimate in a band above the prompt

Version-controlled global guidance and reusable custom skills for Codex and Claude Code on Windows. This repository is the reviewed source of truth; the tools' live configuration directories are deployment targets.
AGENTS.md with the root CLAUDE.md import — repository development and full-delivery policy shared by Codex and Claude Code.global/shared.md with Codex and Claude overlays — canonical personal guidance composed into each target's installed instruction file.skills/claude-runner — resume-safe Codex wrapper for Claude Code CLI.skills/cross-agent-review — opposite-engine adversarial review with triage, credited fix commits, and bounded rounds, shared by Codex and Claude Code.skills/deep-research — Codex-specific, evidence-driven research with independent source collection, contradiction checks, and citation auditing.skills/dyslexia-friendly-formatter — format text for dyslexia-friendly reading without changing its content.skills/execute-campaign-work-item — scoped execution and evidence-backed handoff for one controller-assigned campaign work item, shared by Codex and Claude Code.skills/lavish — pinned, loopback-only HTML artifact review with annotations and guarded publishing, setup, and update operations for Codex.skills/managed-jobs — durable supervision for long-running local processes, shared by Codex and Claude Code.skills/orchestrate-work-campaigns — visible, coordinator-only control of multi-task delivery campaigns, shared by Codex and Claude Code.skills/shape-product-decisions — evidence-labeled product shaping from an ambiguous request to a concrete decision and implementation handoff, shared by Codex and Claude Code.skills/shared-term — a focused collaborative Windows Terminal workflow, shared by Codex and Claude Code.skills/teams-graph-connector — shared Teams reading, history coverage, and send-confirmation guidance, with separate Codex Teams app and Claude Microsoft 365 (Graph) MCP connector customizations.skills/ux-review — Codex-specific browser walkthroughs with evidence-backed, acceptance-testable UX findings.plugins/claude/session-cost — Claude Code plugin that shows the app and transcript session IDs, with copy buttons, and the session cost estimate in a band above the prompt.hooks/codex — Codex-specific managed-job lifecycle cleanup scripts.hooks/claude — Claude Code-specific managed-job lifecycle cleanup scripts.config/manifest.json — the exact files, plugins, and hook registrations managed for each supported agent.docs/customization-ownership.md — classification, admission, ownership, precedence, and authoring rules for proposed customizations.docs/deployment.md — validation, drift inspection, explicit activation, backups, hook application, and deployment scope.docs/maintaining-customizations.md — maintenance rules for agent instructions, skill entrypoints, references, and progressive-disclosure validation.scripts/verify.ps1 — validates structure and scans managed sources for common publication hazards.scripts/evaluate-instructions.ps1 — runs input-only scenarios in fresh, read-only Codex or Claude sessions and scores their structured behavior against separately stored expectations; -Suite skill-routing scores which skill each request would load.scripts/evaluate-instruction-actions.ps1 — exercises a bounded tool protocol in disposable repositories and scores file effects and call order.scripts/status.ps1 — reports drift between this repository and live agent installations.scripts/install.ps1 — explicitly deploys reviewed sources to one or both live installations.scripts/test.ps1 — exercises verification, sandbox installations, clean status, target isolation, and drift detection.tests — repository-local regressions plus separately stored behavioral evaluation prompts, expectations, and response contracts; none are installed into agent homes.Claude Code loads personal instructions from ~/.claude/CLAUDE.md and personal skills from ~/.claude/skills. Codex uses ~/.codex/AGENTS.md and ~/.codex/skills. The manifest composes global/shared.md with the applicable target overlay during installation, reuses portable skills where possible, and keeps tool-specific skills on their compatible target. For Codex it also deploys global/codex-model-instructions.md, a reviewed replacement for the built-in model instructions that config.toml must reference (see deployment).
Symlinks and junctions are not the default because switching branches or editing a worktree could otherwise change global agent behavior immediately. The install step creates a deliberate boundary between reviewing a change and activating it.
An explicit request to implement a repository change defaults to the complete branch-to-PR delivery workflow in AGENTS.md: validate, commit, push, open an agent-authored draft PR, obtain opposite-agent cross-review, triage findings, and mark the PR ready. Current-head owner approval then governs a guarded merge or auto-merge after required checks pass.
Validate the repository:
pwsh ./scripts/verify.ps1
Run the deployment smoke test:
pwsh ./scripts/test.ps1
Run live behavioral instruction evaluations (these invoke the selected agent CLI and may incur usage):
pwsh ./scripts/evaluate-instructions.ps1 -Target all
Run the live skill-routing suite after adding a skill or changing a skill description, once per Claude model expected to load the skill:
pwsh ./scripts/evaluate-instructions.ps1 -Suite skill-routing -Target claude -ClaudeModel haiku
Run the small live action suite for a consequential instruction change:
pwsh ./scripts/evaluate-instruction-actions.ps1 -Target all
Both live suites consume CLI usage and should run under managed-jobs when launched by an agent. The action suite uses a controlled JSON tool protocol: requests execute real bounded file edits and local checks; publication always returns unavailable without contacting a remote. User messages are injected between tool requests to test authorization and stop boundaries. It retains traces and disposable repositories at its printed artifact path. It does not test native CLI tool integration or real-time interruption of an in-flight tool. The deterministic dispatcher/scorer tests run in test.ps1 without paid agents. On Windows the Codex action client selects the documented elevated sandbox; prepare that sandbox before running the suite. It does not fall back to full access. Failed behavior checks remain failures with traces; do not weaken their expectations just because the agent answered classification cases correctly.
Compare both live installations:
pwsh ./scripts/status.ps1
Deployment to live agent homes is a separate, explicitly authorized activation step. Do not run scripts/install.ps1 for validation or status inspection. See the deployment guide for previews, target selection, activation, backups, and post-install hook requirements.
The manifest defines the reviewed instructions, skills, hook scripts, and hook registrations managed for each target. Unrelated machine-local settings and runtime state remain outside the repository. See the deployment scope for the complete boundary.
Before adding guidance, use the customization ownership and skill-admission policy to decide whether it belongs in global guidance, a portable skill, a repository-local contract, or private/local material. In particular, generic skills may coordinate repeated workflows and discover target policy, but must not carry repository merge rules or private and machine-specific state.
MIT
Individual skill directories may include notices for adapted third-party material.
hooks/register.tsx 60 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4const usd = atom({ plugin: 'session-cost', key: 'usd' } as const, null)
5const hostId = atom({ plugin: 'session-cost', key: 'hostId' } as const, null)
6
7const formatCost = (value: number) => `≈ $${value < 0.01 ? '<0.01' : value.toFixed(2)}`
8
9export const register: Register = on => {
10 on('session.start', async ($, e, next) => {
11 const result = await next(e)
12 const { cost } = await $.session.usage()
13 await update($, usd, () => cost?.usd ?? null)
14
15 // The desktop app's own session id (what its session tools take) is only exposed as an env var of the engine process.
16 const { stdout } = await $.process.run(['cmd.exe', '/d', '/c', 'echo %CLAUDE_CODE_HOST_SESSION_ID%'])
17 const value = stdout.trim()
18 await update($, hostId, () => (value && !value.startsWith('%') ? value : null))
19
20 return result
21 })
22
23 on('session.measure', async ($, e, next) => {
24 if (e.cost) {
25 const total = e.cost.usd
26 await update($, usd, () => total)
27 }
28
29 return next(e)
30 })
31
32 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
33 if (e.props.hasSurvey) {
34 return next(e)
35 }
36
37 const value = await read($, usd)
38 const appId = await read($, hostId)
39 const transcriptId = await $.session.id()
40 const label = [appId ?? `Session ${transcriptId}`, value === null ? null : formatCost(value)].filter(Boolean).join(' · ')
41 const { Box, Button, Text } = $.ui.resolve(e)
42
43 const copy = async (text: string, what: string) => {
44 const copied = await $.ui.copy({ text, surface: e.surface })
45
46 // Remote surfaces such as the desktop app may have no clipboard path yet; fall back to Windows clip.exe.
47 const isCopied = copied.isCopied || (await $.process.run(['clip.exe'], { stdin: text })).exitCode === 0
48 $.ui.toast(isCopied ? `${what} copied` : `Could not copy the ${what.toLowerCase()}`)
49 }
50
51 return (
52 <Box>
53 <Text dimColor>{label} </Text>
54 {appId === null ? null : <Button key="copy-app-id" label="Copy app ID" onPress={() => copy(appId, 'App session ID')} />}
55 <Button key="copy-id" label="Copy transcript ID" onPress={() => copy(transcriptId, 'Transcript ID')} />
56 </Box>
57 )
58 })
59}
60types/index.d.ts 9 lines1export type Usd = number | null
2export type HostId = string | null
3
4declare module 'claude-code' {
5 interface PluginState {
6 'session-cost': { usd: Usd; hostId: HostId }
7 }
8}
9