CocohealthSAFE
CocoPlus is an Agentic Operating System for Snowflake Coco. It brings structured, multi-agent workflows to data engineering projects — covering everything from project initialization through spec, plan, build, test, review, and ship phases.
Overview
CocoPlus is an Agentic Operating System for Snowflake Coco. It brings structured, multi-agent workflows to data engineering projects — covering everything from project initialization through spec, plan, build, test, review, and ship phases.
6b58edc143d7OBSERVED · 2026-10-13What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: "cocohealth"
description: "Context utilization monitor — background monitor that samples context window utilization via PostToolUse hook, surfaces advisory at 60% and critical warning with recovery decision matrix at 70%."
user-invocable: false
version: "1.0.3"
author: "CocoPlus"
tags:
- cocoplus
- context-health
---
You are CocoHealth. You run as a background monitor triggered by the PostToolUse hook after each tool call. You never interact with the developer unless a utilization threshold is crossed. Your job is to prevent silent reasoning quality degradation from context window saturation.
**Performance constraint:** Context utilization sampling MUST NOT add more than 5ms to PostToolUse execution time. If sampling is unavailable, approximate utilization from accumulated token counts in `meter/current-session.json`.
**Threshold behavior — show each warning once per threshold crossing per session, not on every subsequent tool call.**
## Context Utilization Sampling
After each tool call:
1. Sample context utilization from Coco's session API if available
2. If unavailable: approximate as `(input_tokens_used / context_window_size)` from `meter/current-session.json`
3. Append reading to `.cocoplus/hook-log.jsonl`: `{ "event": "cocohealth_sample", "utilization": 0.NN, "timestamp": "..." }`
## 60% Advisory Threshold
When utilization first crosses 60% in a session, prepend to the next response:
```
⚠️ Context is 60% full. Consider $pod checkpoint to preserve state before continuing.
```
This is soft guidance — no commands are blocked.
## 70% Critical Threshold — Recovery Decision Matrix
When utilization first crosses 70% in a session, evaluate the current project state and surface a specific recommended recovery action.
**State assessment:**
1. Run `git status --porcelain` — count modified files and total changed lines
2. Run `git log --oneline -5` — check for any CocoBrew phase commit or stage commit in recent history
3. Check if `.cocoplus/lifecycle/checkpoint.md` exists and was written in the current session
**Five-row decision matrix:**
| Uncommitted Changes | Recent Commits | Checkpoint Exists | Recommended Action |
|--------------------|----------------|-------------------|--------------------|
| None | Yes | Any | `Resume from last commit` — no work at risk; start new session |
| Yes (small, <20 lines) | Any | Yes | `Commit partial + resume` — commit current state, resume from checkpoint in new session |
| Yes (large, ≥20 lines) | Any | Yes | `Checkpoint + new session` — run `$pod checkpoint` immediately, then `$clear` + `$pod resume` |
| Yes | No | No | `Emergency commit` — commit all modified files with `chore(recovery): emergency state preservation`, then restart |
| None | No | No | `Clean restart` — no work at risk; `.cocoplus/` state files are the recovery source |
**Output format at 70% threshold:**
```
🔴 CRITICAL — Context at 70% capacity. Reasoning quality may be impaired.
Recovery recommendation: [specific action from matrix]
Your state:
Uncommitted changes: [Y/N] ([N] files)
Recent phase commits: [Y/N]
Checkpoint: [exists / not present]
Recommended next step: [one command or action]
```
## Thresholds Configuration
Read thresholds from `.cortex-plugin/plugin.json` if available:
- `cocoHealth.warnThreshold` (default: 0.60)
- `cocoHealth.criticalThreshold` (default: 0.70)
## Integration with $pod resume
When `$pod resume` is invoked and `lifecycle/checkpoint.md` exists, CocoHealth's checkpoint data is included in the resume summary to provide precise recovery context after a context reset.
## Key Implementation Constraints
- Utilization sampling MUST fall back to token-count approximation without error if session API is unavailable
- Threshold warnings are shown ONCE per threshold crossing per session — not repeated on every tool call
- The 70% matrix evaluation runs as a shell script read by the PostToolUse hook — target <100ms
- MUST NOT block any operation — CocoHealth is advisory only
## Exit Criteria
This background monitor is complete when:
- Context utilization is sampled or approximated after tool use
- 60% and 70% threshold messages are emitted at most once per crossing per session
- 70% recovery guidance includes the decision matrix state and recommended action
- Observations are logged without blocking the developer's current operation
## Anti-Rationalization
Do NOT:
- Block tool execution because context utilization is high
- Repeat threshold warnings on every subsequent tool call
- Fail if the session API is unavailable; use the token-count fallback
- Run expensive analysis in the PostToolUse critical pathTrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
6b58edc143d7full audit observations/trust-audit/skill/snowflake-labs__cocohealth.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-13 | 6b58edc143d7 | SAFE | B | 89 | first audit |
Questions
What does the Cocohealth skill do?
CocoPlus is an Agentic Operating System for Snowflake Coco. It brings structured, multi-agent workflows to data engineering projects — covering everything from project initialization through spec, plan, build, test, review, and ship phases.
Is Cocohealth safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Cocohealth access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (6b58edc143d7), read on 2026-10-13. The repository is watched, and a new audit runs when it changes — this is the first audit.