anthropics / anthropics/claude-code

[FEATURE] Queue context without triggering computation

Open
#95,348 0 comments 0 reactions 0 assignees View on GitHub
area:cli area:cost enhancement
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)

### Problem Statement

When nearing a usage limit, I want to add context or notes for Claude Code to reference in the next session without consuming tokens. Currently, any input triggers a model invocation, which I can't afford when approaching limits.

### Proposed Solution

A mechanism to enqueue context that:
- Gets stored in the conversation/session
- Does **not** trigger a model invocation or token consumption
- Is available and acknowledged when the next actual prompt (requiring computation) is sent
- Survives context compaction
- Can still be edited like a queued prompt would

**Possible implementations:**
- A `/store ` or `/reserve ` (probably not `/enqueue ` command that saves to context without invoking the model
- A way to append to a context buffer that gets automatically prepended to the next prompt
- A "dry mode" for certain commands that loads context but doesn't process/respond

### Alternative Solutions

Currently I work around this by keeping the context unsubmitted. If the terminal closes, or worse, my machine crashes, the context is lost.

### Priority

Medium - Would be very helpful

### Feature Category

CLI commands and flags

### Use Case Example

*[Edited to a more specific example.]*

**The Scenario:**
1. I'm mid-session refactoring auth. I discover: "Edge case—business_id null silently fails validation"
2. I have ~10% of my budget left before hitting my rate limit
3. I want to context-switch to a *different* project/session that I've been meaning to work on
4. I'd rather spend those last 10% tokens on the other session than on continuing auth

**Current behavior:** I can't save the edge case discovery without consuming tokens (either by queuing it or sending it directly). So I either:
- Lose the context (risky; might forget or re-discover later)
- Burn tokens now to save it (defeats the purpose—wastes budget I wanted to allocate elsewhere)

**With `/store`:**
- `/store Edge case: business_id null fails validation silently—needs handling`
- Zero tokens consumed; context persists to the session
- I context-switch to the other project with my remaining budget intact
- When I return to auth (with fresh budget), the discovery is there

**Why this matters:** It lets me be strategic about token allocation across multiple projects when I'm rate-limited.

### Additional Context

- Currently use `/queue` to defer prompts, but this still triggers computation when executed
- Similar to how interrupt-and-steer works (accepts input mid-turn), but in the opposite direction: accept context *before* the turn starts
- Valuable for rate-limited workflows and long sessions where context needs to accumulate

### Related Issues

- #63190 – Deferred messages (queuing prompts for later execution, but assumes computation will happen)
- #49373 – End-of-turn queue mode (preventing mid-task injection, but still triggers compute)

**How this differs:** This request is specifically about storing context *without* any token consumption, whereas the related issues focus on *when* queued prompts execute.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing /queue behavior and the related issues #63190 and #49373. Define how stored context persists in the session, survives compaction, remains editable, and is included with the next computational prompt without consuming tokens. Done means the mechanism supports the described rate-limited workflow without triggering model invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.