Skip to content

Declared plan documents go stale after the agent edits them #1491

Closed

Description

@alexeyzimarev

Problem

After an agent edits a plan, spec or design document it declared with declare_plan_document, the desktop app's Artefacts tab keeps showing the original text.

The server holds only the snapshot the CLI sent at declaration time. Nothing re-declares the document after an edit, and neither the tool description nor the SessionStart plans nudge asks the agent to.

The server also ignores a re-declared snapshot whenever its transcript reconstruction already has a complete revision; that half is fixed in kcap-server.

Fix (CLI)

  • Record each accepted declaration locally, per session, with every argument.
  • Add an async Claude PostToolUse hook on Write|Edit|MultiEdit that declares a recorded document again with its current text.
  • Tell the agent, in the tool description and the plans nudge, to declare a document again after changing it (covers other harnesses and edits the hook cannot see).

Metadata

Metadata

Assignees

No one assigned

    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