Skip to content

About

OpenCode plugin: local chat timestamps without leaking them to the model

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

opencode-message-times

OpenCode plugin that shows when a message was sent or completed in the chat TUI — without putting those timestamps in the model context.

User prompt

User prompt timestamp

Assistant response

Assistant response timestamp

Local wall clock as ⏱ DD/MM HH:MM:SS. The model never sees the stamps.

Why

Where Behavior
User message ⏱ DD/MM HH:MM:SS as an ignored text part (visible in TUI, filtered from the LLM)
Assistant message Same stamp appended when each text part completes (experimental.text.complete, sync only)
Model history Stamps stripped via experimental.chat.messages.transform
Compaction / synthetic Never stamped

Install

From GitHub (recommended while unscoped on npm)

// ~/.config/opencode/opencode.json
{
  "plugin": ["github:cartudev/opencode-message-times"]
}

OpenCode installs plugins with Bun on startup.

Local path

{
  "plugin": ["./path/to/opencode-message-times"]
}

Or drop a copy under ~/.config/opencode/plugins/ / .opencode/plugins/.

Restart OpenCode after changing plugins.

Requirements

  • OpenCode with plugin support
  • Peer: @opencode-ai/plugin (provided by OpenCode)

How it works

chat.message
  └─ real user text? → unshift ignored stamp part (needs id/sessionID/messageID)

experimental.text.complete
  └─ not compaction? → append stamp (no network/client awaits)

experimental.chat.messages.transform
  └─ drop ignored stamp parts + strip ⏱ from model view

Pure helpers live in src/stamp.ts and src/guards.ts.

Development

bun install
bun test
bun run typecheck

Related OpenCode knobs

Native TUI timestamps: /timestamps or keybind session_toggle_timestamps (kv.timestamps = show | hide).

License

MIT © cartudev

About

OpenCode plugin: local chat timestamps without leaking them to the model

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages