cache-perplexity-session

cache-perplexity-session is a command for Claude Code from intellegix/intellegix-code-agent-toolkit. It costs 0 tokens per session (1,167 once invoked), scanned B, original, MIT.

A command that saves login and preference data from an already signed-in Perplexity browser session. Perplexity is a web service for searching and asking questions, and the saved session can be reused by related commands.

In plain words
What is it for?
Use it to verify a signed-in Perplexity session, capture its cookies and relevant browser preferences, and prepare the session for council-related commands.
Why use it?
It avoids repeating fragile browser clicks to choose a model or restore the session when other commands use Perplexity. It requires the user to already be logged in through Chrome.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

Good fit Use it to verify a signed-in Perplexity session, capture its cookies and relevant browser preferences, and prepare the session for council-related commands.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/intellegix/intellegix-code-agent-toolkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cache-perplexity-session

README.md
[![agentmods](https://agentmods.dev/badge/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session/github.svg)](https://agentmods.dev/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session)
Your own site
<a href="https://agentmods.dev/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session"><img src="https://agentmods.dev/badge/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cache-perplexity-session

Your own site · 80×15
<a href="https://agentmods.dev/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session"><img src="https://agentmods.dev/badge/commands/intellegix/intellegix-code-agent-toolkit/cache-perplexity-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01167
Opus 5.5 $0.00000 $0.00467
Sonnet 5.5 $0.00000 $0.00233
Haiku 4.5 $0.00000 $0.00117

Measured 3mo ago against content hash 8c8af9291a2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

cache-perplexity-session scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Write to `~/.claude/config/perplexity-session.json`:
commands/cache-perplexity-session.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/cache-perplexity-session — Cache Perplexity Login for Council Commands

Capture Perplexity session state (cookies, localStorage, model preferences) from an already-authenticated browser session. Cached data is used by /council-refine and /export-to-council to skip fragile UI model-selector clicks.

Prerequisites: User must be logged into Perplexity in Chrome. Browser-bridge MCP server running with Chrome extension connected.

Input

$ARGUMENTS = Ignored (no arguments needed).

Workflow

Step 1: Navigate to Perplexity

  • browser_navigate to https://www.perplexity.ai/
  • Wait 3 seconds for full page load (auth state must be hydrated)

Step 2: Verify logged in

  • Take a screenshot to confirm the user is logged in
  • Look for indicators: user avatar, "New Thread" button, absence of "Sign in" button
  • If NOT logged in, abort with message: "Please log into Perplexity in Chrome first, then re-run this command"

Step 3: Read session cookies

  • Use browser_evaluate to read cookies:
    document.cookie
    
  • Store the result as cookies string

Step 4: Read localStorage preferences

  • Use browser_evaluate to read relevant localStorage keys:
    JSON.stringify(Object.fromEntries(
      Object.keys(localStorage)
        .filter(k => k.includes('session') || k.includes('model') || k.includes('user') || k.includes('auth') || k.includes('token') || k.includes('pplx') || k.includes('preference'))
        .map(k => [k, localStorage.getItem(k)])
    ))
    
  • Parse the JSON result as localStorageData

Step 5: Detect current model and council state

  • IMPORTANT: Council is NOT in the model selector dropdown. It's a separate "Model council" button/chip in the input toolbar area.
  • Use browser_evaluate to check for the council button:
    (function() {
      const btn = [...document.querySelectorAll('button')].find(b => b.textContent.trim() === 'Model council');
      const modelBtn = document.querySelector('button[aria-label="Choose a model"]');
      const threeModels = document.querySelector('button[aria-label="3 models"]');
      return {
        councilButton: btn ? { found: true, classes: btn.className, active: btn.className.includes('bg-subtle') } : { found: false },
        modelSelector: modelBtn?.textContent?.trim() || 'not found',
        threeModelsDropdown: threeModels ? true : false
      };
    })()
    
  • If council button found → currentModel = "council"
  • If council button NOT found → currentModel = modelSelector text

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 114 lines · 0 tokens per session scan B 8c8af9291a2e

Subscribe to this mod's changes

cache-perplexity-session is a command published in the GitHub repository intellegix/intellegix-code-agent-toolkit (57 stars, last pushed 7d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,167 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

cache-perplexity-session compared with commands from other repositories

cache-perplexity-session next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cache-perplexity-sessionintellegix/intellegix-code-agent-toolkitCommand577d agoMITB0Claude Code
qa-sweepRapierCraftStudios/ForgeDockCommand117yesterdayAGPL-3.0A26Claude Code
qa-chromechristopherlouet/claude-baseCommand514d agoMITA0Claude Code
e2eraja21068/AutoResearchCommand26mo agoMITA10Claude Code
cost-optimizewshobson/agentsCommand43k6d agoMITA26Claude Code
deps-auditwshobson/agentsCommand43k6d agoMITA23Claude Code
refactor-cleanwshobson/agentsCommand43k6d agoMITA26Claude Code