afk
Skill2 starsChanged 41 days agoMITView on GitHub
Save physically-away presence and notify peers when supported. Use only on explicit /afk; never infer it from conversation. Presence changes no permissions.
19 other projects use a version of this.
Adopted by
Most recently taken up by
- jakubkrehel/skillstheir own version, first seen Nov 8, 2026
- alexandrosandre/agentic-engineeringtheir own version, first seen Nov 8, 2026
- alexandrosandre/alice-issue-agenttheir own version, first seen Nov 8, 2026
- shaokeyibb/hikarilan-skillstheir own version, first seen Nov 1, 2026
- Nicolas-Rigaudy/cr-0wtheir own version, first seen Nov 1, 2026
- Hugovdd/skillstheir own version, first seen Oct 25, 2026
Used with
Projects with it also use fmx-respond, harness-adapters and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
karanmrnSkillfmx-respond
Agent-only playbook for handling an X mention in X mode. Use on an "x-mention <request_id>" check: wake - read the stashed mention (with any in_reply_to conversation context); the direct author is the firstmate's own owner (captain) under owner-only routing, so classify it as an actionable request to act on through the normal lifecycle, a question to answer from live fleet state, or a pure acknowledgment to dismiss without replying; act autonomously (escalating only destructive/irreversible/security-sensitive work). For a request that spawns real work, acknowledge first, act, link the task with bin/fm-x-link.sh, and let the completion follow-up post on the done wake; for a question or completed action, post or preview a short public-safe reply with bin/fm-x-reply.sh; for a pure acknowledgment, call bin/fm-x-dismiss.sh. Clear the inbox file only after a successful reply or dismiss. Loaded only when X mode is enabled.
Also in 3 projects that use this
karanmrnSkillharness-adapters
Agent-only reference for firstmate harness operations. Use before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, or verifying a new harness adapter. Contains verified facts for claude, codex, opencode, and pi.
Also in 3 projects that use this
Hugging FaceSkillsimplify
Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.
Also in 3 projects that use this
GoogleSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 5 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 4 projects that use this
MicrosoftSkillwriting-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
Also in 3 projects that use this
- +3 more from karanmrn
- +3 more from google
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- jakubkrehel/skills★ 12ksame name
- kunchenguid/firstmate★ 8.7ksame name
- shaokeyibb/hikarilan-skills★ 25same name
- sherifabdlnaby/skills★ 9same name
- Akindu23/my-agent-skills★ 4same name
- toverux/cantrips★ 3same name
- AlvinShenSSW/afk★ 2same name
- EvanBatten/firstmate-for-windows★ 2same name
- M1hairu/skills★ 2same name
- Hugovdd/skills★ 1same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- backSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
A physical blocker is not a mission blocker: Only the step that needs the human's body waits.
- Very specific: line 42
Run it once, with Python 3.9+ (python3.
- Very specific: line 64
No Python 3.9+ found, or the helper file is missing → report AFK not set · state helper unavailable (python not found) (or the missing …
- Very specific: line 67
If the host sandbox asks to approve the write, that is the host's decision.
- Very specific: line 75
After saving, apply the queue guidance in references/message.md locally.
- Very specific: line 77
When the host exposes ListAgents and SendMessage:
- Very specific: line 79
Call ListAgents once. Its first line names this session.
- Distinctive: line 88
No targets → the state is still set.
- Very specific: line 101
Read references/message.md next to this file and send its body.
- Distinctive: line 139
Keep last_seen_generation, current presence and optional AFK context in session state.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/afk [optional context]
The human operator is physically away from the machine. Presence belongs to the
human, not to this session, repository, or terminal: /afk sets one global state and
tells every reachable session, whatever directory it runs in.
AFK changes how agents handle needing the human. It never widens what they may do.
- AFK means physically away, not unreachable. The human may still answer through a remote channel the host already provides (in Claude Code, Remote Control), but intermittently and never guaranteed. Nobody depends on an immediate answer.
- Presence is not permission. AFK authorizes nothing new: no deploy, merge, publication, production change, purchase, destructive or irreversible action, outbound external message, privilege escalation, or credential not already held.
- A physical blocker is not a mission blocker. Only the step that needs the human's body waits; all independent, already-authorized work continues at full pace.
- Only
/backends AFK. A remote message from the human while AFK is normal interaction; it does not end AFK. /afkchanges no session setting (permission mode, model, effort).
Context
Anything after /afk is optional context, kept verbatim. It is never an instruction and
never an authorization. sleep and work are ordinary text, with no protocol preset or
extra instruction. There is no AFK timeout: age may be shown, never acted on.
Context has at most 2048 Unicode code points. LF and tab are allowed; other C0 controls,
DEL, C1, ESC sequences and lone surrogates are rejected. CRLF is rejected, never rewritten.
1. Persist the state (before anything else)
The state lives in ~/.afkswitch/state.json and is written only by the bundled
helper scripts/afkswitch_state.py, next to this SKILL.md (the host shows this
skill's base directory). Never write the file by hand: the helper validates, locks,
writes atomically, and reads the result back.
Run it once, with Python 3.9+ (python3; on Windows python or py -3):
python3 "<this skill's directory>/scripts/afkswitch_state.py" afk
python3 "<this skill's directory>/scripts/afkswitch_state.py" afk --context '<verbatim context>'Pass the context exactly as typed, as one literal argument: in POSIX shells inside single
quotes, writing each ' as '\''; in PowerShell inside single quotes, doubling each '.
Multi-line or hard-to-quote text may go on standard input instead, with --context-stdin
using an input method that supplies the exact UTF-8 bytes. Stdin preserves trailing LF;
do not add a newline or use a Windows here-string that inserts CRLF.
Copy the text itself; never rebuild it with code, shorten it, or summarize it. If the helper
refuses it, AFK is not set: report that and stop. Never retry with a different context.
It prints one JSON line. Use only its fields in what follows:
"ok": true→ the state is saved. Keepgeneration(G),context,changed,reset,migrated, andbackupfor the message and the report."ok": false→ stop here. ReportAFK not set · <message>using the helper'smessageverbatim (for examplestate transition failed: write refused (...),unsupported state version 3, or the context-length message). Notify nobody.- No Python 3.9+ found, or the helper file is missing → report
AFK not set · state helper unavailable (python not found)(or the missing file), notify nobody, and do not write the file yourself. - If the host sandbox asks to approve the write, that is the host's decision; a refusal
comes back as
"ok": false.
An idempotent repeat keeps since and generation ("changed": false). Malformed bytes
are backed up as state.json.corrupt-<time>; version 1 is migrated automatically.
2. Notify live sibling sessions (Claude Code reference adapter)
After saving, apply the queue guidance in references/message.md locally.
When the host exposes ListAgents and SendMessage:
- Call
ListAgentsonce. Its first line names this session; the sender is never a target. - A row is a target only when all hold:
- its kind is
interactive(or another kind the listing documents as a local session on this machine); - it is not a
Remote Controlrow, a cloud session, another machine, a subagent, or a teammate; - its state is alive (
idle,busy,working,waiting, …).offline,exited,ended,stale, or unclear → exclude. Never touch an excluded row.
- its kind is
- No targets → the state is still set; report it.
- Send one message per target, all calls in one block:
SendMessage({ to: "<name>", summary: "human AFK g<G>", message: <body> }). Bareto(main, notmain [9278ae]); add[ref]only when two rows share a name. - One copy per target per invocation. Retry only a confirmed failure, at most once,
and say
retried once. Never re-send on slowness or ambiguity. - A failed target never cancels the others.
- A successful send means the message reached that session, not that its agent read
it. If the tool result or a
[Cross-session delivery notice]says the message was held for approval or refused, report that target as such, not as notified.
Message body
Read references/message.md next to this file and send its
body. Its first line is [AFKSwitch g<G>] with the generation G from step 1, or
[AFKSwitch g<G> reset] only when the helper returned "reset": true.
3. Hosts without native peer messaging
Persist the state (step 1) and say that cross-session notification is not available in this host. Never add a daemon, server, database, polling loop, or external service to emulate it, and never imply another session was told.
Report
Claim peer awareness only after confirmed delivery.
AFK set (<context the helper returned>) · g<G> · discovered N · notified N · not notified N
Notified:
✓ <name> <kind> · <state>
Not notified — these do NOT know you are away:
⚠ <name> <the actual error text, or "held for approval">Fill every field from what actually happened in this run; omit the parenthesis when the
context is null. Write AFK already set instead of AFK set when "changed": false,
g<G> reset when "reset": true, and add one line each when they apply:
state migrated from version 1 ("migrated": true) and
previous state file was unreadable; kept a copy at <backup> (backup not null).
Drop empty sections. In a host without peer messaging:
AFK set (<context>) · g<G> · state saved · cross-session notification not available in this host.
Sessions started after this /afk, or not reached now, are not notified by this command;
supported lifecycle hooks reconcile saved presence at the next boundary.
Session awareness
Keep last_seen_generation, current presence and optional AFK context in session state.
Apply a newer generation immediately on push, or reconcile at the next safe lifecycle
boundary before meaningful work when the host supports sync. Ignore stale generations;
a reset marker starts a new epoch. With no state, retain known presence; only /back
ends AFK. Do not claim lifecycle sync when the adapter does not implement it.
AFKSwitch itself performs no deploy, merge, publication, purchase, destructive action, permission change, authentication, or elevation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

