Index of every page on this site: llms.txt
All skills
minimax-ai avatar

/long-session-check

@0db1b4f
by MiniMaxminimax-ai/mcode-stack736 stars
50
Run it yourself

Check how an agent or a working session handles long conversations, covering tool-result clearing, compaction, what gets written to files, when to start a new session, and how memory is scoped. Use when a long session starts forgetting constraints, after several compactions, or when reviewing an agent's compaction and memory design.

Use this Skill: https://skilld.dev/gh/minimax-ai/mcode-stack/long-session-check

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈89 tokens for metadata: the name and description. ≈868 when used: this file.

Description uses 4.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈355 characters, or 4.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Long Session Check

The context window is a workbench, not a warehouse. Compaction answers "it does not fit right now"; memory answers "will we remember next time". Both are lossy. The safe pattern is to get anything important into human-readable files early, and to treat compaction as tidying the workbench, not as the only safety net.

Companion to MCode Engineering Notes 03, "Keeping long sessions sharp". Plain-text checklist: checklists/long-session.md.

This skill has two modes. Pick the one that matches the request.

Mode A - the session you are in right now

  1. Sort what is in context into three bins.
    • Drop: things you can fetch again or no longer need (large file reads, test logs, search results, abandoned attempts).
    • Summarize: this-session-only story (where we are, next step, open bugs and leads, files recently touched).
    • Write to a file: anything that would hurt if lost or is needed in a later session (decisions and their reasons, progress, todos, acceptance criteria, long-lived rules).
  2. Write the third bin down now, in the project's progress or design doc, or via handoff-doc.
  3. Choose the next move:
    • Same task, history just long: compact, and say what comes next and what must be kept (for example "focus on the auth refactor, drop the test debugging").
    • New task: start a new session.
    • Compacted several times and drifting, or repeating questions already answered, or breaking earlier constraints: write a hand-off doc and start fresh with it.
    • Went the wrong way: rewind to before the mistake instead of compacting, so the wrong attempt does not end up in the summary.

Mode B - reviewing an agent's design

Read the agent's code and configuration and answer each item with evidence (file and line, config key, or observed behaviour):

  1. Are old tool results cleared before resorting to a full summary?
  2. Are tool calls and their results kept in pairs when results are cleared? Many model APIs reject orphaned calls.
  3. Do key decisions and constraints get written to files, not only kept in the conversation?
  4. Does manual compaction accept instructions about what to keep and what comes next?
  5. Does automatic compaction trigger early enough to leave room for output and for the summary itself? Can the session continue if compaction fails (quota, smaller model)?
  6. Can the compaction request reuse the prompt cache? Does compaction run so often that it keeps invalidating the cache?
  7. Does compaction change only what the model sees, leaving the user's visible history intact? Is it kept out of user-facing budgets such as step limits?
  8. Is the model told that context is managed automatically, so it does not stop half way to "continue next turn"?
  9. Is project memory (AGENTS.md or similar) short and limited to stable rules?
  10. Is memory scoped (session, project, user)? Are temporary progress and todos kept out of long-term memory?
  11. When memory exceeds its injection budget, is truncation visible, and are the most important rules guaranteed to load?
  12. Can a human open, edit and switch off the memory? Rules that must be enforced belong in hooks, not in memory.

Output

For Mode A: the three bins, what you wrote to which file, and the chosen next move. For Mode B: a table of the items with pass / fail / unknown, the evidence, and the top fixes in priority order.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts23d3 checks · Risk SAFE
  • Gen Agent Trust Hub23d

    This skill provides a set of procedural guidelines for managing long-running agent sessions and reviewing session memory architectures. It does not contain any executable code, network operations, or malicious patterns.

  • Socket23d

    No alerts

  • Snyk23d

    Risk: LOW · No issues

Signed by skilld at 0db1b4f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 3 weeks ago

README badge

README badge for minimax-ai/mcode-stack/long-session-check