council-khaldun

council-khaldun is an agent for Claude Code from gamgee-ai/council-of-gamgee. It costs 58 tokens per session (1,542 once invoked), scanned A, original, MIT.

An AI advisor that studies how groups and institutions grow, change, and decline using ideas from Ibn Khaldun’s Muqaddimah, a 14th-century work on society and history.

In plain words
What is it for?
Use it to examine an organization’s health, cultural dynamics, institutional trajectory, or long-term rise and decline.
Why use it?
It helps connect current organizational problems with recurring historical patterns such as group cohesion, concentration of power, and decline.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to examine an organization’s health, cultural dynamics, institutional trajectory, or long-term rise and decline.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/gamgee-ai/council-of-gamgee/council-khaldun
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/gamgee-ai/council-of-gamgee

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 council-khaldun

README.md
[![agentmods](https://agentmods.dev/badge/agents/gamgee-ai/council-of-gamgee/council-khaldun/github.svg)](https://agentmods.dev/agents/gamgee-ai/council-of-gamgee/council-khaldun)
Your own site
<a href="https://agentmods.dev/agents/gamgee-ai/council-of-gamgee/council-khaldun"><img src="https://agentmods.dev/badge/agents/gamgee-ai/council-of-gamgee/council-khaldun/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 council-khaldun

Your own site · 80×15
<a href="https://agentmods.dev/agents/gamgee-ai/council-of-gamgee/council-khaldun"><img src="https://agentmods.dev/badge/agents/gamgee-ai/council-of-gamgee/council-khaldun.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 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,542 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00058 $0.01542
Opus 5.5 $0.00023 $0.00617
Sonnet 5.5 $0.00012 $0.00308
Haiku 4.5 $0.00006 $0.00154

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

Security

Grade A, and why

council-khaldun scanned grade A with 0 findings 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/council-khaldun.md · 153 lines

How it starts

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

Ibn Khaldun - The Historian

You are the historical analyst on a private advisory council. Your analytical framework is derived from Ibn Khaldun's Muqaddimah (1377), the first systematic theory of how civilizations, organizations, and power structures rise and fall. You see the present as a point on a cycle that has played out thousands of times before.

The Four Fundamental Forces

Every situation you analyze operates through these four primitive forces:

  1. Information Asymmetry -- who knows what others don't
  2. Network Concentration -- how connections cluster, where hubs and bridges exist
  3. Mimetic Desire -- people wanting what others want, contagious desire
  4. Entropy/Disequilibrium -- opportunity exists where things are NOT in balance

Your primary domain is the cyclical interaction of Forces 2 and 4 -- how networks form, concentrate, decay, and reform. But you track all four through historical pattern matching.

Your Analytical Methodology

Step 1: Asabiyyah Assessment

Asabiyyah is group cohesion -- the willingness of members to sacrifice for the collective. It is the single most important variable in whether a group rises or falls.

For the entity in question, assess:

Dimension Strong Asabiyyah (7-10) Weak Asabiyyah (1-3)
Shared identity Clear "we" vs "them" Fragmented, internal factions
Sacrifice willingness Members give up personal gain for group Members extract from group for personal gain
Leadership legitimacy Leader seen as first among equals Leader seen as self-serving
External threat response Unified, rapid, coordinated Blame-shifting, slow, disjointed
Recruitment Attracts talent through mission Attracts mercenaries through compensation
Internal trust High, informal, based on shared experience Low, formal, based on contracts and monitoring

Rate asabiyyah 1-10 and justify. This single number predicts more than any other metric.

Read the full file on GitHub · 153 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. 2mo ago First seen · 153 lines · 58 tokens per session scan A 4945d37d6327

Subscribe to this mod's changes

council-khaldun is an agent published in the GitHub repository gamgee-ai/council-of-gamgee (2 stars, last pushed 8mo ago), licensed MIT. It adds 58 tokens to every session and 1,542 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

plan-verifier

Read-only fresh-context review of one stable Plan envelope or execution slice before approval. Returns bare READY or structured REVISE and never executes, writes, or fixes.

Nanako0129/pilotfish · 37 tokens

verifier

Fresh-context calibrated outcome verification after implementation. Give it the claimed acceptance and relevant diff or paths; it independently runs tests, drives the affected flow, probes claim-relevant edge cases, and returns CONFIRMED, REFUTED, or INCONCLUSIVE. Read-and-run only; it never plans, edits, fixes, or…

Nanako0129/pilotfish · 70 tokens

executor

Implementation requiring judgment - feature work, bug fixes, refactors with design decisions, integration work. The default executor for real development tasks that are more than mechanical but don't need the frontier model. Give it the goal, constraints, and done-criteria; it makes reasonable local design decisions…

Nanako0129/pilotfish · 60 tokens

security-reviewer

Read-only security analysis before approval - authentication/authorization, secrets, crypto, validation, hardening, dependency vulnerability evidence, and threat review. Use it to gather and challenge security evidence for the main-session Plan; it never executes commands, changes state, or implements fixes.

Nanako0129/pilotfish · 58 tokens

Explore

Read-only search agent for broad fan-out searches - when answering means sweeping many files, directories, or naming conventions and you only need the conclusion, not the file dumps. It reads excerpts rather than whole files, so it locates code; it doesn't review or audit it. Specify search breadth - "medium" for…

Nanako0129/pilotfish · 79 tokens

Ekstraktor claimow z raportow researcherow

Extractor to tani posrednik miedzy Researcherem a Syntetykiem. Czyta jeden raport researchera (3-7k slow) i wyciaga z niego strukturalna tabele claimow z cytatami i metadanymi. Celem jest KOMPRESJA - redukcja 5000 slow surowego raportu do 300-500 slow gestego JSON, ktory Syntetyk konsumuje 10x szybciej i 10x taniej…

TheJacksonCode/Agent-Architecture · 123 tokens