agent-companion

agent
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Warn
  • network request — Outbound network request in scripts/fetch-nats.sh
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Every Claude Code session on your Mac, in your menu bar.

README.md
Agent Companion icon: a lit lantern on a night-blue background

Agent Companion

Every Claude Code session on your Mac, in your menu bar.

Find any session, put idle ones to sleep, wake them where they left off, and keep an eye on your usage limits.

macOS 14+
Swift 6
License: MIT
PRs welcome
Sponsor

The main window: five live sessions, two of which are waiting for a reply, and the selected session's summary card

https://github.com/user-attachments/assets/6e55d5c8-9a3b-4d23-b698-cf5875205d85

A 33-second tour on made-up sessions: the menu bar, the session list, search, hibernation and usage limits.

Agent Companion is a macOS app for people who run Claude Code in a terminal, with one Claude account or several. It lives in the menu bar, with a main window and a command line tool, agco. It reads the session files Claude Code already writes, keeps its own index on your Mac, and sends nothing to its authors.

Agent Companion is an Insourcia project released under the MIT license. It is not affiliated with or endorsed by Anthropic.

Pull requests are welcome, in English or in French: CONTRIBUTING.md explains how to build the app, run the tests and get a change merged.

Why

  • Find the session you need. One live list for every profile (~/.claude, ~/.claude-*), with full-text search across prompts, answers and tool calls. You can also describe a session in your own words and let the model find it.
  • Get your memory back. A sleeping session frees its claude process, its MCP servers and its shells. Waking it resumes at the same point, in a new tab or in the terminal you are in.
  • Plan around your limits. The 5-hour window and the weekly window for each account, a projection up to the reset, and a hint to switch to the account with the most headroom.
  • Use several Claude accounts without logging in and out. One folder per account, a shared configuration, and a claude shell function that picks the account of each new session: by folder (everything under ~/Work on the work account), by hand with claude --account <name>, or the one with the most headroom.
  • Stay in control. Everything stays on your Mac. Each feature that writes to a Claude Code profile or talks to a server is something you turn on.

The menu bar window: sessions waiting for a reply, usage limits, and live sessions The Quotas view: the 5-hour and weekly windows with their projections, a tip, and activity per day

Screenshots show made-up sessions and accounts.

Install

Requires macOS 14 Sonoma or later (Apple Silicon or Intel), Claude Code, and iTerm2 or Terminal.

With Homebrew

brew trust --cask insourcia/tap/agent-companion
brew install --cask insourcia/tap/agent-companion

Homebrew only loads a cask from a third-party tap once you trust it, hence the first line. The cask installs the app in /Applications, clears the quarantine flag (see step 3 below), and links the agco command. The app then updates itself, so brew upgrade leaves it alone. Continue with step 4.

By hand

  1. Download Agent-Companion-<version>.zip and its .sha256 file from the Releases page, then check the download:

    shasum -a 256 -c Agent-Companion-<version>.zip.sha256
    
  2. Unzip it and move Agent Companion.app to /Applications. Leave it there: the shell function and the statusline relay point to that location.

  3. Clear the macOS quarantine flag. The app is not signed with an Apple Developer ID and is not notarized, so macOS refuses to open it when it comes from a browser:

    xattr -dr com.apple.quarantine "/Applications/Agent Companion.app"
    

    You can also try to open it once, then click "Open Anyway" in System Settings › Privacy & Security.

    You only do this for a copy you download yourself. Versions installed by automatic updates (see Updating) are not blocked.

  4. Open the app. It starts its daemon, agcod, as a LaunchAgent (~/Library/LaunchAgents/app.agentcompanion.daemon.plist), and macOS shows a notification about a new background item. A build signed with a Developer ID registers it with SMAppService instead: if Settings › Daemon then says "needs approval", allow it in System Settings › General › Login Items.

First launch

A setup assistant covers the essentials in five screens. You can reopen it from Help › Setup Assistant.

  1. What the app reads and where it keeps its data.
  2. Which Claude Code profiles to follow. A profile you leave unchecked is never read.
  3. Which terminal to drive, and whether to allow notifications.
  4. What to do with idle sessions: put them to sleep when memory runs short, observe first, or never put them to sleep.
  5. The agco command, and the claude shell function if you have several accounts.

To install the command by hand:

mkdir -p ~/.local/bin
ln -sf "/Applications/Agent Companion.app/Contents/Helpers/agco" ~/.local/bin/agco
agco daemon status

Features

Sessions

A live list of the Claude Code sessions of every followed profile. Each session has a summary card, its transcript, and a log generated on request. The search field looks in session names and, as full text, in prompts, answers and tool calls. You can also describe a session ("the one where I was setting up Reaper"): the model picks the search terms, reads the sessions it finds and keeps the ones that match.

A session that says it is working while nothing comes out is flagged "No output for 14 min" in the list, the detail pane and the menu bar, with a notification: a hung API stream or a tool waiting for something that never comes no longer goes unnoticed among twenty open sessions. It takes 15 minutes without a write to the transcript (5 to 60 in Settings › Notifications) while the session's processes use almost no CPU, so a long build or test run does not count.

Sleep and wake

Stopping a session frees its memory. It later resumes at the same point, in a new tab or in the current terminal (agco wake <id> --here). The app can also put idle sessions to sleep by itself when memory runs short. It offers this at first launch and never does it unasked. With iTerm2, the tabs you had before a restart are recreated with their sessions.

Leftover processes

Dev servers, watchers, Playwright browsers and detached scripts often keep running after their session ends: closed tab, crash, or put to sleep. Performance lists them by session, with the memory each holds, its age and its listening ports, and stops one process, one session's worth or all of them, then says how much memory came back. Nothing is stopped unless you click, or turn on auto-clean in Settings › Leftover processes (off by default; it waits 10 minutes after a process is left behind). Processes whose command line contains a protected word (portly, tmux, limactl, colima, gpg-agent, ssh-agent, dev-browser by default) are never listed or stopped, and neither is anything a live session is running. From the command line: agco leftovers, agco leftovers kill <pid> | --session <id> | --all.

This week

Performance opens with what the app did over the last seven days: sessions put to sleep (by hand and automatically), sessions woken up, leftover processes stopped, and the memory that came back. "Share image…" turns these numbers into a 1200 × 675 picture with the app's name and the dates, to copy, save or send through the macOS share menu. The picture holds numbers only: no session title, folder, project or account. From the command line: agco recap (--json for scripts).

Usage limits

The 5-hour window and the weekly window for each account, with a projection up to the reset and a hint to switch to the account with the most headroom.

Several Claude accounts

One folder per account (~/.claude-<name>), a configuration shared between them, and a claude shell function that starts each new session on the account with the most headroom. Details in Working with several Claude accounts.

Optional features

These are off until you turn them on.

  • Shared MCP servers. The daemon runs a single copy of a stdio MCP server and serves it to every session, in place of one copy per session. In Tools, enable the bridge and tick a server. Its declaration then goes through the agco mcp-relay relay, which is still an ordinary stdio server. A session uses the shared copy when its declaration matches, and runs its own copy otherwise.
  • Team space. A server hosted by your team (Docker, in deploy/). An admin invites you with a link (agentcompanion://…) sent by direct message. You open it in Settings › Team, enter the 6-digit code the server emails you, and the admin's Mac lets you in on its own. Everything that goes through it is end-to-end encrypted by the members' Macs: session cards, messages, the team kit, sessions sent to a colleague, rooms. A session card tells you a colleague is already working on the same topic. It carries the repository, branch, title, a two-sentence redacted summary, changed files, ticket and state, and never the transcript.
  • Bus and Notion. The bus lets sessions talk to each other. The Notion integration (Settings › Integrations) sends a session retrospective to Notion and can keep a page per session up to date.

What the app does without being asked

It reads ~/.claude* and never writes there. It indexes the transcripts of the profiles you follow in its own database, in ~/Library/Application Support/AgentCompanion/. It writes to a profile only when you ask for it: statusline relay, shell function, adding an account, sharing configuration, hooks.

It reads your usage limits using Claude Code's token. Every 5 minutes it reads that token from the keychain and calls an Anthropic usage endpoint that is not documented. Claude Code's legal page forbids third-party tools from collecting these tokens, so the risk falls on your Claude account. Turn it off in Settings › Profiles › Quota reading, or with agco quotas direct off. If that reading stops working, Settings › Profiles offers a second channel for each profile: a relay that keeps your statusline and receives the limits after each Claude Code answer.

It watches idle sessions. On a fresh install it records what it would have put to sleep and stops nothing. The report is in Settings › Hibernation.

It lists the processes closed sessions left running. To tell them apart, it reads the command line of processes adopted by launchd and the variables Claude Code sets on what it starts (CLAUDECODE, CLAUDE_CODE_SESSION_ID, CLAUDE_PID). It stops none of them unless you click Stop or turn on auto-clean.

It notifies you once when a working session has produced nothing for 15 minutes while its processes sit idle. Turn it off or change the delay in Settings › Notifications › Stuck sessions, or with agco stall-alert off and agco stall-alert --minutes 30.

Everything else waits until you turn it on: automatic hibernation, auto-clean of leftover processes, background session logs (Settings › LLM engine), shared MCP servers, the team space and session cards, the bus, and the Notion integration.

Privacy

The app has no account and no analytics. What it derives from your sessions stays on your Mac. Reading usage limits calls Anthropic using Claude Code's token. The LLM engine, Notion, the bus and the team space receive data only if you turn them on. docs/privacy.md lists every file the app reads and every recipient.

macOS permissions

Permission Why
Background item The daemon, agcod, indexes sessions and keeps running when the window is closed.
Automation (iTerm2 or Terminal) Going to the tab of a session, waking a session, adding an account. Asked the first time you use one of them.
Notifications A session that waits for you, a session that may be stuck, a session put to sleep, a usage alert.
Keychain Claude Code's token for usage limits, and the keys you give the app (LLM providers, Notion, team space).

The app does not ask for Full Disk Access, Accessibility or Screen Recording.

Automatic hibernation

Once enabled, hibernation follows the memory of your machine. Sessions may use a quarter of the RAM. Above that, sessions idle for at least 2 hours are put to sleep, the most idle first. A Mac with plenty of memory almost never puts a session to sleep, and a small one acts quickly. A session idle for more than a week is put to sleep in any case.

Every minute the app reads the free memory reported by macOS. As it drops, the idle delay shortens (down to 30 minutes), the memory budget and the number of protected sessions go down, and the checks get closer together (down to every 2 minutes).

These sessions are never put to sleep: the most recent ones (5 when memory is calm), those working or waiting for your answer, pinned ones, those running a command, and those with a scheduled wake-up (CronCreate, /loop), which going to sleep would cancel. agco keep <id> protects one more session.

Settings › Hibernation sets the rule (a share of the RAM from 10 to 50 %, or a fixed delay in hours) and how strongly it reacts to memory pressure. The page shows the current pressure, and the Performance view keeps its history.

Putting a session to sleep stops the session and everything it runs. A process it had already detached, such as a dev server started in the background, keeps running: Performance lists it among the session's leftover processes.

Working with several Claude accounts

In Settings › Profiles, "Add a Claude account" creates ~/.claude-<name>, shares the configuration of an existing profile with it, then opens a terminal tab on CLAUDE_CONFIG_DIR=~/.claude-<name> claude, where you sign in with the other account.

Sharing never replaces what is already there:

  • linked: skills, agents, commands, CLAUDE.md and project memory
  • copied: settings.json
  • added: the MCP servers that are missing.

"Shell claude function" adds a block to ~/.zshrc, removed in one click. After that, claude picks the account of each new session, in this order:

  1. The one you name: claude --account <name> (or --account=<name>), where the name is a profile's label or its folder (work for ~/.claude-work). The option is read by the function and never reaches Claude Code. An unknown name lists the profiles and starts nothing. A CLAUDE_CONFIG_DIR that is already set is respected too.
  2. For claude --resume <id> and claude --continue, the account that holds the session, so that it reopens where its transcript is.
  3. The pinned profile.
  4. A folder rule: claude started in that folder, or anywhere below it, uses its account. The deepest matching folder wins, and symlinks are resolved, so ~/Work2 does not match a rule for ~/Work.
  5. Otherwise, the account with the most headroom.

Folder rules are set in Settings › Profiles › Folder rules, or with agco profiles rule add ~/Work work. A rule keeps accounts apart, so it holds even when its account has reached a limit: claude starts on it anyway and prints one line with the limit, when it resets, and the claude --account command that starts on another account.

If the app does not answer, claude starts as it would without it. When an update of the app changes the function, the app rewrites the block in place; terminals already open keep the previous version until they close. Editor extensions and the Claude desktop app do not go through the shell.

A running session does not change account. Once it is asleep or stopped, agco move copies it to another profile, where it resumes. The prompt cache does not follow: the first turn on the other account reads the whole context again.

If you switch accounts with /logout and /login in the same folder, the app notices and offers to split them. A banner creates the folder for the second account, where you sign in one last time.

From the command line: agco profiles, agco profiles add <name>, agco profiles pick, agco profiles rules, agco profiles rule add <folder> <profile>, agco profiles rule remove <folder>, agco shell install.

Command line

agco sessions               # sessions of every profile
agco search "keyword"       # full-text search
agco search --nl "the session where I was setting up Reaper"   # search by the model
agco sleep <id>             # put a session to sleep
agco wake <id> --here       # resume it in this terminal
agco leftovers              # what closed sessions left running, and the memory it holds
agco recap                  # this week: sleeps, wakes, leftover processes stopped, memory freed
agco restore                # recreate the iTerm tabs from before the restart
agco quotas                 # usage limits per account, and the switch hint
agco stall-alert            # sessions that look stuck; on, off, --minutes 5 to 60
agco help <command>         # detailed help

LLM engine

It writes titles, logs and retrospectives, and runs the search by the model.

  • Titles and logs go through OpenRouter if a key is saved in Settings › LLM engine.
  • Without a key they go through claude -p (Haiku), on the Claude subscription of the most recently used profile.
  • Retrospectives and reports go through claude -p (Sonnet) first.

Security

The app trusts programs running under your macOS account, which can already read your transcripts and your keychain. It treats anything that comes from a transcript, a colleague, the team server or a web page as data and never as a command.

  • On the Mac: the daemon's socket is restricted to your account, but it does not check which program is connecting. Keychain secrets can be read back by a program running as you. The local bus has no authentication.
  • In the team space: content is end-to-end encrypted and the member registry is signed. The server still sees who is in which team, email addresses, who writes, when and how much. It can refuse to deliver, and an admin is still an admin.
  • The package is not notarized, and the project has had no independent audit.

The full list is in docs/threat-model.md. To report a vulnerability, see SECURITY.md.

Hosting a team space

deploy/ holds the Docker stack: a nats-server and the accounts service (server/agco-comptes, in Go). deploy/README.md describes the settings and how to start it. For remote connections, the app only accepts a server on https:// and a NATS address on tls:// or wss://, so plan for a proxy that terminates TLS in front of both ports.

Updating

The app checks for a new version every day, through https://agentcompanion.app/appcast.xml, which points to the latest release. It offers the update in a window with its release notes, then installs it and restarts. Settings › Updates controls the daily check and unattended installation, and "Check Now" is there too, as in the Agent Companion menu.

Every version is signed. The app refuses a package that does not carry its publisher's signature. After an update it restarts the daemon on the new version. The database, the settings and the macOS permissions stay in place.

A team that builds and publishes its own copy can serve its updates from its team space server instead (docs/releasing.md).

Uninstalling

  1. In Settings › Profiles, remove what was installed: the shell function, and the statusline relay of each profile (which restores your original statusline).
  2. Quit the app, and remove it from System Settings › General › Login Items.
  3. Move these to the Trash:
    • /Applications/Agent Companion.app
    • ~/.local/bin/agco
    • ~/Library/Application Support/AgentCompanion/, if you keep nothing
    • ~/Library/LaunchAgents/app.agentcompanion.daemon.plist, if it exists (a fallback used when macOS refuses the background item).

Build from source

You need Xcode 16 or later (Swift 6), and Go 1.27 or later for the peer-to-peer node (brew install go).

scripts/fetch-nats.sh       # optional: local bus binaries, checked against their SHA-256
scripts/build-app.sh        # build, sign and install in ~/Applications, then register the daemon
scripts/package-release.sh  # build the zip to distribute in build/release/, without installing
swift test                  # tests

build-app.sh signs with the local certificate created by scripts/make-cert.sh if there is one, and ad hoc otherwise. A copy built this way is updated with git pull and build-app.sh: automatic updates are not enabled in it. docs/releasing.md describes how to publish a version and serve its updates from a team space.

Known limitations

  • No Developer ID signature and no notarization, hence the xattr step for a copy you download.
  • The installation has not yet been tested on a fresh macOS account. If something gets in the way, open an issue.
  • Claude Code only. iTerm2 and Terminal are the terminals it drives, and restoring tabs works with iTerm2 only.
  • Reading usage limits relies on an Anthropic endpoint that is not documented. It may stop answering without notice.
  • The interface is in English and French. Some code comments are still in French: they are being translated to English.

Contributing

Issues and pull requests are welcome, in English or in French. CONTRIBUTING.md explains how to build, test and propose a change, and how a pull request is merged: it is applied to the development repository with your authorship kept, ships in the next version, and the commit of that version lists you as co-author.

Support the project

Agent Companion is free. If it saves you time, you can sponsor it on GitHub, once or every month, with any amount. Sponsorship pays for the project relay, the domain and the time spent on maintenance.

License

MIT, see LICENSE. Third-party code and its licenses are listed in THIRD_PARTY_NOTICES.md, and the package ships them in Contents/Resources/Licenses.

Reviews (0)

No results found