Skip to content

ohernandezdev/afkode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AFKode

AFKode

Your AI codes while you play.

An in-game overlay to supervise AI coding agents โ€” Claude Code, OpenCode, Codex, or any terminal โ€” without leaving your game. Press Alt+X, check on your agent, approve, go back to the match.

Release Downloads CI License: MIT Platforms

AFKode supervising a live Claude Code session โ€” tabs, command blocks, git footer and hotkey hints

A real session: AFKode supervising Claude Code (which is auditing AFKode's own codebase).

Why AFKode?

  • ๐ŸŽฎ Never leave your game. The overlay floats above windowed/borderless games. Alt+X toggles it instantly โ€” no alt-tab, no FPS hit (Tauri + WebGL rendering, ~2 MB installer).
  • ๐Ÿค– Your agent's real state, not a guess. Claude Code sessions launch with injected hooks that report exactly which tool is running, when it waits for your permission, and when a turn ends โ€” all local (127.0.0.1).
  • โšก Approve without opening anything. Alt+A answers the pending permission prompt from anywhere. The mini-HUD pill shows ๐ŸŸ  working ยท ๐ŸŸก waiting ยท ๐ŸŸข done while the overlay is hidden.
  • ๐Ÿ”• Knows when you're in a match. Fullscreen game focused โ†’ notifications go silent and queue in an inbox; one ping when you're back in the lobby.
  • ๐Ÿ’ฌ Talk to it from a Spotlight-style palette. Alt+P, type the task, Enter โ€” it lands in the right session, with history, /command and @file autocomplete.
  • ๐Ÿงฑ A real terminal underneath. ConPTY/PTY, truecolor, interactive TUIs, Warp-style command blocks (OSC 133), search, themes.

Install

OS How
Windows winget install OmarHernandez.AFKode โ€” or the NSIS installer from Releases
macOS Download the .dmg from Releases, drag to Applications. Unsigned for now: right-click โ†’ Open on first launch (or xattr -dr com.apple.quarantine /Applications/AFKode.app)
Linux .AppImage (self-updating) or .deb/.rpm from Releases

AFKode checks for updates on startup and installs them after you confirm (signed updater artifacts). First run opens a guided wizard that installs Node.js and Claude Code for you if they're missing.

Hotkeys

Global (work from inside your game):

Hotkey Action
Alt + X Show / hide the overlay
Alt + G Ghost mode: translucent overlay, clicks pass through to the game
Alt + P / Ctrl + Alt + P Prompt palette: type a task, it goes to the active agent
Alt + A Approve: answer "yes" to the agent waiting for permission, without opening the overlay
Alt + N Toggle do-not-disturb manually (lobbies are fullscreen too); auto-resets when the game closes

On macOS, Alt is the Option (โŒฅ) key: โŒฅX, โŒฅG, โŒฅP / โŒƒโŒฅP, โŒฅA, โŒฅN.

In-app:

Windows / Linux macOS Action
Ctrl+F โŒ˜F Search the terminal scrollback
Ctrl+K โŒ˜K Search open sessions
Ctrl+V โŒ˜V Paste (clipboard image โ†’ temp PNG path for the agent)
โ€” โŒ˜C Copy the selection (Ctrl+C stays SIGINT)
Ctrl+Shift+C โŒ˜โ‡งC Copy selection, or the selected block's output
Ctrl+โ†‘/โ†“ โŒ˜โ†‘/โ†“ Jump between command blocks
Shift+Enter Shift+Enter Literal newline in agent TUIs (no submit)

On macOS, Ctrl+F, Ctrl+K and Ctrl+V pass through to the shell (they are readline editing keys there).

Features

Supervise your agents

  • Real agent integration (Claude Code hooks): sessions launch with injected hooks reporting exact state to a local listener โ€” which tool runs, when it waits for permission, when a turn ends. The HUD, Alt+A and the summary are exact, not guessed. Other CLIs fall back to text heuristics. Optional (โš™, on by default).
  • Mini-HUD: a tiny draggable pill, visible while the overlay is hidden: ๐ŸŸ  working ยท 3:42 / ๐ŸŸก waiting for you / ๐ŸŸข done. Grows a โ†ฉ quick-reply button when an agent waits.
  • Do-not-disturb in match: while a fullscreen game holds focus, AFKode stays silent; pending items queue in the between-matches inbox (approve/jump per row) and one ping fires when silence lifts.
  • "While you were away" summary: coming back after 2+ minutes shows turns completed, tools run, files touched, and how long agents sat waiting for you.
  • Agent-aware notifications: overlay hidden + agent finishes or blocks on input โ†’ native toast + optional beep, or voice announcements (TTS) copilot-style over your game audio.
  • Prompt palette with autocomplete: history (โ†‘), Claude Code /commands, and @file completion against the session's folder (Tab).

A terminal built for this

  • Real terminal (ConPTY/PTY): truecolor, interactive apps, GPU-rendered (WebGL). Copy-on-select, right-click copy/paste, drag & drop of files/folders.
  • Command blocks (Warp-style): shell tabs group each command + its output into a block via OSC 133 shell integration (injected at spawn โ€” your profile files are never edited). Colored gutter per block (green โœ“ / red โœ—), hover toolbar (copy command/output/both, re-run), keyboard navigation. Automatic for PowerShell (Windows), bash (Linux) and zsh (macOS/Linux); other shells can opt in. Agent TUI tabs are unaffected.
  • Tabs: parallel sessions (Claude Code, OpenCode, Codex, your shell) โ€” rename, color tags, live state dots, Ctrl+K session search.
  • Git footer: branch, +added/-removed and dirty indicator for the active session's folder.
  • CLI detection & one-click install: launchers detect installed agents; missing ones install with one click. First-run wizard handles Node.js + Claude Code + login.
  • Clipboard image paste: Ctrl+V with a screenshot on the clipboard saves it to a temp PNG and hands the path to the agent.

Made to disappear

  • System tray: left-click toggles the overlay, right-click opens the menu. The window's ร— hides to the tray instead of closing.
  • Ghost mode: the overlay stays visible as a translucent HUD while clicks and keys go to the game.
  • Overlay โ†” window mode: always-on-top borderless overlay for gaming, or a normal taskbar window when you're not.
  • Memory saver (Windows): hiding the overlay trims the working set (~6 MB) and puts WebView2 in low-memory mode โ€” lightest exactly while you play.
  • Customization: 9 themes (Warp Dark, Claude Warm, Dracula, Nord, Tokyo Night, Gruvbox, Solarized, GitHub Dark, Monokai), font family/size, English/Spanish UI, background opacity slider, window position/size memory.

Platform support

AFKode is Windows-first; macOS and Linux builds ship from the same codebase with per-OS implementations. Anything degraded or unavailable is listed here โ€” no silent gaps.

Feature Windows macOS Linux
Terminal (PTY), tabs, themes, palette, search โœ… ConPTY โœ… โœ…
Shell tab PowerShell login shell ($SHELL, fallback zsh) login shell ($SHELL, fallback bash)
Claude Code hooks integration (HUD, Alt+A, summary) โœ… โœ… (needs curl, preinstalled) โœ… (needs curl)
Global hotkeys โœ… Alt+โ€ฆ โœ… โŒฅโ€ฆ (Option) โœ… Alt+โ€ฆ (X11; compositor-dependent on Wayland)
Auto do-not-disturb (fullscreen game detection) โœ… Win32 โœ… CGWindowList โœ… X11 (EWMH) ยท โŒ Wayland โ€” use manual Alt+N
Voice announcements (TTS) โœ… WebView2 speech โœ… say โš ๏ธ spd-say (speech-dispatcher); toggle hidden if missing
Notifications โœ… toasts โœ… (allow in System Settings) โœ… (libnotify)
Memory saver on hide (working-set trim + low-memory webview) โœ… โŒ automatic no-op โŒ automatic no-op
Setup wizard Node.js install โœ… winget โš ๏ธ Homebrew if present โš ๏ธ apt/dnf (needs sudo password in the tab)
Clipboard image paste to agent โœ… โœ… AppleScript โš ๏ธ needs wl-paste or xclip
Tray icon โœ… โœ… menu bar โœ… (needs an appindicator-capable desktop)
Auto-updater (signed artifacts) โœ… NSIS โœ… .app.tar.gz (manual install via .dmg) โœ… AppImage only (deb/rpm update via package manager)
Overlay transparency / always-on-top โœ… โœ… โš ๏ธ X11 yes; Wayland depends on the compositor
In-app shortcuts Ctrl+โ€ฆ โŒ˜โ€ฆ (Ctrl+F/K/V pass to the shell) Ctrl+โ€ฆ
CLI detection under GUI PATH โœ… โœ… Homebrew, npm prefix, ~/.nvm โœ…

Notes:

  • Wayland: fullscreen-game detection is out of scope (no protocol for inspecting foreign windows); DND works via the manual Alt+N toggle. Under XWayland-capable setups the X11 path may still work.
  • macOS/Linux builds are CI-verified (build + cargo check/tests per OS); day-to-day development happens on Windows, so treat non-Windows paths as less battle-tested and report issues.
  • A full per-module macOS audit (what works, what was fixed, what is Windows-only by design, and what still needs on-device verification) lives in docs/MACOS-AUDIT.md.

Command blocks in other shells

Command blocks activate automatically for PowerShell (Windows), bash (Linux) and zsh (macOS/Linux). Any other shell works too if it emits OSC 133 sequences โ€” add the equivalent of this to its config (fish โ‰ฅ 3.6 example, ~/.config/fish/config.fish):

function __afk_prompt_start --on-event fish_prompt
    printf '\e]133;D;%s\e\\' $status
    printf '\e]133;A\e\\'
end
function __afk_preexec --on-event fish_preexec
    printf '\e]133;C\e\\'
end
# B (input start) at the end of your prompt:
functions --copy fish_prompt __afk_orig_prompt
function fish_prompt
    __afk_orig_prompt
    printf '\e]133;B\e\\'
end

Notes: bash integration is injected via --rcfile, which bash ignores for login shells (-l), so a bash login shell on macOS gets no blocks โ€” zsh (the macOS default) is fully supported. If your .bashrc already sets a PROMPT_COMMAND, it is preserved (AFKode prepends its hook).

Limitations

  • Works over games in windowed or borderless mode (like Discord/Overwolf without injection). In exclusive fullscreen the game covers the overlay.
  • Hotkeys are defined in src-tauri/src/lib.rs (TOGGLE_SHORTCUT, GHOST_SHORTCUT, โ€ฆ). Alt+Z is typically taken by the NVIDIA overlay, which is why ghost mode uses Alt+G.
  • Code signing is pending (OV/EV certificate): Windows SmartScreen warns on install for now.

Development

npm install
npm run tauri dev

On Linux you need the Tauri 2 system packages first: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf.

Production build: npm run tauri build โ€” installers land in src-tauri/target/release/bundle/ (NSIS .exe + MSI on Windows, .dmg on macOS, .deb/.rpm/.AppImage on Linux). CI builds all of them from a 3-OS matrix on every v* tag.

Roadmap

The feature roadmap lives in docs/ROADMAP-FEATURES.md โ€” 12 Warp-inspired features planned across v0.8โ€“v1.1:

  • v0.8 โ€” Terminal IQ: Command Blocks (OSC 133) โœ…, Command Palette (> actions), AI Command Search, Session Restore.
  • v0.9 โ€” Trust & Approvals: Diff preview before approving Edits, risk-graded approvals (๐ŸŸข/๐ŸŸก/๐Ÿ”ด), per-session cost & token telemetry.
  • v1.0 โ€” Fleet & Chat: Chat View over agent transcripts, fleet mini-dashboard on the HUD, remote approvals from Telegram.
  • v1.1 โ€” Gamer Distribution: Discord Rich Presence + shareable session cards, edge-docked peek mode & per-game HUD profiles.

Product thesis: docs/ROADMAP.md.

Contributing

See CONTRIBUTING.md. Issues and PRs welcome โ€” especially macOS/Linux field reports (see the audit's device-testing checklist).

License

MIT

About

In-game overlay to supervise AI coding agents (Claude Code, OpenCode, Codex) while you play. Tauri + xterm.js, ~0 FPS impact.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors