• bitcoinBitcoin(BTC)$60,420.000.30%
  • ethereumEthereum(ETH)$1,686.46-0.21%
  • tetherTether(USDT)$1.000.01%
  • binancecoinBNB(BNB)$553.010.21%
  • usd-coinUSDC(USDC)$1.000.01%
  • rippleXRP(XRP)$0.940.80%
  • solanaSolana(SOL)$70.920.52%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.062.14%
  • tronTRON(TRX)$0.3037200.14%
  • HyperliquidHyperliquid(HYPE)$61.941.03%
  • zcashZcash(ZEC)$683.91-10.15%
  • dogecoinDogecoin(DOGE)$0.0563070.76%
  • moneroMonero(XMR)$453.88-12.90%
  • leo-tokenLEO Token(LEO)$9.090.79%
  • whitebitWhiteBIT Coin(WBT)$60.994.27%
  • chainlinkChainlink(LINK)$9.262.50%
  • USDSUSDS(USDS)$1.000.03%
  • cardanoCardano(ADA)$0.1481251.78%
  • Ethena USDeEthena USDe(USDE)$1.00-0.04%
  • stellarStellar(XLM)$0.126702-1.00%
  • daiDai(DAI)$1.000.00%
  • bitcoin-cashBitcoin Cash(BCH)$209.382.11%
  • nearNEAR Protocol(NEAR)$3.040.40%
  • litecoinLitecoin(LTC)$43.783.02%
  • CantonCanton(CC)$0.075385-2.65%
  • avalanche-2Avalanche(AVAX)$6.58-0.68%
  • tether-goldTether Gold(XAUT)$3,559.01-0.26%
  • USD1USD1(USD1)$1.00-0.03%
  • uniswapUniswap(UNI)$4.63-1.96%
  • Ripple USDRipple USD(RLUSD)$1.000.01%
  • the-open-networkGram (prev. Toncoin)(GRAM)$0.960.27%
  • suiSui(SUI)$0.670.11%
  • Global DollarGlobal Dollar(USDG)$1.000.01%
  • hedera-hashgraphHedera(HBAR)$0.0538873.47%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.15-0.02%
  • paypal-usdPayPal USD(PYUSD)$1.000.03%
  • BittensorBittensor(TAO)$182.921.01%
  • quant-networkQuant(QNT)$147.261.44%
  • shiba-inuShiba Inu(SHIB)$0.0000041.11%
  • Spiko Amundi Overnight Swap Fund (EUR)Spiko Amundi Overnight Swap Fund (EUR)(EURSAFO)$1.12-0.06%
  • Circle USYCCircle USYC(USYC)$1.150.00%
  • crypto-com-chainCronos(CRO)$0.039925-0.33%
  • MemeCoreMemeCore(M)$0.830.42%
  • RainRain(RAIN)$0.002489-9.14%
  • okbOKB(OKB)$82.160.53%
  • Falcon USDFalcon USD(USDF)$1.000.04%
  • United StablesUnited Stables(U)$1.000.04%
  • pax-goldPAX Gold(PAXG)$3,557.21-0.35%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • BitwayBitway(BTW)$1.0010.66%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

Build a SuperClaude Framework Workflow with Commands, Agents, Modes, and Session Memory

