Use LoopCode
LoopCode on Telegram
Message LoopCode on your computer from Telegram. Send a task from your phone, approve commands with a button, and get the answer back with what was proven and what changed. Set up in a few minutes with a bot of your own.
What it does
Telegram turns a bot of your own into a way to reach LoopCode on your computer from anywhere. You message the bot the way you would message a person: run the tests and fix what fails. LoopCode does the work on your computer, in your project, and replies in the chat.
- One message shows the progress. While it works, a single message is updated in place with what it is doing and for how long.
- The answer comes back as a reply, with what was proven (the checks that passed after the last edit) and which files changed.
- Approvals and questions are buttons. Tap Allow, Deny or Allow for this conversation; pick an answer, or let LoopCode decide.
- Anything you send while it works steers it. A correction or an extra request is added to the task in hand.
- Photos and files go along with a message, so a screenshot of a bug or a spec as a PDF becomes part of the task.
/filesends you a file from the project, such as a report it wrote.
It runs as a background service, whether the LoopCode app is open or not, and it starts again when you log in. Your computer can sit locked on your desk.
Set it up
You need a LoopCode account (the free plan works) and a Telegram account. Setup takes a few minutes, once.
In the desktop app
- Open Settings → Telegram and click Connect Telegram.
- Make a bot with BotFather (see below), then paste its token.
- Choose the project folder it works in, and whether to keep the computer awake while it is plugged in.
- Scan the QR code with your phone, or click Open in Telegram, then tap Start. Your Telegram account is now connected.
The app installs the background service and shows when it is connected. The same page lists who can use the bot and the folders it works in, adds and removes them, and turns Telegram off.
In the terminal
loopcode telegram
It asks a few questions, in this order:
- Your LoopCode account. If you are not signed in, it opens the browser to sign in.
- The bot. Paste the token from BotFather. It shows as dots and is checked with Telegram before anything is saved.
- Where it works. The current folder, or another one you name.
- Staying reachable. Whether to keep the computer awake while it is plugged in.
- Its own access token. The background service gets an access token of its own, labelled Telegram on and the computer's name, so it does not depend on the terminal's sign-in.
- Your Telegram account. A QR code and a link appear: open it on your phone and tap Start.
- The background service. It is installed and started, and setup waits until it is connected to Telegram.
When it says Done, message your bot.
Make a bot with BotFather
- In Telegram, open @BotFather.
- Send
/newbot. Give the bot a name (like My LoopCode) and a username that ends inbot. - BotFather replies with a token like
1234567890:AAH…. Copy it.
The token is the key to your bot. Do not share it or paste it into a chat. If it leaks, send /revoke to BotFather, then run loopcode telegram again with the new token.
Use it
Send a task in plain words. A few examples:
- Why is the signup test failing? Fix it.
- Add a dark mode toggle to the settings page and check it in the browser.
- What changed on this branch since yesterday?
- Write the release notes for the last ten commits to RELEASE_NOTES.md, then
/file RELEASE_NOTES.md
Each chat is a conversation in one project. Messages continue it until you send /new.
Approvals and questions
When LoopCode needs your OK for a command or an edit, a message with buttons arrives:
| Button | Does |
|---|---|
| ✅ Allow | Runs this one action |
| ❌ Deny | Refuses it. LoopCode carries on without it, or asks what you want instead |
| ♾ Allow for this conversation | Allows this action and others like it for the rest of the conversation |
Questions show their options as buttons; the recommended one has a ⭐. You can also type your answer, or tap Let LoopCode decide.
If nobody answers within 15 minutes, an approval is refused and a question is left to LoopCode, so a task never waits forever.
Photos and files
Photos, and image files up to 6 MB, are shown to the model as images. Other files (PDFs, Word, Excel, code, text) are read like files attached in the app. Voice notes, audio and video are not supported yet.
/file path/to/file sends you a file from the project folder, up to 50 MB, which is Telegram's limit for bots. It only reaches files inside the project.
Commands
Type / in the chat to see them.
| Command | Does |
|---|---|
/new | Start a new conversation |
/stop | Stop the task it is working on |
/status | Whether it is working, in which project, with which model and mode |
/project | List the projects; /project name (or its number) switches to one, in a new conversation |
/model | List the models you can use; /model name switches this chat's model |
/mode | Show how it asks; /mode auto, /mode ask or /mode edits changes it |
/file <path> | Send a file from the project |
/help | What it can do, and these commands |
Modes
Each chat has its own mode, set with /mode:
| Mode | How it asks |
|---|---|
auto (the default) | A reviewer checks risky steps and asks you about anything it will not allow. Best when you are away |
ask | Asks you before every command and edit |
edits | Edits files freely, and asks before commands |
These are the same approval modes as in the app and the terminal. Your permission rules and the sandbox apply as they do there.
Projects
The first folder you set up is the default project. To let the bot work in more:
loopcode telegram add ~/code/website
Then switch in Telegram with /project website. loopcode telegram remove website takes a project off the list, and chats that were in it start a new conversation in the first project.
Staying reachable
A locked screen is fine. A sleeping computer is not: it cannot read messages, so they wait at Telegram until it wakes.
- While a task runs, LoopCode always keeps the computer from going to sleep.
- Keep awake while plugged in also keeps it awake whenever it is on mains power, so your messages always arrive. Closing a laptop's lid still puts it to sleep.
| System | The background service |
|---|---|
| macOS | A launchd agent: it starts when you log in, and restarts if it stops |
| Linux | A systemd user service. Setup also lets it run while you are logged out; when it cannot, it says to run sudo loginctl enable-linger $USER once |
| Windows | A scheduled task: it starts when you log in, and restarts if it stops |
When the computer restarts or LoopCode updates in the middle of a task, the task picks up where it stopped on its own if it was started less than six hours earlier. For an older one, the chat says so; send continue.
Manage it from the terminal
| Command | Does |
|---|---|
loopcode telegram | Set it up, or run it again to use a different bot |
loopcode telegram pair | Connect another Telegram account, or the same one again |
loopcode telegram add [folder] | Let it work in another project folder (default: the current one) |
loopcode telegram remove <name> | Stop it working in a project |
loopcode telegram users | Who may use the bot; loopcode telegram users remove <id> takes someone off |
loopcode telegram off | Stop it, remove the service, revoke its access token and forget the bot token |
loopcode gateway status | Whether it is running and connected, who may use it, its projects |
loopcode gateway start / stop / restart | Control the background service |
loopcode gateway logs [--follow] | What it did: times and events, never message text or tokens |
loopcode gateway run | Run it in this terminal instead of as a service |
Security and privacy
- Only the Telegram accounts you connect can use the bot, and only in a private chat with it. It does not work in groups. Anyone else who finds the bot is told it is private, and nothing they send is acted on.
- A connection link works once, for 10 minutes. Connecting an account always starts on your computer, with
loopcode telegram pairor the button in the app. - The bot token stays on your computer, in
~/.loopcode/gateway/config.json, readable only by your user. It is never written to a log. - The service has its own access token.
loopcode token listshows it, and turning Telegram off revokes it. - The log keeps no content.
~/.loopcode/logs/gateway.logrecords times and events, never what you or LoopCode wrote. - Messages pass through Telegram. A chat with a bot is a Telegram cloud chat, so your messages and LoopCode's replies are not end-to-end encrypted. If that matters for a project, use Control from your phone, which is.
- Work done from Telegram uses your plan, like work done in the app. When a usage window runs out, the reply says so. See Plans and usage.
Telegram or remote control?
| Telegram | Control from your phone | |
|---|---|---|
| Start new work | Yes, any time, from anywhere | Yes, in a session that is open |
| Runs when LoopCode is closed | Yes, as a background service | No: it follows a session that is open |
| Needs | A bot of your own, set up once | Scanning a QR code each time |
| Encryption | Telegram's cloud chat | End-to-end encrypted |
| Best for | Sending tasks from anywhere | Watching and steering one session closely |
Turn it off
Run loopcode telegram off, or click Turn off Telegram in Settings → Telegram. It stops the service, revokes its access token and forgets the bot token. Conversations stay, and the terminal can pick them up. To remove the bot as well, send /deletebot to BotFather.
Something not working? See Telegram in Troubleshooting.