agentleFS
nseney1nseney1/Soma-Governance/skills/session-monitor/SKILL.md

Session Monitor

Skill4 starsChanged 14 days agoApache-2.0View on GitHub

Real-time session monitoring tracking waste trajectory, dispatching periodic probes, and alerting on regressions.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Configure Periodic Monitoring: Use the schedule tool to set a recurring timer (default: 15 minutes, or as configured).

    line 17
  2. Distinctive:

    Expensive Over-Auditing: Do not dispatch full staff reviews during monitoring (token inefficient).

    line 63
  3. Distinctive:

    Session Mutation: Never modify the target session's files or active workspace state.

    line 64
  4. Distinctive:

    Chatter Pollution: Do not alert on every clean check—notify only on threshold breaches, regressions, or trend anomalies.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Monitor

Role: Live waste tracking and alerting for active agent sessions. Periodically samples session trajectories, quantifies waste patterns, and alerts the orchestrator upon regression or threshold breaches.

Workflow

  1. Initialize Session Tracking: Receive the target session ID from the orchestrator.
  2. Establish Baseline: Execute sweep_session.py --summary-only on the session's transcript.jsonl to record the initial waste rate and step count baseline.
  3. Configure Periodic Monitoring: Use the schedule tool to set a recurring timer (default: 15 minutes, or as configured).
  4. Periodic Re-scan & Trajectory Evaluation:
    • On each interval, re-scan transcript.jsonl.
    • Compute current waste rate, delta against baseline, and top emerging waste patterns.
  5. Threshold-Gated Reporting: Report back to the orchestrator only when a configured threshold is breached or an adverse trajectory change is detected.
  6. Auto-Termination: Automatically stop monitoring after 3 consecutive clean checks or upon verified session closure.

Alert Thresholds

ConditionAction
Waste < 5%Silent (healthy execution, no notification needed)
Waste 5–15%Note in next scheduled report (warning state)
Waste > 15%Alert orchestrator immediately with breakdown
Increasing 3 consecutive checksAlert immediately + recommend specific steering intervention
New pattern not in taxonomyAlert + recommend taxonomy update

Tools & Utilities Used

  • sweep_session.py: Analyzes waste patterns and computes waste metrics.
  • transcript.jsonl: Direct log inspection for step-by-step verification.
  • schedule: Schedules one-shot or recurring inspection intervals without polling loops.

Trajectory Tracking Format

Maintain trajectory history in structured JSON format:

[
  {
    "timestamp": "2026-09-26T21:15:00Z",
    "step_count": 92,
    "waste_rate": 0.032,
    "top_pattern": "SYNTAX_ONLY_VERIFICATION"
  },
  {
    "timestamp": "2026-09-26T21:30:00Z",
    "step_count": 128,
    "waste_rate": 0.081,
    "top_pattern": "RED_TEST_SKIPPED"
  }
]

Anti-Patterns & Failure Modes

  • Expensive Over-Auditing: Do not dispatch full staff reviews during monitoring (token inefficient).
  • Session Mutation: Never modify the target session's files or active workspace state.
  • Chatter Pollution: Do not alert on every clean check—notify only on threshold breaches, regressions, or trend anomalies.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.