May 23, 2026
in AI & Technology
Reading Time: 2 mins read
A A
Build a SuperClaude Framework Workflow with Commands, Agents, Modes, and Session Memory
ShareShareShareShareShare
class SuperClaude:
   """
   Mimics what Claude Code does at session start:
     • reads Markdown behavior files for the active command/agent/modes,
     • concatenates them into one system prompt,
     • runs the conversation through the Anthropic API.
   """
   BASE_SYSTEM = textwrap.dedent("""
   You are operating inside the SuperClaude Framework — a structured
   development platform layered on top of Claude. Treat the 
   block as your behavioral contract for this turn. If a behavioral
   instruction conflicts with the user request, prefer the instruction.
   Begin every answer with a short '▶ Active context:' line that names the
   command / agent / modes currently in effect.
   """).strip()
   def __init__(self, model=MODEL):
       self.model, self.history = model, []
   def _load(self, kind, name):
       if not name: return ""
       p = ASSETS[kind].get(name.lower())
       return p.read_text(encoding="utf-8", errors="ignore") if p else \
              f"# {kind}:{name} (not found — using inline defaults)"
   def _system(self, command=None, agent=None, modes=None, extra=None):
       parts = [self.BASE_SYSTEM, ""]
       if command: parts += [f"## Command /sc:{command}", self._load("commands", command)]
       if agent:   parts += [f"## Agent {agent}",         self._load("agents",   agent)]
       for m in (modes or []):
           parts += [f"## Mode {m}", self._load("modes", m)]
       if extra:   parts += ["## Extra directives", extra]
       parts.append("")
       return "\n\n".join(parts)
   def run(self, prompt, *, command=None, agent=None, modes=None, extra=None,
           max_tokens=1800, stream=True, remember=True):
       sys_prompt = self._system(command, agent, modes, extra)
       msgs = self.history + [{"role": "user", "content": prompt}]
       console.rule(
           f"[bold cyan]► /sc:{command or '—'}  agent={agent or '—'}  modes={modes or []}"
       )
       console.print(Panel(prompt, title="USER", border_style="blue"))
       console.print("[bold green]ASSISTANT ↓[/bold green]")
       text = ""
       try:
           if stream:
               with client.messages.stream(
                   model=self.model, max_tokens=max_tokens,
                   system=sys_prompt, messages=msgs,
               ) as s:
                   for chunk in s.text_stream:
                       sys.stdout.write(chunk); sys.stdout.flush()
                       text += chunk
                   print()
           else:
               r = client.messages.create(
                   model=self.model, max_tokens=max_tokens,
                   system=sys_prompt, messages=msgs,
               )
               text = "".join(b.text for b in r.content if b.type == "text")
               console.print(text)
       except Exception as e:
           console.print(f"[red]API error: {e}[/red]")
           return ""
       if remember:
           self.history += [{"role": "user", "content": prompt},
                            {"role": "assistant", "content": text}]
       return text
   def save(self, path="/content/sc_session.json", note=""):
       Path(path).write_text(json.dumps(
           {"meta": {"note": note, "saved_at": time.time(), "model": self.model},
            "history": self.history}, indent=2))
       console.print(f"💾 Session → {path}", style="bold yellow")
   def load(self, path="/content/sc_session.json"):
       d = json.loads(Path(path).read_text())
       self.history = d["history"]
       console.print(f"📂 Loaded {len(self.history)//2} prior turns", style="bold yellow")
sc = SuperClaude()

Credit: Source link

YOU MAY ALSO LIKE

Backloggd Urges Users To Change Their Passwords After A Breach

1Password Says It Was Hacked But Users’ Vaults Are Safe

ShareTweetSendSharePin

Related Posts

Backloggd Urges Users To Change Their Passwords After A Breach
AI & Technology

Backloggd Urges Users To Change Their Passwords After A Breach

November 26, 2026
1Password Says It Was Hacked But Users’ Vaults Are Safe
AI & Technology

1Password Says It Was Hacked But Users’ Vaults Are Safe

November 26, 2026
Canada Invests 0 Million More to Expand AI Compute Access Fund – Unite.AI
AI & Technology

Canada Invests $700 Million More to Expand AI Compute Access Fund – Unite.AI

November 26, 2026
Workers At GTA 6 Studio Rockstar Games Vote Overwhelmingly Against Union Recognition
AI & Technology

Workers At GTA 6 Studio Rockstar Games Vote Overwhelmingly Against Union Recognition

November 26, 2026
Next Post
USMNT World Cup full roster: Alejandro Zendejas is in, Tanner Tessmann misses out – The Guardian

USMNT World Cup full roster: Alejandro Zendejas is in, Tanner Tessmann misses out - The Guardian

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
Live storm updates: King tide flooding begins in Bay Area, causing road closures – ABC7 Bay Area

Live storm updates: King tide flooding begins in Bay Area, causing road closures – ABC7 Bay Area

November 24, 2026
Deposit Costs Climb As Banks Brace For Tougher Competition

Deposit Costs Climb As Banks Brace For Tougher Competition

November 21, 2026
Trucker shortage could cause holiday shopping squeeze

Trucker shortage could cause holiday shopping squeeze

November 25, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!