[FEATURE] Add context: fork frontmatter option for slash commands

Resolved 💬 9 comments Opened Dec 19, 2025 by GraemeF Closed Feb 23, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Custom slash commands are excellent for reusable prompts, but their execution becomes part of the main conversation's context. For "fire and forget" tasks—logging, note-taking, external integrations—this pollutes the context with information that's irrelevant to ongoing work.

Subagents provide isolated context, but they start with a clean slate. Many utility commands need access to the current conversation to do their job—they just don't need their output retained.

Proposed Solution

Summary

Add an optional context: fork frontmatter field to custom slash commands that causes them to execute in a forked copy of the current conversation, with the result discarded after completion.

Detail

Add a context frontmatter field with support for fork:

---
description: Update Obsidian notes with session summary
context: fork
---

Review this session and update my Obsidian notes with what we accomplished...

When context: fork is set, the command would:

  1. Fork the current conversation (full context preserved)
  2. Execute the command in the forked context
  3. Return a brief completion message to the main context
  4. Discard the forked context

The default behaviour (omitted or context: main) would remain unchanged.

How this differs from subagents

| | Subagent | context: fork |
|---|---|---|
| Starting context | Clean slate | Fork of current conversation |
| Knows session history | No (must be told) | Yes |
| Result returns to main | Summary only | Brief confirmation |
| Use case | Delegated specialist tasks | Utility tasks needing full context |

This is closer to the existing --fork-session / /rewind mechanic than to subagents, but automated and integrated into the slash command workflow.

Alternative Solutions

Use a subagent: Subagents start with an empty context, so they can't summarise a session they haven't seen. You'd need to manually pass context, defeating the purpose.

Use --fork-session or /rewind manually: These require manual intervention and don't integrate with the command workflow.

Pipe conversation to a new Claude instance: Possible via the SDK, but heavyweight for simple utility commands.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

I have a /summary command that updates Obsidian notes with what was accomplished in the current session. It needs to:

  • Read the full conversation to know what happened
  • Write to external markdown files
  • Not add its output to the main context

A subagent can't do this because it starts empty—it doesn't know what the session contained. The command needs the conversation context; it just doesn't need to persist its response.

Additional Context

The infrastructure for forking conversations already exists (--fork-session, /rewind). This would expose that capability to slash commands via a frontmatter option.

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