Skip to content

[FEATURE]: Post-compaction reload for skills, AGENTS.md and instruction files #37627

Closed as not planned

Description

@devZu9

Checklist

  • I have searched the existing issues and confirmed this is not a duplicate

Problem

When using OpenCode in long sessions, the context eventually fills up and triggers automatic compaction. Compaction creates a summary of the conversation and discards old messages. However, after compaction:

  1. AGENTS.md is not re-read — project-specific rules are lost
  2. SKILL.md files are not re-loaded — skill instructions disappear from context
  3. instructions from opencode.json are not re-injected

This means after compaction the agent may start behaving as if no project rules exist, ignoring formatting conventions, build commands, and skill-based workflows.

Suggested solution

Add a post-compaction hook or configuration option to specify files that should be re-read after compaction:

{
  "compaction": {
    "auto": true,
    "reload": [
      "AGENTS.md",
      ".opencode/skills/session-log/SKILL.md"
    ]
  }
}

Alternatively, make the system automatically re-inject AGENTS.md and any loaded skills into the context after compaction.

Activity

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review these issues and consider adding a reaction or comment there instead of opening a new one.

  2. changed the title [-]Skills and AGENTS.md lost after context compaction - no reload mechanism[/-] [+][FEATURE]: Post-compaction reload for skills, AGENTS.md and instruction files[/+] on Jul 18, 2026
  3. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions