agentleFS
InfiniteRoomLabsInfiniteRoomLabs/agent-ops/skills/end-agent-session/SKILL.md

end-agent-session

Skill0 starsChanged 5 months agoMITView on GitHub

Use when the user wants to unload a currently active agent persona and return to the default orchestrator. Clears the agent's behavioral overlay and announces the transition.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No arguments are expected.

    line 24
  2. Distinctive:

    Run the state check command:

    line 28
  3. Distinctive:

    If no agent is currently active, inform the user that no agent session is loaded and stop here.

    line 34
  4. Distinctive:

    If an agent is active, note the agent name and division from the output and proceed.

    line 35
  5. Distinctive:

    Before deleting state, capture the agent name and division from the Phase 1 result.

    line 41
  6. Distinctive:

    Do NOT skip the state check in Phase 1.

    line 69
  7. Distinctive:

    Do NOT continue speaking in the agent's persona after the teardown block has been emitted.

    line 70
  8. Distinctive:

    Do NOT delete state before reading the agent name.

    line 71
  9. Distinctive:

    Do NOT proceed to Phase 2 if Phase 1 shows no active agent.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

End Agent Session

Unload the currently active SUMMON agent persona and return to the default orchestrator. Clears the behavioral overlay and confirms the transition in a neutral tone.

User Input

$ARGUMENTS

No arguments are expected. If arguments are provided, ignore them and proceed with the teardown flow.

Phase 1: Check State

Run the state check command:

uv run ${CLAUDE_PLUGIN_ROOT}/scripts/summon.py state check
  • If no agent is currently active, inform the user that no agent session is loaded and stop here. Do not proceed to Phase 2.
  • If an agent is active, note the agent name and division from the output and proceed.

Phase 2: Teardown

Step 1: Record Agent Identity

Before deleting state, capture the agent name and division from the Phase 1 result. You need these for the teardown announcement.

Step 2: Delete State

Run:

uv run ${CLAUDE_PLUGIN_ROOT}/scripts/summon.py state delete

Step 3: Announce Teardown

Output the following block, replacing {agent-name} with the name captured in Step 1:

=== AGENT SESSION ENDED ===
The agent session for {agent-name} has been terminated.
Return to your default orchestrator persona. The behavioral instructions
between the previous AGENT SESSION ACTIVE markers are no longer in effect.
=== END SESSION TERMINATION ===

Step 4: Confirm to User

Confirm to the user in a neutral tone that the agent session has ended and you have returned to default behavior. Do NOT use the agent's character, voice, or mannerisms in this confirmation -- speak as the plain orchestrator.

Anti-Patterns

  • Do NOT skip the state check in Phase 1. Always verify an agent is loaded before attempting teardown.
  • Do NOT continue speaking in the agent's persona after the teardown block has been emitted.
  • Do NOT delete state before reading the agent name. The name is needed for the announcement.
  • Do NOT proceed to Phase 2 if Phase 1 shows no active agent.

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.