setup · fcakyon, overleaf-skills — Claude Code skill: what it does, how to install
setup — a skill for Claude Code and Codex that configures and refreshes Overleaf session tokens for overleaf-skills. Runs when requests return 401 unauthorized or expired sessions.
Apache-2.0 ★ 1,216 updated 2026-11-09
/plugin marketplace add fcakyon/claude-codex-settings
/plugin install overleaf-skills@claude-settingsWhat setup does
The skill executes overleaf.py --check-auth to test current credentials. The script checks OVERLEAF_COOKIE, inspects ~/.claude/overleaf-skills/cookie, and attempts reading overleaf_session2 directly from Chrome using agent-browser. If the local host has no desktop browser, it can inspect a remote instance configured via OVERLEAF_CHROME_SSH_HOST.
When browser automation fails, it walks through DevTools steps across Chrome, Firefox, and Safari. The target row must be overleaf_session2 with an underscore, because legacy overleaf.session2 entries with a dot are rejected. The cookie carries the HttpOnly flag, which means document.cookie in DevTools console returns empty, leaving the Storage panel as the only viable source.
The input step validates the payload against an 80-character threshold, strips quotes, and confirms the s%3A prefix. A value starting with s%3Ac%3A1%3A gets flagged as an unauthenticated guest session. After checks pass, it creates a backup copy, writes the token to ~/.claude/overleaf-skills/cookie, applies chmod 600, and runs another auth test.
What it helps with
- resolve 401 unauthorized errors in Overleaf integrations
- extract active
overleaf_session2cookies from Chrome over SSH - validate pasted session tokens against anonymous guest patterns
- safely store session files with restricted 600 permissions
Example prompts for the agent
- Set up overleaf session cookie
- Fix overleaf auth failed with 401 unauthorized
- Help me refresh my overleaf_session2 cookie
How to install setup
1Plugin marketplace
/plugin marketplace add fcakyon/claude-codex-settings/plugin install overleaf-skills@claude-settingsThis installs the whole overleaf-skills plugin with all its skills
2Skills CLI (Vercel)
npx skills add fcakyon/claude-codex-settings --skill setup -a claude-code3Manually: put the files in place
~/.claude/skills/setup/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/setup/
1Skills CLI (Vercel)
npx skills add fcakyon/claude-codex-settings --skill setup -a codex2Manually: put the files in place
.agents/skills/setup/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add fcakyon/claude-codex-settings --skill setup -a cursor2Manually: put the files in place
.cursor/skills/setup/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install fcakyon/claude-codex-settings plugins/overleaf-skills/skills/setup2Manually: put the files in place
.github/skills/setup/SKILL.md1Skills CLI (Vercel)
npx skills add fcakyon/claude-codex-settings --skill setup -a gemini-cli2Platform CLI
gemini skills install https://github.com/fcakyon/claude-codex-settings --path plugins/overleaf-skills/skills/setupManually: put the files in place
.devin/skills/setup/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about setup
How to install setup in Claude Code?
Run /plugin marketplace add fcakyon/claude-codex-settings, then run /plugin install overleaf-skills@claude-settings.
What does setup do?
It verifies Overleaf credentials using overleaf.py, fetches cookies through Chrome if accessible, or guides manual entry into ~/.claude/overleaf-skills/cookie.
Why does Codex require path adjustments?
Claude Code populates ${CLAUDE_PLUGIN_ROOT} automatically, but Codex leaves the variable unexpanded, so you must point to the absolute path two levels above SKILL.md.
Source text
SKILL.md · Apache-2.0
---
name: setup
description: This skill should be used when user asks to "set up overleaf", "configure overleaf cookie", "overleaf auth failed", "overleaf 401", "overleaf session expired", "overleaf unauthorized", or needs to install or refresh their Overleaf session cookie for the overleaf-skills plugin.
---
# Overleaf Skills Setup
Make sure `overleaf.py` can authenticate. It tries `OVERLEAF_COOKIE`, then `~/.claude/overleaf-skills/cookie`, then reads `overleaf_session2` from a logged-in Chrome through `agent-browser` and saves it to the cookie file. The Chrome is the local one, or the one on the SSH host named by `OVERLEAF_CHROME_SSH_HOST` when this machine has no Chrome. Pasting a cookie by hand is the last resort.
Commands use `${CLAUDE_PLUGIN_ROOT}`, this plugin's root. Claude Code fills it in. Codex and Antigravity leave it as written, so replace it with the absolute path two directories above this SKILL.md.
## Step 1: Status check
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/overleaf.py --check-auth
```
- If `OK <email>`: report "Configured, logged in as <email>." Done.
- If it exits non-zero with the refresh hint: ask the user to log into overleaf.com in Chrome (on the `OVERLEAF_CHROME_SSH_HOST` machine when set), then rerun the check. If it still fails, or the user has no Chrome with `agent-browser` access, continue to Step 2.
## Step 2: Show browser guide
Tell the user to grab the cookie from their browser. Give all three branches; pick none for them:
**Chrome / Edge / Brave / Arc:** `Cmd+Option+I` (mac) or `F12` → **Application** tab → **Storage → Cookies → https://www.overleaf.com** → row where Name = `overleaf_session2` → double-click Value cell → `Cmd+A` → `Cmd+C`.
**Firefox:** `F12` → **Storage** tab (enable in DevTools settings if hidden) → **Cookies → https://www.overleaf.com** → click `overleaf_session2` row → right-click → **Copy Value**.
**Safari:** Enable Develop menu (**Settings → Advanced → Show features for web developers**), then `Cmd+Option+I` → **Storage** → **Cookies → www.overleaf.com** → click `overleaf_session2` row → copy from right-hand detail pane.
Add three warnings at the bottom:
1. The row name is `overleaf_session2` (UNDERSCORE). A row named `overleaf.session2` (DOT) is a stale legacy cookie that will not authenticate.
2. The cookie is `HttpOnly` — `document.cookie` in the JS console returns empty for it. The storage panel is the only path.
3. The value should start with `s%3A` and be ~80+ chars. If it starts with `s%3Ac%3A1%3A`, you're logged out — log into overleaf.com and re-grab.
## Step 3: Capture
Use AskUserQuestion: "Do you have your `overleaf_session2` cookie value ready?" with options "Yes, paste it now" and "Skip for now". The user pastes via the "Other" free-text field.
## Step 4: Validate
Normalize the input: strip whitespace; if it does NOT start with `overleaf_session2=`, prepend it (accept bare value).
Reject (re-prompt with reason):
- Starts with `overleaf.session2=` → "Overleaf renamed this cookie to `overleaf_session2` (underscore). Re-grab the underscore row."
- Value (after the `=`) starts with `s%3Ac%3A1%3A` → "That's an anonymous-visitor cookie. Log into overleaf.com first, then re-grab."
- Value does not start with `s%3A` after the `=` → "Doesn't look like an Overleaf session cookie. Confirm you copied from the `overleaf_session2` row on www.overleaf.com."
- Total length under 80 chars → "Cookie looks truncated. Re-copy with `Cmd+A` inside the Value cell."
- Contains newlines or quotes → "Strip the surrounding quotes/newlines."
## Step 5: Write
```bash
mkdir -p ~/.claude/overleaf-skills
[ -f ~/.claude/overleaf-skills/cookie ] && cp ~/.claude/overleaf-skills/cookie ~/.claude/overleaf-skills/cookie.backup
# Write the normalized value (one line, no trailing newline beyond what's natural)
printf '%s\n' "<normalized-cookie>" > ~/.claude/overleaf-skills/cookie
chmod 600 ~/.claude/overleaf-skills/cookie
```
## Step 6: Verify
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/overleaf.py --check-auth
```
- If `OK <email>`: report "Configured. Logged in as <email>." Done.
- If it exits non-zero: restore from `cookie.backup` if it exists (`mv ~/.claude/overleaf-skills/cookie.backup ~/.claude/overleaf-skills/cookie`), tell user the new cookie did not authenticate, loop back to Step 2.
© Fatih C. Akyon · Apache-2.0 · fcakyon/claude-codex-settings
Similar skills
All skills for Agent setup: memory, context, orchestration →setup by other authors comes first.