Charles-mcp
AGENTS.md317 starsChanged 5 months agoMITView on GitHub
This file defines global agent behavior rules for charles-mcp. For task-specific call sequences, see docs/agent-workflows.md. For canonical public tool contracts, see docs/contracts/tools.md. Do not treat this server as a raw packet dump interface. 1. Never mix source identities: - live plane: capture_id - history plane: recording_path - reverse imported-analysis plane: reverse capture_id - reverse live-analysis plane: live_session_id 2. Preserve and reuse returned identifiers between calls. 3. Do not infer cross-plane identity fallback in agent logic. 4. Default plane = live.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Do not treat this server as a raw packet dump interface.
- Distinctive: line 22
Never mix source identities:
- Distinctive: line 28
Do not infer cross-plane identity fallback in agent logic.
- Very specific: line 29
Default plane = live: When the user asks about ongoing / just-now / 现在 / 正在发生的 traffic without explicitly naming a saved recording, start …
- Very specific: line 34
When unsure which plane to use, call charles_status first and follow its recommended_next_action.
- Distinctive: line 47
Prefer group/summary tools before detail tools:
- Distinctive: line 53
Use detail tools only for one confirmed target:
- Distinctive: line 56
Do not default to full body expansion:
- Very specific: line 57
keep include_full_body=false unless explicitly needed
- Distinctive: line 75
prefer task-oriented tools when goal is known:
- Very specific: line 80
read summary and report first
- Very specific: line 88
only status="stopped" means fully closed
- Distinctive: line 90
Prefer status checks over blind retries.
- Distinctive: line 91
Keep token usage low:
- Distinctive: line 94
avoid bulk detail expansion
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file defines global agent behavior rules for charles-mcp.
For task-specific call sequences, see docs/agent-workflows.md.
For canonical public tool contracts, see docs/contracts/tools.md.
1. Global operating model
- summary first, detail on demand
- live and history are separate source planes
- reverse analysis extends traffic inspection into replay / decode / signature workflows
- state identities must be preserved:
capture_id,cursor,recording_path,live_session_id
Do not treat this server as a raw packet dump interface.
2. Identity and plane rules
- Never mix source identities:
- live plane:
capture_id - history plane:
recording_path - reverse imported-analysis plane: reverse
capture_id - reverse live-analysis plane:
live_session_id
- live plane:
- Preserve and reuse returned identifiers between calls.
- Do not infer cross-plane identity fallback in agent logic.
- Default plane = live. When the user asks about ongoing / just-now /
现在 / 正在发生的 traffic without explicitly naming a saved recording,
start with
start_live_captureand stay on the live plane. Only switch tolist_recordings/query_recorded_traffic/analyze_recorded_trafficwhen the user explicitly references a.chlsjfile or 历史录包. - When unsure which plane to use, call
charles_statusfirst and follow itsrecommended_next_action. - Never clear the user's Charles session unless the user explicitly asks.
start_live_capturedefaults to adopting the user's ongoing session and preserves the traffic already captured there. Only passreset_session=truewhen the user explicitly asks to clear / wipe / 清空 the session before starting a fresh capture. A wrongly-passedreset_session=truedestroys the user's in-progress data and is not recoverable from this server.
3. Selection and expansion rules
- Prefer group/summary tools before detail tools:
group_capture_analysisquery_live_capture_entriesanalyze_recorded_trafficreverse_query_entries- task-oriented reverse live workflow tools
- Use detail tools only for one confirmed target:
get_traffic_entry_detailreverse_get_entry_detail
- Do not default to full body expansion:
- keep
include_full_body=falseunless explicitly needed
- keep
4. Read vs peek semantics
read_*tools consume or advance the current increment/cursor.peek_*tools preview without consuming or advancing.- Choose intentionally; do not replace one with the other casually.
5. Reverse workflow usage principles
- For reverse imported analysis:
- narrow with
reverse_query_entriesbefore detail/decode/replay.
- narrow with
- For reverse live analysis:
- preserve
live_session_id - prefer task-oriented tools when goal is known:
reverse_analyze_live_login_flowreverse_analyze_live_api_flowreverse_analyze_live_signature_flow
- preserve
- For task-oriented outputs:
- read
summaryandreportfirst - expand
evidenceonly when needed
- read
6. Recovery and token-budget principles
stop_live_capture:- only
status="stopped"means fully closed stop_failedwithrecoverable=trueandactive_capture_preserved=truemeans session still exists
- only
- Prefer status checks over blind retries.
- Keep token usage low:
- group first
- keep
max_itemssmall - avoid bulk detail expansion
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

