kmsg: Instructions file for Codex

AGENTS.md

kmsg AGENTS.md is an instructions file for Codex, OpenCode from channprj/kmsg. It costs 579 tokens per session, scanned A, original, MIT.

Repository instructions for building and manually testing kmsg, a Swift command-line tool that controls KakaoTalk on macOS through its accessibility interface. They also describe how commands connect to the app and its user-interface tree.

In plain words
What is it for?
Use them when developing or manually checking commands that inspect chats, read messages, or send messages in KakaoTalk. They also help maintain the Swift wrappers around macOS accessibility features.
Why use it?
They explain how to build the tool and check its status, visible interface, chats, messages, and sending behavior without accidentally sending a message. They provide the project structure needed to make changes in the right layer.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is channprj/kmsg's own configuration. It tells Codex and OpenCode how to work on kmsg itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kmsg configures →

Reuse

Borrowing it

Nothing to install: this file belongs to channprj/kmsg. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/channprj/kmsg/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/channprj/kmsg

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kmsg AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/channprj/kmsg/agents-md/github.svg)](https://agentmods.dev/instructions/channprj/kmsg/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/channprj/kmsg/agents-md"><img src="https://agentmods.dev/badge/instructions/channprj/kmsg/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kmsg AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/channprj/kmsg/agents-md"><img src="https://agentmods.dev/badge/instructions/channprj/kmsg/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 579 This file is loaded in full into every session.
When invoked 579 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00579 $0.00579
Opus 5.5 $0.00232 $0.00232
Sonnet 5.5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured 2mo ago against content hash e5fc54cab03f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kmsg AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build Commands

swift build                    # Debug build
swift build -c release         # Release build
.build/debug/kmsg [command]    # Run debug build
.build/release/kmsg [command]  # Run release build

Testing

No automated test suite. Test manually:

.build/debug/kmsg status --verbose           # Check accessibility & app status
.build/debug/kmsg inspect --depth 5          # Inspect UI hierarchy
.build/debug/kmsg chats --verbose --limit 20 # List chats
.build/debug/kmsg send "Name" "msg" --dry-run # Test send without sending
.build/debug/kmsg read "Chat" --limit 50     # Read messages

Architecture

CLI Commands (Commands/*.swift)
        ↓
  KakaoTalkApp (High-level business logic)
        ↓
    UIElement (Accessibility API wrapper)
        ↓
macOS Accessibility APIs (AXUIElement)

Key components:

  • UIElement (Accessibility/UIElement.swift): Wrapper around AXUIElement with breadth-first search, attribute access, hierarchy traversal. Supports limit parameter for early termination.

  • KakaoTalkApp (KakaoTalk/KakaoTalkApp.swift): Process lifecycle, window management, auto-launch with timeout. Thread-safe via Sendable.

  • Commands: Each implements ParsableCommand. Handle CLI interaction, permission checks, delegate business logic to KakaoTalkApp.

KakaoTalk UI Structure

Main Window (id: Main Window):
├── Navigation: id: friends, id: chatrooms, id: more
├── Unread count: AXStaticText
└── Content: AXScrollArea > AXTable > AXRow > AXCell

Chat Window (title = chat name):
├── Messages: AXScrollArea > AXTable > AXRow
└── Input: AXTextArea or AXTextField

Technical Notes

  • Bundle ID: com.kakao.KakaoTalkMac
  • Requires Accessibility permission (System Settings > Privacy & Security > Accessibility)
  • Keyboard input uses CGEvent for Korean text (Unicode support)
  • Search methods support limit for early termination - use to avoid full UI traversal
  • All classes interacting with accessibility APIs should be Sendable
  • For version bumps, release tags, or release automation changes, follow VERSIONING.md

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 73 lines · 579 tokens per session scan A e5fc54cab03f

Subscribe to this mod's changes

kmsg AGENTS.md is an instructions file published in the GitHub repository channprj/kmsg (282 stars, last pushed 1mo ago), licensed MIT. It adds 579 tokens to every session, about $0.0023 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

kmsg AGENTS.md compared with instructions from other repositories

kmsg AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kmsg AGENTS.mdchannprj/kmsgInstructions file2821mo agoMITA579Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode