Claude Code and Codex with personal tokens
By Jonas Berg · created 21 Sep 2026, 12:10 UTC · last updated 19 Oct 2026, 09:20 UTC · version 6
emargenagentsclaude-codecodextokens
How I run Claude Code against Emargen, and how Aiko runs Codex. Same steps for both. The agent acts as you: everything it does in Emargen is done with your token and logged against it.
1. Make a token
- In Emargen, open the people area, then your own page, then Personal tokens.
- New token. Name it after the machine and the agent, e.g. "Claude Code on my laptop".
- Pick the tools it may use. Start with the ones below; you can change them later.
- Copy it once. It isn't shown again.
Keep the token in your keychain or password manager. Never in a repository, never in a shell history file, never in Slack.
2. Connect the agent
Add Emargen as an MCP server in Claude Code or Codex, with the address shown on the token page and the token as the bearer header. Restart the agent and ask it to list Emargen's tools. If it can't see them, the token or the address is wrong.
3. The tools we use
| Tool | What for |
|---|---|
get-slice-work | the slices and tasks of an initiative, with what is claimed |
claim-slice-task | claim a task before starting it |
add-slice-task | add work you found to a slice |
wait-on-slice-work | only when a task needs another task's output |
close-slice-task | close a task, with its merge request |
ask-about | a question only the initiative's people can answer |
propose-change | when what you build can't meet what was shaped |
note | leave yourself a note: a decision, a trap, a todo, an idea |
search-notes | check before writing a note twice |
The agent can also read and write topics; ask before giving it that.
4. Rules
- One task at a time. Claim, build, open the merge request, close. Then the next.
- The merge request names the task in its title. The reviewer opens the task to see what was asked.
- Tokens are personal. Don't share one, don't run an agent on someone else's token.
- Lost laptop or changed machine: revoke the token on the same page, then tell Mira.
- Every call is logged against your token. Your name is on what the agent does.
- An agent never claims tasks on a slice you aren't working on.
- Review the agent's merge request yourself before asking anyone else.
5. Notes and Coffee with agent
Claude Code leaves notes as it works: "requests are routed to the home depot, not the requested one", "no stand-in role before Kelderby's go-live, agreed". They land in my Inbox. Every weekday at 07:00 my private agent task, Coffee with agent, reads the notes from the day before and writes me a topic: what was decided, the traps, what's still open, what to pick up first.
6. Topics an agent keeps
After a session in identity-service on 8 October, Claude Code wrote down how depot assignments are stored, in a topic: ACM-309. I shared it with everyone to read. On 12 October, working on Kelderby's agency drivers (ACM-306), it read the topic again and added what one-shift access would need. Each session is one version of the topic, named after the session.
Change history
| Version | Date | Who | What |
|---|---|---|---|
| 1 | 21 Sep 2026 | Jonas | First version |
| 3 | 28 Sep 2026 | Aiko | Codex |
| 4 | 8 Oct 2026 | Jonas | Topics an agent keeps (ACM-309) |
| 5 | 13 Oct 2026 | Jonas | Coffee with agent |
| 6 | 19 Oct 2026 | Jonas | Revoke on a lost laptop; tell Mira |