diagnose

diagnose is a command for Claude Code from cirwel/unitares. It costs 11 tokens per session (1,348 once invoked), scanned A, original, Apache-2.0.

A command that reports the current UNITARES governance state and diagnostics for an AI agent. It checks the agent's identity and continuity before retrieving its governance measurements.

In plain words
What is it for?
Use it to inspect identity status, session binding, lineage, session resolution, governance metrics, and—when relevant—the health of the surrounding system.
Why use it?
It helps distinguish a genuinely resumed session from a newly created identity, avoiding misleading results caused by treating an old session identifier as proof of ownership.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to inspect identity status, session binding, lineage, session resolution, governance metrics, and—when relevant—the health of the surrounding system.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/cirwel/unitares/diagnose
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/cirwel/unitares

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagnose

README.md
[![agentmods](https://agentmods.dev/badge/commands/cirwel/unitares/diagnose/github.svg)](https://agentmods.dev/commands/cirwel/unitares/diagnose)
Your own site
<a href="https://agentmods.dev/commands/cirwel/unitares/diagnose"><img src="https://agentmods.dev/badge/commands/cirwel/unitares/diagnose/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnose

Your own site · 80×15
<a href="https://agentmods.dev/commands/cirwel/unitares/diagnose"><img src="https://agentmods.dev/badge/commands/cirwel/unitares/diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,348 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.01348
Opus 5.5 $0.00004 $0.00539
Sonnet 5.5 $0.00002 $0.00270
Haiku 4.5 $0.00001 $0.00135

Measured 2d ago against content hash 3c968159400b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagnose scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/diagnose.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The canonical copy of this command lives in the companion unitares-governance-plugin repo (commands/diagnose.md). This copy adapts helper paths to this repo's scripts/client/session_cache.py and deliberately keeps repo-specific guidance the plugin copy does not yet carry: the explanation that an argless identity() is gated to a fresh mint, the cache-token rule, the list_process_bindings() section, and the --json payload on the cache refresh. Sections marked <!-- repo-specific: keep on plugin sync --> must survive a future sync from the plugin.

Start by inventorying slot-scoped session caches in the current workspace.

Use the shared helper in this repo:

  • scripts/client/session_cache.py list --workspace "$PWD" — slot inventory sorted newest-first
  • scripts/client/session_cache.py get --slot=<slot> session — read a specific cache

A read without --slot returns the legacy flat session.json, which under S20 is read-only-legacy — surface it only as a lineage candidate, never as the current process's identity.

If continuity state exists:

  • treat uuid as a local identity anchor and lineage candidate
  • ignore any continuity_token field in the cache; it is never proof

Never take a continuity_token from any cache file, whether a legacy v1/flat session.json or a v2 slot cache: only a token returned to this live process counts as proof. v2 slot caches do not persist it, and a token found in a legacy file is not a credential.

Do not verify by bare UUID resume. If you need to test ownership of a cached UUID, call identity(agent_uuid=<uuid>, continuity_token=<token>, resume=true) only when this live process holds a matching token returned to it by the server.

If no proof-owned UUID rebind is available, call identity(client_session_id=<your client_session_id>) to inspect current binding. Never call identity() with no arguments: with no proof argument the call is gated to a fresh mint and reports on an identity it just created, so read identity_assurance.caller_proven before trusting the result.

If you have no client_session_id, report the identity as unknown and suggest /governance-start, which declares the cached uuid as a parent only for a deliberate handoff from an exited process.

Then call get_governance_metrics for the current agent using the same continuity data. This reads and interprets the available state; it does not advance EISV through a new check-in. Use verbosity="standard" or verbosity="full" when the source or lifecycle details needed for the diagnosis are absent from the compact view.

Call health_check() only when system health, not agent state, may be part of the issue.

Display:

  • whether identity was proof-resumed, freshly created, or created with lineage
  • identity_status
  • bound_identity
  • session_resolution_source
  • continuity_token_supported
  • identity_assurance
  • deprecation warnings
  • whether continuity looks strong or weak
  • E, I, S, V with primary_eisv_source and available timestamp/freshness labels
  • coherence with its producer and role (coherence_source / coherence_role, or nested coherence.source / coherence.role)
  • risk score with risk_score_source when returned
  • verdict with verdict_source / verdict_resolution_source when returned
  • write_gate, including any applied hold and its available recovery or expiry information; distinguish it from an inferred recommendation
  • next_action, memory_suggestions, and recovery_hint when present
  • summary or mode/basin if available
  • which fields come from behavioral assessment or ODE feedback, as identified by the response; label missing provenance as unknown

The policy_evaluation and enforcement blocks belong to assessment-bearing check-in responses, not this metrics read or a receipt-only retry. Do not infer an enforcement posture from a bare verdict. Use the returned write_gate for the current lifecycle restriction. A high-risk reading is a reason to inspect its inputs and relevant task evidence; an applied hold follows its recovery contract even when the reading's interpretation is disputed.

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +18 lines 3c968159400b
  2. 16d ago Changed · +20 lines eff67d9a46c3
  3. 1mo ago Changed · +2 lines e7d116535063
  4. 2mo ago First seen · 58 lines · 11 tokens per session scan A 0d33f363e4ce

Subscribe to this mod's changes

diagnose is a command published in the GitHub repository cirwel/unitares (6 stars, last pushed today), licensed Apache-2.0. It adds 11 tokens to every session and 1,348 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

diagnose compared with commands from other repositories

diagnose next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diagnosecirwel/unitaresCommand6todayApache-2.0A11Claude Code
async-checkTheBeardedBearSAS/claude-craftCommand1073d agoMITA6Claude Code
type-coverageTheBeardedBearSAS/claude-craftCommand1073d agoMITA8Claude Code
statusbar-doctorleeguooooo/claude-code-usage-barCommand3896d agoMITB14Claude Code
debugZts0hg/codexspecCommand66d agoMITA23Claude Code
triage-deploymentPranavNagrecha/AwesomeSalesforceSkillsCommand2616d agononeA0Claude Code
dot-agent-fix-bugrcelebrone/DotAgentsCommand153d agononeA27Claude Code