Skip to main content

claude-afk

You're running Claude Code on your terminal. It's writing code, you're approving. But you have groceries to pick up, a dentist appointment, or a filter coffee waiting at Rameshwaram Cafe. The coding shouldn't stop - Claude writes the code anyway, you just approve. Why sit in front of the computer? Go touch grass.

claude-afk routes Claude's prompts to your Slack DMs so you can keep things moving from your phone. Proceed with Caution.

Install

pip install claude-afk

Slack app setup (One time, for admins)

  1. Go to api.slack.com/apps → Create New App → From an app manifest

  2. Paste the manifest:

    Slack app manifest (click to expand)
    {
        "display_information": {
            "name": "Claude AFK",
            "description": "Control Claude Code remotely via Slack",
            "background_color": "#505870"
        },
        "features": {
            "app_home": {
                "messages_tab_enabled": true,
                "messages_tab_read_only_enabled": false
            },
            "bot_user": {
                "display_name": "Claude AFK",
                "always_online": false
            }
        },
        "oauth_config": {
            "scopes": {
                "bot": [
                    "chat:write",
                    "im:history",
                    "im:write",
                    "reactions:read"
                ]
            }
        },
        "settings": {
            "event_subscriptions": {
                "bot_events": [
                    "message.im",
                    "reaction_added"
                ]
            },
            "interactivity": {
                "is_enabled": true
            },
            "org_deploy_enabled": false,
            "socket_mode_enabled": true,
            "token_rotation_enabled": false
        }
    }
    
  3. Install the app to your workspace

  4. Grab the tokens:

    • Bot Token (xoxb-...): OAuth & Permissions → Bot User OAuth Token
    • App-Level Token (xapp-...): Basic Information → App-Level Tokens → Generate (scope: connections:write)
  5. Find your Slack User ID: click your profile → three dots → Copy member ID

Usage

1. Run setup

This prompts for your Slack tokens and user ID, verifies the connection by sending a code to your DMs, and installs hooks into Claude Code's ~/.claude/settings.json.

✗ claude-afk setup

Slack Bot Token (xoxb-...): <xoxb-your-bot-token>
Slack App-Level Token (xapp-...): <xapp-your-app-level-token>
Your Slack User ID (e.g. U05ABC123): <your-user-id>

Opening DM conversation...
Sent a verification code to your Slack DMs.
Enter the 6-digit code from Slack: <code-you-just-received>
Verified!

Config saved to .../.claude-afk/config.json
Hooks installed in .../.claude/settings.json

Done! Use `claude-afk enable all` to start routing to Slack.

2. Enable and keep coding

claude-afk enable <session-id>   # or `claude-afk enable all`

Then keep using Claude Code like before:

claude --resume <session-id>

When Claude needs a permission, asks a question, or finishes - it gets routed to your Slack DMs. Reply in the thread to respond.

3. When you're back, disable

claude-afk disable <session-id>    # disable one session
claude-afk disable all             # disable all sessions
claude --resume <session-id>       # continue like before

Other commands

claude-afk status                              # show config and enabled sessions
claude-afk add-home ~/.claude-personal         # register another Claude Code config dir
claude-afk uninstall --claude-home ~/.claude   # remove hooks from one home
claude-afk uninstall                           # remove hooks from all registered homes

How it works

claude-afk installs hooks into Claude Code that route interactive prompts to your Slack DMs:

  • Stop - when Claude finishes, posts the last message to Slack. Reply in the thread to continue the session.
  • PreToolUse - tool permission requests and AskUserQuestion prompts are forwarded to Slack. Reply to approve/deny or answer.
  • Notification - one-way DM when Claude needs attention.

Caution

This is new. Please proceed with care.

  • settings.json modification - claude-afk merges hooks into your Claude Code config. It's tested to preserve existing settings, but back up your settings.json to be safe.
  • Security - this effectively gives you remote control of your machine through Slack. Anyone with access to your Slack DM can approve tool executions.
  • Not fully tested - edge cases exist. If something breaks, claude-afk uninstall removes all hooks cleanly.

Release files for claude-afk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-afk 0.1.1
File Size Uploaded
claude_afk-0.1.1.tar.gz 66.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-afk 0.1.1
File Interpreter ABI Platform
claude_afk-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 100.7 kB

Release files / claude_afk-0.1.1.tar.gz

Download URL claude_afk-0.1.1.tar.gz
Size 66.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7d3d73cd7afd0f4d3e2db7716421529426ef9816a8c2ff55d7bb8dcfeb9b2071
BLAKE2b-256 checksum
How to use checksums
1949ed012d17a0db5cda9dd337bcd4b93b4193cc071dc85629c7dd21a332e586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / claude_afk-0.1.1-py3-none-any.whl

Download URL claude_afk-0.1.1-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d8388a7e6850663f04a81aeedfc0236e72458ddc43eb21aa2ffd5dd03ca05b7
BLAKE2b-256 checksum
How to use checksums
d39868f8a84f835cfaff20f501e7bdc74a5c2d2d9875e5e07112ce305aaafa27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page