olshansk/agent-skills

cmd-latest-msg

Store or retrieve the latest agent message to /tmp/agents/{agent}/

First seen Apr 16, 2026

Installation

$ npx skills add olshansk/agent-skills --skill cmd-latest-msg

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from olshansk/agent-skills · top by installs.

npx skills add olshansk/agent-skills

Browse all from olshansk/agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 8
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code codex gemini

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,023 B
  • docs SUMMARY.md 88 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

Latest Message <!-- omit in toc -->

Persist the last agent message to disk for cross-agent visibility.

Instructions

  1. Parse the user's input after /cmd-latest-msg.
  1. help (or no argument) — print usage and stop:

`` Usage: /cmd-latest-msg save — save your last message /cmd-latest-msg use — read latest from the current agent /cmd-latest-msg use <agent> — read latest from claude|codex|gemini /cmd-latest-msg help — show this usage ``

  1. save — save the last assistant message:

a. Determine which agent you are from runtime context: - Claude Code → claude - Codex CLI → codex - Gemini CLI → gemini - If inference fails, default to codex

b. Create the output directory:

``bash mkdir -p /tmp/agents/<agent> ``

c. Capture your last assistant message — the response you gave immediately before the user invoked this skill.

d. Write it to two files using the Write tool: - /tmp/agents/<agent>/latest.md — always overwrite - /tmp/agents/<agent>/<unix_timestamp>.md — timestamped copy (use date +%s to get the timestamp)

e. Confirm with:

`` Stored to: /tmp/agents/<agent>/latest.md /tmp/agents/<agent>/<timestamp>.md ``

  1. use — display the latest message for the current agent:

a. Infer the current agent using the same runtime-context rules as save.

b. Read and display /tmp/agents/<agent>/latest.md.

c. If the file doesn't exist, say: No messages found for <agent>.

  1. use <agent> — display another agent's latest message:

a. Validate <agent> is one of: claude, codex, gemini.

b. Read and display /tmp/agents/<agent>/latest.md.

c. If the file doesn't exist, say: No messages found for <agent>.