kmsg AGENTS.md

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/channprj/kmsg/agents-md
Clone the repo
git clone --depth 1 https://github.com/channprj/kmsg

Made for: Codex, OpenCode.

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. Scan, not verified.
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 $0.00579 $0.00579
Opus 5 $0.00290 $0.00290
Sonnet 5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured 2d ago against content hash e5fc54cab03f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (256 stars, last pushed 9d ago), licensed MIT. It adds 579 tokens to every session, about $0.0029 per session on Opus 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.